nepfaff / tenaci

Software for a robotic manipulator that can rotate and stack cubes, draw sketches, and prepare a miniature breakfast.
0 stars 0 forks source link

Solution to task 2c IK issue #20

Closed nepfaff closed 2 years ago

nepfaff commented 2 years ago

The below image shows missing points where we couldn't fin task space trajectory set points due to joint limit constraints. image

The solution that produced this image was replacing error with continue in TaskSpaceTrajectorySetPoints.m. This solution should be fine if there are few points in a trajectory that are infeasible. However, this image shows almost the entire trajectory being infeasible. In that case, the control method does not quite work as we are not pausing enough before sending new position commands to the joint angles. Hence, the set-point loop will finish way before the motion finishes. This causes the gripper opening to change mid-motion.

A naive fix could be to maintain a counter of skipped set-points. We then insert this many instances of the first feasible set-point.

nepfaff commented 2 years ago

Another naive solution could be to return errors from the task space trajectory functions. We can then try joint space interpolation instead. So joint space spline if task space spline failed and joint space single cubic if task space single cubic failed. It should be quite straightforward to modify existing task space trajectory functions into joint space ones (modify copy). Can joint space interpolation ever violate joint limits? Probably not as going from one feasible angle to another should not pass by infeasible angles.

nepfaff commented 2 years ago

Another naive solution could be to return errors from the task space trajectory functions. We can then try joint space interpolation instead. So joint space spline if task space spline failed and joint space single cubic if task space single cubic failed. It should be quite straightforward to modify existing task space trajectory functions into joint space ones (modify copy). Can joint space interpolation ever violate joint limits? Probably not as going from one feasible angle to another should not pass by infeasible angles.

This is now implemented (see here). Simulated results of this look very promising. The implementation allows tuning of how many missing task space set-points we want to allow before replacing the entire trajectory with a joint space one. It is currently set to zero.