personalrobotics / ada_feeding

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

Enable staging configuration customization #177

Closed amalnanavati closed 4 months ago

amalnanavati commented 4 months ago

Description

This PR, joint with feeding_web_interface#136, makes multiple exapnsions to ada_feeding to enable users to customize the staging configuration through the web app. These include:

  1. Expanded the service that gets joint states to also get poses of arbitrary child frames in arbitrary parent frames of reference (e.g., to get the end effector post for MoveFromMouth).
  2. Making MoveToMouth ignore face orientation. This effectively maintains the orientation at the staging configuration, which is reasonable because the camera has to be facing the face, and the camera has the same orientation as the fork.
  3. Expanding Start/Stop Servo to also deactivate the cartesian controller, a bug introduced by #175 .
  4. Expanding ada_planning_scene to reject faces and tables that are too far away from the expected position. This is because when customizing the staging configuration, it is possible that the robot arm is above the plate but face detection is toggled on, and sometimes it wrongly detects a face in the pattern of the table (e.g., wood grain).
  5. Changing MoveToMouth and MoveFromMouth to direct cartesian control, ignoring the MoveIt planning scene. Since that changes the speed of motion to/from the mouth, we also lower the speed near the mouth (interpolating between the earlier speed and a slower speed near the mouth).
  6. The PR also slightly pitches the default AbovePlate configuration so the camera is parallel to the table, to improve the angle that the user sees the plate from.
  7. Fix a bug in create_action_servers where when a new namespace is created, the trees aren't updated to default parameters.
  8. Make face detection more robust, by rejecting outliers when fitting a plan, and by using the median instead of the average.

Testing procedure

Before opening a pull request

Before Merging