Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Add Admittance Control to Open Lever Handle Door (#22)
Browse files Browse the repository at this point in the history
* Moved admittance controller configs from base package to site package
* Renamed open_door_affordance to open_cabinet_door_affordance
* Added ForceSuccess to more open_door objectives so they will work in sim
  • Loading branch information
chancecardona authored Aug 1, 2023
1 parent c2bcffc commit baef76e
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
<BehaviorTree ID="Open Cabinet Door" _description="Open a cabinet door by grasping and pulling its handle">
<Control ID="Sequence" name="Setup">
<!-- Tare the force torque sensor -->
<!-- Wrap in a ForceSuccess as Sim doesn't have the zero_ftsensor service -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="CallTriggerService" service_name="/io_and_status_controller/zero_ftsensor" />
</Decorator>
<!-- Set admittance control parameters at the start of the Objective -->
<Action ID="UpdateAdmittanceController" config_file_name="open_door_admittance_controller_config.yaml"/>
<!-- Wrap in a ForceSuccess as Sim doesn't have the admittance controller loaded -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="UpdateAdmittanceController" config_file_name="open_cabinet_door_admittance_controller_config.yaml"/>
</Decorator>
<!-- Execute the Objective -->
<Action ID="LoadObjectiveParameters" config_file_name="open_door_affordance_config.yaml" parameters="{parameters}" />
<Action ID="LoadObjectiveParameters" config_file_name="open_cabinet_door_affordance_config.yaml" parameters="{parameters}" />
<Action ID="GetPoseFromUser" parameter_name="process_door_selection.hinge_axis_pose_end" parameter_value="{hinge_axis_pose_end}" />
<Action ID="GetPoseFromUser" parameter_name="process_door_selection.hinge_axis_pose_start" parameter_value="{hinge_axis_pose_start}" />
<Action ID="GetPoseFromUser" parameter_name="process_door_selection.grasp_pose" parameter_value="{grasp_pose}" />
Expand Down
10 changes: 8 additions & 2 deletions src/picknik_ur_site_config/objectives/open_cabinet_door_ml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
<BehaviorTree ID="Open Cabinet Door ML"
_description="Move to Home waypoint, and then open a cabinet door detected by a network">
<Control ID="Sequence" name="Setup">
<!-- Wrap in a ForceSuccess as Sim doesn't have the zero_ftsensor service -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="CallTriggerService"
service_name="/io_and_status_controller/zero_ftsensor" />
</Decorator>
<Action ID="UpdateAdmittanceController"
config_file_name="open_door_admittance_controller_config.yaml" />
<!-- Wrap in a ForceSuccess as Sim doesn't have the admittance controller loaded -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="UpdateAdmittanceController"
config_file_name="open_cabinet_door_admittance_controller_config.yaml" />
</Decorator>
<Action ID="LoadObjectiveParameters" config_file_name="open_door_affordance_config.yaml"
parameters="{parameters}" />
<Action ID="GetPointCloud" topic_name="/wrist_mounted_camera/depth/color/points" message_out="{point_cloud}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<Control ID="Sequence" name="Setup">
<Action ID="LoadObjectiveParameters"
config_file_name="open_lever_handle_door_config.yaml" parameters="{parameters}" />
<!-- Wrap in a ForceSuccess as Sim doesn't have the admittance controllers -->
<!-- This should eventually get overridden for non sim site configs to not ForceSuccess -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="UpdateAdmittanceController"
config_file_name="open_lever_handle_door_admittance_controller_config.yaml" />
</Decorator>
<Action ID="GetPointCloud" topic_name="/wrist_mounted_camera/depth/color/points" message_out="{point_cloud}" />
<Action ID="PublishPointCloud" point_cloud="{point_cloud}"
point_cloud_topic="studio_vision_debug_snapshot" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
UpdateAdmittanceController:
controller_name: "admittance_controller_open_door"
end_effector_frame: "grasp_link"
control_frame: "grasp_link"
admittance:
selected_axes:
x: True
y: True
z: True
rx: True
ry: True
rz: True
mass_position: # kg
x: 10.0
y: 10.0
z: 10.0
min: 0.001
max: 100.0
mass_rotation: # kg*m^2
x: 5.0
y: 5.0
z: 5.0
min: 0.001
max: 100.0
stiffness_position: # N/m
x: 500.0
y: 500.0
z: 500.0
min: 0.0
max: 1000.0
stiffness_rotation: # N*m/rad
x: 100.0
y: 100.0
z: 100.0
min: 0.0
max: 1000.0
damping_ratio_position: # unitless
x: 5.0
y: 5.0
z: 5.0
min: 0.0
max: 100.0
damping_ratio_rotation: # unitless
x: 5.0
y: 5.0
z: 5.0
min: 0.0
max: 100.0
joint_damping: # 1/s
value: 5.0
min: 0.0
max: 100.0
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ SetupMTCOpenLeverHandleDoor:
ik_frame_name: "grasp_link"

# List of controllers to use during the stages that interact with the door.
# We are currently not using admittance control for this objective since it's not needed.
door_opening_controllers: "/joint_trajectory_controller /robotiq_gripper_controller"
door_opening_controllers: "/joint_trajectory_controller_chained_open_door /admittance_controller_open_door /robotiq_gripper_controller"

# The hand should be placed 75% of the way down the handle length when
# manipulating the handle. Valid value range [0, 1.0].
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0"?>
<root BTCPP_format="4" main_tree_to_execute="Open Lever Handle Door ML">
<!-- ////////// -->
<BehaviorTree ID="Open Lever Handle Door ML" _description="Move to Door waypoint, and then open a lever handle door detected by a network">
<Control ID="Sequence" name="Setup">
<Action ID="LoadObjectiveParameters" config_file_name="open_lever_handle_door_ml_config.yaml" parameters="{parameters}"/>
<!-- Wrap in a ForceSuccess as Sim doesn't have the admittance controller loaded -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="UpdateAdmittanceController"
config_file_name="open_lever_handle_door_admittance_controller_config.yaml" />
</Decorator>
<!-- Wrap in a ForceSuccess as Sim doesn't have the zero_ftsensor service -->
<!-- See https://github.com/PickNikRobotics/moveit_studio/issues/3406 -->
<Decorator ID="ForceSuccess">
<Action ID="CallTriggerService"
service_name="/io_and_status_controller/zero_ftsensor" />
</Decorator>
<Action ID="GetPointCloud" topic_name="/wrist_mounted_camera/depth/color/points" message_out="{point_cloud}" />
<Action ID="UpdatePlanningSceneService" point_cloud="{point_cloud}"
point_cloud_service="/point_cloud_service" />
<Action ID="SendPointCloudToUI" point_cloud="{point_cloud}"
sensor_name="scene_scan_camera" pcd_topic="/pcd_pointcloud_captures"
point_cloud_uuid="" />
<Action ID="MoveToJointState"
waypoint_name="Door"
planning_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
use_all_planners="true" />
<Action ID="DetectObjects"
rgb_image_topic="/wrist_mounted_camera/color/image_raw"
depth_image_topic="/wrist_mounted_camera/depth/image_rect_raw"
camera_info_topic="/wrist_mounted_camera/color/camera_info"
detect_objects_action_name="/detect_objects"
object_detections_goal="{object_detections_goal}"
object_detections_result="{object_detections_result}"
min_probability="0.1"/>
<Action ID="GetLeverHandleFromDetections"
object_detections_goal="{object_detections_goal}"
object_detections_result="{object_detections_result}"
fit_object_3d_service_name="fit_object_3d"
handle_pose="{handle_pose}"
length="{length}"
height="{height}"/>
<SubTree ID="CloseGripper"/>
<Control ID="Sequence" name="OpenLeverHandleDoor">
<Action ID="InitializeMTCTask" task_id="open_lever_handle_door_ml" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" task="{open_lever_handle_door_task}"/>
<Action ID="SetupMTCCurrentState" task="{open_lever_handle_door_task}"/>
<Action ID="SetupMTCOpenLeverHandleDoor"
handle_pose="{handle_pose}"
handle_length="{length}"
handle_z_offset="{height}"
parameters="{parameters}"
task="{open_lever_handle_door_task}"/>
<Action ID="PlanMTCTask" solution="{open_lever_handle_door_solution}" task="{open_lever_handle_door_task}"/>
<Fallback>
<Inverter>
<Action ID="IsUserAvailable"/>
</Inverter>
<Action ID="WaitForUserTrajectoryApproval" solution="{open_lever_handle_door_solution}"/>
</Fallback>
<Action ID="ExecuteMTCTask" solution="{open_lever_handle_door_solution}"/>
</Control>
</Control>
</BehaviorTree>
<!-- ////////// -->
<BehaviorTree ID="CloseGripper">
<Control ID="Sequence" name="CloseGripper">
<Action ID="MoveGripperAction" gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd" position="0.7929"/>
</Control>
</BehaviorTree>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SetupMTCOpenLeverHandleDoor:
arm_group_name: "manipulator"
end_effector_group_name: "gripper"
ik_frame_name: "grasp_link"

# List of controllers to use during the stages that interact with the door.
door_opening_controllers: "/joint_trajectory_controller_chained_open_door /admittance_controller_open_door /robotiq_gripper_controller"

# The hand should be placed 75% of the way down the handle length when
# manipulating the handle. Valid value range [0, 1.0].
handle_grasp_offset_percent: 0.75
# The distance above the handle the robot should approach with before
# manipulating it.
above_handle_approach_distance: 0.03 # meters
# The distance the hand should move past the end of the handle to release it.
release_handle_distance: 0.03 # meters
# How many degrees to rotate the lever handle (use positive value for
# counter-clockwise rotation and negative value for clockwise rotation).
handle_twist_angle: 65.0 # degrees
approach_distance: 0.15 # meters
push_open_distance: 0.05 # meters
use_circular_arc: true

0 comments on commit baef76e

Please sign in to comment.