This repository has been archived by the owner on Dec 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add request teleoperation for mock hw config (#235)
- Loading branch information
1 parent
6fcbef1
commit 0e73275
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/picknik_ur_site_config/objectives/request_teleoperation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<root BTCPP_format="4" main_tree_to_execute="Request Teleoperation"> | ||
<!-- The integer value used here for teleoperation mode comes from the moveit_studio_sdk_msgs/TeleoperationMode ROS message. --> | ||
<BehaviorTree ID="Request Teleoperation" _description="Handles the different variations of teleoperation from the web UI, with the option of interactive user prompts and choosing the initial mode. Should be used as a subtree with port remapping as part of an another Objective." _favorite="false" _hardcoded="false"> | ||
<Control ID="Sequence"> | ||
<Action ID="Script" code="teleop_mode := 0"/> | ||
<Control ID="Parallel" success_count="1" failure_count="1"> | ||
<Action ID="DoTeleoperateAction" enable_user_interaction="{enable_user_interaction}" user_interaction_prompt="{user_interaction_prompt}" initial_teleop_mode="{initial_teleop_mode}" current_teleop_mode="{teleop_mode}"/> | ||
<Decorator ID="KeepRunningUntilFailure"> | ||
<Control ID="Sequence"> | ||
<!-- Closing and opening the gripper --> | ||
<Decorator ID="ForceSuccess" _skipIf="teleop_mode != 7"> | ||
<SubTree ID="Close Gripper"/> | ||
</Decorator> | ||
<Decorator ID="ForceSuccess" _skipIf="teleop_mode != 6"> | ||
<SubTree ID="Open Gripper"/> | ||
</Decorator> | ||
<!-- Joint sliders interpolate to joint state --> | ||
<Decorator ID="ForceSuccess" _while="teleop_mode == 5"> | ||
<Control ID="Sequence"> | ||
<Action ID="SwitchUIPrimaryView" primary_view_name="Visualization"/> | ||
<SubTree ID="Interpolate to Joint State"/> | ||
</Control> | ||
</Decorator> | ||
<!-- Interactive markers move to pose --> | ||
<Decorator ID="ForceSuccess" _while="teleop_mode == 4"> | ||
<Control ID="Sequence"> | ||
<Action ID="SwitchUIPrimaryView" primary_view_name="Visualization"/> | ||
<SubTree ID="Move to Pose"/> | ||
</Control> | ||
</Decorator> | ||
<!-- Waypoint buttons move to joint state --> | ||
<Decorator ID="ForceSuccess" _while="teleop_mode == 3"> | ||
<Control ID="Sequence"> | ||
<Action ID="SwitchUIPrimaryView" primary_view_name="Visualization"/> | ||
<SubTree ID="Move to Joint State"/> | ||
</Control> | ||
</Decorator> | ||
<!-- Cartesian and joint jogging --> | ||
<Control ID="Sequence" _while="teleop_mode == 2"> | ||
<Action ID="SwitchUIPrimaryView" primary_view_name="/wrist_mounted_camera/color/image_raw"/> | ||
<Action ID="TeleoperateTwist" controller_name="servo_controller"/> | ||
</Control> | ||
<Control ID="Sequence" _while="teleop_mode == 1"> | ||
<Action ID="SwitchUIPrimaryView" primary_view_name="Visualization"/> | ||
<Action ID="TeleoperateJointJog" controller_name="servo_controller"/> | ||
</Control> | ||
</Control> | ||
</Decorator> | ||
</Control> | ||
</Control> | ||
</BehaviorTree> | ||
</root> |