personalrobotics / ada_feeding

Robot-assisted feeding demos and projects for the ADA robot
4 stars 4 forks source link

Add a collision wall between the forktip and user in `MoveFromMouth` #100

Closed amalnanavati closed 12 months ago

amalnanavati commented 12 months ago

Description

In service of #96 . Earlier, sometimes the kinematic motion of MoveFromMouth would move closer to the user, which seems scary and unintuitive. This PR addresses that by:

  1. Generalizing MoveCollisionObject to ModifyCollisionObject, which now has the ability to add, move, and remove a collision object.
  2. Adding a collision wall (see below) in front of the user's face in MoveFromMouth during the kinematic motion. Screenshot 2023-09-19 at 3 31 07 PM
  3. Allows ToggleCollisionObject to take a list of collision IDs. This ended up being unused in this PR, but is a strict generalization so we decided to merge it in.

Design Decisions

Originally, #96 asked for adding this collision wall for all actions but MoveToMouth/MoveFromMouth's cartesian motions. That is still an option. However, such a collision wall might end up unnecessary restricting where the "elbow" (joint 3) of the robot can go, e.g., for an acquisition motion, maybe the elbow needs to slightly enter the wall. Because the main observed problem that this is solving occurs in MoveFromMouth, I opted to only add/remove the wall in MoveFromMouth. However, if further problems arise, we can make this wall be permanently there except for the final motion into/out of the mouth.

Testing procedure

Run the code as documented in the README. Then, run the below sequence of actions and verify (a) that they succeed; and (b) that the collision wall appears and disappears as expected.

Before opening a pull request

Before Merging