personalrobotics / ada_meal_scenario

A set of scripts for a meal serving scenario using Ada.
1 stars 4 forks source link

Speed up planning by pre-computing trajectories #13

Closed mkoval closed 9 years ago

mkoval commented 9 years ago

There are only two configurations in the demo, feed and perceive. You can pre-compute the trajectory from perceive to feed. Then reverse it to get a trajectory from feed back to perceive. This trajectory only needs to be computed once, when you load the demo script.

It's not possible to pre-compute the trajectory from perceive to stab the bite, since it depends on perception. But, once planned, you can just reverse this trajectory to get back to perceive.

mkoval commented 9 years ago

Also, try switching to VectorFieldPlanner to stab the bites. It should be much faster than the alternatives.

Stefanos19 commented 9 years ago

Done. The VectorFieldPlanner appears to fail, as it throws the error 'Deviated from straight line constraint.' Removing this constraint results in the planner generating trajectories that are not straight.

mkoval commented 9 years ago

VectorFieldPlanner won't always succeed, but it should succeed (or fail) quickly. It's a good planner to run as the first of several candidates in a Sequence meta-planner. In our experience, it succeeds surprisingly often.

You should take a look at the new planning sequence we use on HERB. Something similar might be appropriate for ADA.

@siddhss5 Do you know if VectorFieldPlanner correctly handles continuous joints? Maybe this explains the failures on ADA?

Stefanos19 commented 9 years ago

Ok, done: https://github.com/personalrobotics/ada/blob/master/adapy/src/adapy/adarobot.py#L83 I used the planning sequence of HERB 1.4.0, since this is compatible with prpy 0.4.0

Stefanos19 commented 9 years ago

@siddhss5 @mkoval @jeking04 As just a random thought, if we want to make this demo super-fast and until we fix all the issues with the planner performance, is it worth considering to have a demo with all the planning offline? For grasping the bites, we can generate a 2D grid with some resolution (let's say 1cm^2) representing bite locations, cache a bunch of trajectories and execute the nearest neighbor based on perception. I wonder if this would be a reasonable back-up plan.

siddhss5 commented 9 years ago

This is a good backup. Check out issue #27 for another online fix.

Stefanos19 commented 9 years ago

@siddhss5 @mkoval @jeking04 Here is a video with all trajectories pre-computed offline, which we can use as backup: https://www.youtube.com/watch?v=GCfkNhgDdj4&feature=youtu.be