Trajectory Generation, bonus step
Bonus: Fastest legal pick
Race the red ball into the cup without ever breaking a joint's speed or acceleration limit.
Builds on Mass, inertia & F = ma, from the free Foundations.
Write and run this step in the simulator with ProA race with rules
Put the red ball in the cup as fast as you can. The catch: no command may ever ask a joint to exceed arm.vmax or arm.amax. Everything is unlocked (move_joints, move_to, arm.ik, arm.stream and your own profiles), and the limits are checked on every command of the run, whichever helper sent it.
The starter is the Pick & Place solution. It gets the ball in, but its transit to the cup swings the base at twice its speed limit.
Where the time goes
move_jointsandmove_touse min-jerk timing over a duration you choose. Withmove_jointsevery joint follows the min-jerk curve, which peaks at in speed and in acceleration.move_toruns it along the Cartesian line instead, so its joint speeds depend on the path. Make too short and you break a limit; too long and you waste time.- Your synchronised trapezoid from Step 4 is the fastest joint-space straight line there is, so reuse it.
- A straight Cartesian descent is the safe way onto a ball. Over a few centimetres, though, a joint-space move is almost straight too.
- The servos lag behind the commands.
move_jointsandmove_towait for them to catch up (for up to 0.6 s) before they return, and that wait costs time too.arm.streamandset_joint_targetsdon't wait, so after a fast streamed move give the servos a moment before you close the gripper, or the fingers will close next to the ball. gripper.close()andgripper.open()each wait for the fingers to move.
Your task
Grasp the red ball and release it over the cup, as early as you can. The ball must end up in the cup, and every command must respect the limits: speed within 2% and acceleration within 5%.
Bonus: open the gripper over the cup less than 5.2 s after the start.