Skip to content

Commit

Permalink
Merge pull request #5 from PickNikRobotics/pre-commit-formatting
Browse files Browse the repository at this point in the history
Pre commit formatting
  • Loading branch information
MikeWrock authored Nov 12, 2024
2 parents 454dcac + 217a42e commit 4a7aa99
Show file tree
Hide file tree
Showing 91 changed files with 5,130 additions and 1,530 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit
exclude: ^src/external_dependencies/
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ git submodule update --recursive --init
## Working with Git Subtrees

This repository was created through the combination of multiple repositories using git subtree.
If you have no intrest in manually pulling or pushing upstream changes, you can ignore the following section and treat this repository as a single repository.
If you have no interest in manually pulling or pushing upstream changes, you can ignore the following section and treat this repository as a single repository.

### Repository Structure

Expand Down
2 changes: 1 addition & 1 deletion src/example_behaviors/src/ndt_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BT::PortsList NDTRegistration::providedPorts()
}
BT::KeyValueVector NDTRegistration::metadata()
{
return { {"description", "Finds the pose of a target point cloud relative to the base frame of a base point cloud using the Normal Distributions Transform (NDT) algorithm"} };
return { {"subcategory", "Perception - 3D Point Cloud"}, {"description", "Finds the pose of a target point cloud relative to the base frame of a base point cloud using the Normal Distributions Transform (NDT) algorithm"} };
}


Expand Down
2 changes: 1 addition & 1 deletion src/example_behaviors/src/ransac_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BT::PortsList RANSACRegistration::providedPorts()

BT::KeyValueVector RANSACRegistration::metadata()
{
return { {"description", "Finds the pose of a target point cloud relative to the base frame of a base point cloud using the Normal Distributions Transform (NDT) algorithm"} };
return { {"subcategory", "Perception - 3D Point Cloud"}, {"description", "Finds the pose of a target point cloud relative to the base frame of a base point cloud using the Normal Distributions Transform (NDT) algorithm"} };
}


Expand Down
70 changes: 51 additions & 19 deletions src/fanuc_sim/objectives/move_to_waypoint.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
<root BTCPP_format="4" main_tree_to_execute="Move to Waypoint">
<BehaviorTree ID="Move to Waypoint" _description="This Objective is used when moving to one of the saved waypoints in your site configuration" _subtreeOnly="true">
<Control ID="Sequence" name="root">
<Action ID="RetrieveWaypoint" waypoint_joint_state="{target_joint_state}" waypoint_name="{waypoint_name}" joint_group_name="{joint_group_name}"/>
<Action ID="InitializeMTCTask" task_id="move_to_named_pose" controller_names="{controller_names}" task="{move_to_waypoint_task}"/>
<Action ID="SetupMTCCurrentState" task="{move_to_waypoint_task}"/>
<Action ID="SetupMTCMoveToJointState" joint_state="{target_joint_state}" name="SetupMTCMoveToJointState" planning_group_name="{joint_group_name}" planner_interface="{planner_interface}" constraints="{constraints}" task="{move_to_waypoint_task}"/>
<Action ID="PlanMTCTask" solution="{move_to_waypoint_solution}" task="{move_to_waypoint_task}"/>
<Action ID="BlockingExecuteMTCTask" solution="{move_to_waypoint_solution}"/>
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="Move to Waypoint">
<input_port name="waypoint_name" default="Point A"/>
<input_port name="joint_group_name" default="manipulator"/>
<input_port name="planner_interface" default="moveit_default"/>
<input_port name="controller_names" default="/joint_trajectory_controller"/>
</SubTree>
</TreeNodesModel>
</root>
<BehaviorTree
ID="Move to Waypoint"
_description="This Objective is used when moving to one of the saved waypoints in your site configuration"
_subtreeOnly="true"
>
<Control ID="Sequence" name="root">
<Action
ID="RetrieveWaypoint"
waypoint_joint_state="{target_joint_state}"
waypoint_name="{waypoint_name}"
joint_group_name="{joint_group_name}"
/>
<Action
ID="InitializeMTCTask"
task_id="move_to_named_pose"
controller_names="{controller_names}"
task="{move_to_waypoint_task}"
/>
<Action ID="SetupMTCCurrentState" task="{move_to_waypoint_task}" />
<Action
ID="SetupMTCMoveToJointState"
joint_state="{target_joint_state}"
name="SetupMTCMoveToJointState"
planning_group_name="{joint_group_name}"
planner_interface="{planner_interface}"
constraints="{constraints}"
task="{move_to_waypoint_task}"
/>
<Action
ID="PlanMTCTask"
solution="{move_to_waypoint_solution}"
task="{move_to_waypoint_task}"
/>
<Action
ID="BlockingExecuteMTCTask"
solution="{move_to_waypoint_solution}"
/>
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="Move to Waypoint">
<input_port name="waypoint_name" default="Point A" />
<input_port name="joint_group_name" default="manipulator" />
<input_port name="planner_interface" default="moveit_default" />
<input_port
name="controller_names"
default="/joint_trajectory_controller"
/>
</SubTree>
</TreeNodesModel>
</root>
20 changes: 15 additions & 5 deletions src/fanuc_sim/objectives/teleoperate.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<root BTCPP_format="4" main_tree_to_execute="Teleoperate">
<!--//////////-->
<BehaviorTree ID="Teleoperate" _description="Handles the different variations of teleoperation from the web UI. Can be used standalone." _favorite="false" _hardcoded="false">
<SubTree ID="Request Teleoperation" enable_user_interaction="false" user_interaction_prompt="" initial_teleop_mode="3"/>
</BehaviorTree>
</root>
<!--//////////-->
<BehaviorTree
ID="Teleoperate"
_description="Handles the different variations of teleoperation from the web UI. Can be used standalone."
_favorite="false"
_hardcoded="false"
>
<SubTree
ID="Request Teleoperation"
enable_user_interaction="false"
user_interaction_prompt=""
initial_teleop_mode="3"
/>
</BehaviorTree>
</root>
2 changes: 1 addition & 1 deletion src/fanuc_sim/waypoints/waypoints.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[]
[]
123 changes: 122 additions & 1 deletion src/lab_sim/objectives/3_waypoint_pick_and_place.xml
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
<root BTCPP_format="4" main_tree_to_execute="3 Waypoints Pick and Place"><!--//////////--><BehaviorTree ID="3 Waypoints Pick and Place" _description="Basic example of repeatedly grabbing a small (invisible) object, placing it at desired destination, and then moving back to a home position" _favorite="false"><Control ID="Sequence"><!--Reset the planning scene to ensure no old collision objects are hanging around--><Action ID="ClearSnapshot"/><!--Setup the environment to its "home" configuration - move to center and open gripper--><SubTree ID="Move to Waypoint" waypoint_name="Look at Table" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/><Action ID="MoveGripperAction" gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd" position="0"/><!--Run pick and place on loop--><Decorator ID="KeepRunningUntilFailure"><Control ID="Sequence"><!--Pick object from original location, put it down at a different part of the table, and go back to center pose--><Control ID="Sequence"><SubTree ID="Move to Waypoint" waypoint_name="Pick Cube" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/><Action ID="MoveGripperAction" gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd" position="0.7929"/><SubTree ID="Move to Waypoint" waypoint_name="Look at Table" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/><SubTree ID="Move to Waypoint" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}" waypoint_name="Place Cube"/><Action ID="MoveGripperAction" gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd" position="0"/><SubTree ID="Move to Waypoint" waypoint_name="Look at Table" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/></Control><!--Pick object from where it was placed, put it down on the original location, and go back to center pose--><Control ID="Sequence"><SubTree ID="Move to Waypoint" waypoint_name="Place Cube" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/><Action ID="MoveGripperAction" gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd" position="0.7929"/><SubTree ID="Move to Waypoint" waypoint_name="Look at Table" 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 Cube" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/><Action ID="MoveGripperAction" gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd" position="0"/><SubTree ID="Move to Waypoint" waypoint_name="Look at Table" joint_group_name="manipulator" controller_names="/joint_trajectory_controller /robotiq_gripper_controller" planner_interface="moveit_default" constraints="{constraints}"/></Control></Control></Decorator></Control></BehaviorTree></root>
<root BTCPP_format="4" main_tree_to_execute="3 Waypoints Pick and Place">
<!--//////////-->
<BehaviorTree
ID="3 Waypoints Pick and Place"
_description="Basic example of repeatedly grabbing a small (invisible) object, placing it at desired destination, and then moving back to a home position"
_favorite="false"
>
<Control ID="Sequence">
<!--Reset the planning scene to ensure no old collision objects are hanging around-->
<Action ID="ClearSnapshot" />
<!--Setup the environment to its "home" configuration - move to center and open gripper-->
<SubTree
ID="Move to Waypoint"
waypoint_name="Look at Table"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
<Action
ID="MoveGripperAction"
gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd"
position="0"
/>
<!--Run pick and place on loop-->
<Decorator ID="KeepRunningUntilFailure">
<Control ID="Sequence">
<!--Pick object from original location, put it down at a different part of the table, and go back to center pose-->
<Control ID="Sequence">
<SubTree
ID="Move to Waypoint"
waypoint_name="Pick Cube"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
<Action
ID="MoveGripperAction"
gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd"
position="0.7929"
/>
<SubTree
ID="Move to Waypoint"
waypoint_name="Look at Table"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
<SubTree
ID="Move to Waypoint"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
waypoint_name="Place Cube"
/>
<Action
ID="MoveGripperAction"
gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd"
position="0"
/>
<SubTree
ID="Move to Waypoint"
waypoint_name="Look at Table"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
</Control>
<!--Pick object from where it was placed, put it down on the original location, and go back to center pose-->
<Control ID="Sequence">
<SubTree
ID="Move to Waypoint"
waypoint_name="Place Cube"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
<Action
ID="MoveGripperAction"
gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd"
position="0.7929"
/>
<SubTree
ID="Move to Waypoint"
waypoint_name="Look at Table"
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 Cube"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
<Action
ID="MoveGripperAction"
gripper_command_action_name="/robotiq_gripper_controller/gripper_cmd"
position="0"
/>
<SubTree
ID="Move to Waypoint"
waypoint_name="Look at Table"
joint_group_name="manipulator"
controller_names="/joint_trajectory_controller /robotiq_gripper_controller"
planner_interface="moveit_default"
constraints="{constraints}"
/>
</Control>
</Control>
</Decorator>
</Control>
</BehaviorTree>
</root>
32 changes: 24 additions & 8 deletions src/lab_sim/objectives/add_waypoints_to_mtc_task.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<root BTCPP_format="4" main_tree_to_execute="Add Waypoints to MTC Task">
<!--//////////-->
<BehaviorTree ID="Add Waypoints to MTC Task">
<Control ID="Sequence">
<Decorator ID="ForEachString" vector_in="{waypoint_names}" out="{waypoint_name}">
<Decorator
ID="ForEachString"
vector_in="{waypoint_names}"
out="{waypoint_name}"
>
<Control ID="Sequence">
<Action ID="RetrieveWaypoint" waypoint_joint_state="{target_joint_state}" waypoint_name="{waypoint_name}" joint_group_name="{joint_group_name}"/>
<Action ID="SetupMTCMoveToJointState" joint_state="{target_joint_state}" name="SetupMTCMoveToJointState" planning_group_name="{joint_group_name}" planner_interface="{planner_interface}" task="{mtc_task}"/>
<Action
ID="RetrieveWaypoint"
waypoint_joint_state="{target_joint_state}"
waypoint_name="{waypoint_name}"
joint_group_name="{joint_group_name}"
/>
<Action
ID="SetupMTCMoveToJointState"
joint_state="{target_joint_state}"
name="SetupMTCMoveToJointState"
planning_group_name="{joint_group_name}"
planner_interface="{planner_interface}"
task="{mtc_task}"
/>
</Control>
</Decorator>
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="Add Waypoints to MTC Task">
<input_port name="joint_group_name" default="manipulator"/>
<input_port name="waypoint_names" default="Pick Cube;Place Cube"/>
<inout_port name="mtc_task" default="{mtc_task}"/>
<input_port name="planner_interface" default="moveit_default"/>
<input_port name="joint_group_name" default="manipulator" />
<input_port name="waypoint_names" default="Pick Cube;Place Cube" />
<inout_port name="mtc_task" default="{mtc_task}" />
<input_port name="planner_interface" default="moveit_default" />
</SubTree>
</TreeNodesModel>
</root>
Loading

0 comments on commit 4a7aa99

Please sign in to comment.