Skip to content

Instantly share code, notes, and snippets.

@rwaldron

rwaldron/a.js

Last active Aug 29, 2015
Embed
What would you like to do?
Servo.animateGroup({
cuePoints: [0.125, 0.5, 0.625, 1.0],
duration: 2000,
members: [
{ servo: lf.coxa, deg: [82, dir === "fwd" ? 130 : 82, 103, 103] },
{ servo: lf.femur, deg: [111, dir === "fwd" ? 0 : 111, 70, 70] },
{ servo: lf.tibia, deg: [103, 103, 77, 77] },
{ servo: lb.coxa, deg: [98, dir === "fwd" ? 98 : 130, 77, 77] },
{ servo: lb.femur, deg: [111, dir === "fwd" ? 111 : 0, 70, 70] },
{ servo: lb.tibia, deg: [103, 103, 77, 77] },
{ servo: rf.coxa, deg: [77, 77, 98, dir === "fwd" ? 50 : 98] },
{ servo: rf.femur, deg: [70, 70, 111, dir === "fwd" ? 0 : 111] },
{ servo: rf.tibia, deg: [77, 77, 103, 103] },
{ servo: rb.coxa, deg: [103, 103, 82, dir === "fwd" ? 82 : 50] },
{ servo: rb.femur, deg: [70, 70, 111, dir === "fwd" ? 111 : 0] },
{ servo: rb.tibia, deg: [77, 77, 103, 103] }
]
});
Servo.animateGroup({
cuePoints: [0.125, 0.5, 0.625, 1.0],
duration: 2000,
servos: [
lf.coxa, lf.femur, lf.tibia, lb.coxa, lb.femur, lb.tibia,
rf.coxa, rf.femur, rf.tibia, rb.coxa, rb.femur, rb.tibia,
],
members: [
{ deg: [82, dir === "fwd" ? 130 : 82, 103, 103] },
{ deg: [111, dir === "fwd" ? 0 : 111, 70, 70] },
{ deg: [103, 103, 77, 77] },
{ deg: [98, dir === "fwd" ? 98 : 130, 77, 77] },
{ deg: [111, dir === "fwd" ? 111 : 0, 70, 70] },
{ deg: [103, 103, 77, 77] },
{ deg: [77, 77, 98, dir === "fwd" ? 50 : 98] },
{ deg: [70, 70, 111, dir === "fwd" ? 0 : 111] },
{ deg: [77, 77, 103, 103] },
{ deg: [103, 103, 82, dir === "fwd" ? 82 : 50] },
{ deg: [70, 70, 111, dir === "fwd" ? 111 : 0] },
{ deg: [77, 77, 103, 103] }
]
});
Servo.animateGroup({
cuePoints: [0.125, 0.5, 0.625, 1.0],
duration: 2000,
servos: [
lf.coxa, lf.femur, lf.tibia, lb.coxa, lb.femur, lb.tibia,
rf.coxa, rf.femur, rf.tibia, rb.coxa, rb.femur, rb.tibia,
],
members: [
[82, dir === "fwd" ? 130 : 82, 103, 103],
[111, dir === "fwd" ? 0 : 111, 70, 70],
[103, 103, 77, 77],
[98, dir === "fwd" ? 98 : 130, 77, 77],
[111, dir === "fwd" ? 111 : 0, 70, 70],
[103, 103, 77, 77],
[77, 77, 98, dir === "fwd" ? 50 : 98],
[70, 70, 111, dir === "fwd" ? 0 : 111],
[77, 77, 103, 103],
[103, 103, 82, dir === "fwd" ? 82 : 50],
[70, 70, 111, dir === "fwd" ? 111 : 0],
[77, 77, 103, 103]
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.