Skip to content

Commit

Permalink
Updating pick orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeWrock committed Dec 12, 2024
1 parent efdcc91 commit 973f81f
Show file tree
Hide file tree
Showing 6 changed files with 308 additions and 203 deletions.
2 changes: 1 addition & 1 deletion src/lab_sim/description/picknik_ur.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@
<param name="render_publish_rate">10</param>
<param name="tf_publish_rate">60</param>
<param name="lidar_publish_rate">10</param>
<param name="mujoco_viewer">true</param>
<param name="mujoco_viewer">false</param>
</hardware>
</ros2_control>
</robot>
96 changes: 79 additions & 17 deletions src/lab_sim/objectives/constrained_pick_and_place_subtree.xml
Original file line number Diff line number Diff line change
@@ -1,44 +1,106 @@
<root BTCPP_format="4" main_tree_to_execute="Constrained Pick and Place Subtree">
<?xml version="1.0" encoding="utf-8" ?>
<root
BTCPP_format="4"
main_tree_to_execute="Constrained Pick and Place Subtree"
>
<!--//////////-->
<BehaviorTree ID="Constrained Pick and Place Subtree" _subtreeOnly="true" _description="">
<BehaviorTree
ID="Constrained Pick and Place Subtree"
_subtreeOnly="true"
_description=""
>
<Control ID="Sequence">
<!--Create a special type of motion planning configuration that includes an upwards orientation requirement-->
<Action ID="InitializeMotionConstraints" constraints_name="gripper pointing down" constraints="{constraints}"/>
<Action ID="AppendOrientationConstraint" config_file_name="my_constraints.yaml" constraints="{constraints}"/>
<Action
ID="InitializeMotionConstraints"
constraints_name="gripper pointing down"
constraints="{constraints}"
/>
<Action
ID="AppendOrientationConstraint"
config_file_name="my_constraints.yaml"
constraints="{constraints}"
/>
<!--Move to pick location-->
<!--Note: Sampling based planners can be non-deterministic. The retry decorator improves the likelihood of success-->
<Decorator ID="RetryUntilSuccessful" num_attempts="3">
<SubTree ID="Move to Waypoint" waypoint_name="{pre_pick}" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/>
<SubTree
ID="Move to Waypoint"
waypoint_name="{pre_pick}"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
</Decorator>
<Decorator ID="RetryUntilSuccessful" num_attempts="3">
<SubTree ID="Move to Waypoint" waypoint_name="{pick}" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/>
<SubTree
ID="Move to Waypoint"
waypoint_name="{pick}"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
</Decorator>
<!--We force success as the gripper closes, since we are commanding a position it will never reach (fingers fully closed)-->
<Decorator ID="ForceSuccess">
<SubTree ID="Close Gripper"/>
<SubTree ID="Close Gripper" />
</Decorator>
<!--Move to place (drop) location-->
<Decorator ID="RetryUntilSuccessful" num_attempts="3">
<SubTree ID="Move to Waypoint" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" joint_group_name="manipulator" planner_interface="moveit_default" constraints="{constraints}" _collapsed="true" waypoint_name="{pre_pick}"/>
<SubTree
ID="Move to Waypoint"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
joint_group_name="manipulator"
planner_interface="moveit_default"
constraints="{constraints}"
_collapsed="true"
waypoint_name="{pre_pick}"
/>
</Decorator>
<Decorator ID="RetryUntilSuccessful" num_attempts="3">
<SubTree ID="Move to Waypoint" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" joint_group_name="manipulator" planner_interface="moveit_default" constraints="{constraints}" _collapsed="true" waypoint_name="{pre_place}"/>
<SubTree
ID="Move to Waypoint"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
joint_group_name="manipulator"
planner_interface="moveit_default"
constraints="{constraints}"
_collapsed="true"
waypoint_name="{pre_place}"
/>
</Decorator>
<Decorator ID="RetryUntilSuccessful" num_attempts="3">
<SubTree ID="Move to Waypoint" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" joint_group_name="manipulator" planner_interface="moveit_default" constraints="{constraints}" _collapsed="true" waypoint_name="{place}"/>
<SubTree
ID="Move to Waypoint"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
joint_group_name="manipulator"
planner_interface="moveit_default"
constraints="{constraints}"
_collapsed="true"
waypoint_name="{place}"
/>
</Decorator>
<SubTree ID="Open Gripper"/>
<SubTree ID="Open Gripper" />
<Decorator ID="RetryUntilSuccessful" num_attempts="3">
<SubTree ID="Move to Waypoint" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" joint_group_name="manipulator" planner_interface="moveit_default" constraints="{constraints}" _collapsed="true" waypoint_name="{pre_place}"/>
<SubTree
ID="Move to Waypoint"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
joint_group_name="manipulator"
planner_interface="moveit_default"
constraints="{constraints}"
_collapsed="true"
waypoint_name="{pre_place}"
/>
</Decorator>
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="Constrained Pick and Place Subtree">
<inout_port name="pre_pick" default=""/>
<inout_port name="pick" default=""/>
<inout_port name="pre_place" default=""/>
<inout_port name="place" default=""/>
<inout_port name="pre_pick" default="" />
<inout_port name="pick" default="" />
<inout_port name="pre_place" default="" />
<inout_port name="place" default="" />
</SubTree>
</TreeNodesModel>
</root>
</root>
4 changes: 2 additions & 2 deletions src/lab_sim/objectives/constrained_pick_place.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Move Beakers to Burners">
<!--//////////-->
<BehaviorTree
Expand All @@ -12,7 +12,7 @@
ID="Move to Waypoint"
_collapsed="true"
constraints="{constraints}"
waypoint_name="Look at Table"
waypoint_name="Beaker 1a - Pre Pick"
joint_group_name="manipulator"
planner_interface="moveit_default"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
Expand Down
4 changes: 2 additions & 2 deletions src/lab_sim/objectives/my_constraints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ AppendOrientationConstraint:
constraint_frame: "world"
link_frame: "grasp_link"
orientation: # radians
x: -3.14
x: 1.57
y: 0.0
z: -1.57
z: 3.14
tolerance: # radians
x: 0.2
y: 0.2
Expand Down
Loading

0 comments on commit 973f81f

Please sign in to comment.