Comments about Collision Avoidance

Hello!

Thank you very much for the detailed collision avoidance tutorial, it has been very helpful for getting started. For some context, I’ve made a hand+table collision model that looks at whether the pinky or thumb might collide with the table. When the hand is open in a palm down pose, we would set a slightly higher lift_lower_limit compared to when the hand is supinated 90 deg (karate chop). This is because the hand makes a C-shape in an open pose (thumb points away from the palm).

Some problems I ran into:

  • The RobotCollisionManager does not allow setting joint limits that are less conservative than the current soft_motion_limits of that joint. This was problematic for our application because we would want to set a less conservative lift_lower_limit when the hand was in a karate chop pose compared to palm down pose.
  • The enable/disable_model methods did not seem to be working as intended. The models_enabled flags seem to only be used on startup but are not checked in step().

Minor issues:

  • Would it be possible to add an option for set_soft_motion_limits() to not modify one or both limits? Currently, it feels a bit unintuitive to use:
    self.collision_manager.robot.lift.soft_motion_limits[0]
    (or maybe just add a line in the collision avoidance tutorial for future users).
  • Renaming class RobotCollision to RobotCollisionManager like it is described in the comments for clarity.

Thanks for your help!
Lionel

Great to hear the tutorial was valuable, and thank you for the detailed feedback. We will integrate your feedback into the next release of Stretch Body.

1 Like

Thank you, Dr. Edsinger!

An update! We’ve just released Stretch Body v0.1.6 that integrates your feedback on the collision avoidance functionality (along with various bug-fixes). These updates can be installed

>>$ pip2 install hello-robot-stretch-body -U --no-cache-dir
>>$ pip2 install hello-robot-stretch-body-tools -U --no-cache-dir
>>$ pip2 install hello-robot-stretch-factory -U --no-cache-dir
>>$ pip2 install hello-robot-stretch-tool-share -U --no-cache-dir

Unfortunately we had to change the API a bit. Previously you might call:

lift.set_soft_motion_limit(min_val,max_val). 

Now we support setting individual limits by:

lift.set_soft_motion_limit_min(min_val)
lift.set_soft_motion_limit_max(max_val)

Stretch Body also now distinguishes between Collision limits and User limits. In this way the two constraints can co-exist without overwriting each other. The most conservative joint range between the two is applied). This is further explained in the code here.

Thanks for the feedback and let us know if there are any questions!

1 Like

I should also highlight for other users that the collision avoidance functionality is considered ‘experimental’ and is turned off by default. To turn it on, add to your user YAML:

robot:
  use_collision_manager: 1

Stretch Body includes two collision avoidance models (found here). One (mostly) avoids collisions between the arm and the camera. The other (mostly) avoids collisions between the gripper and the base.

Thank you! We will test this out next week.