From 279db93bf340787988db90e40ca576c79a5bb684 Mon Sep 17 00:00:00 2001 From: Mario Prats Date: Tue, 3 Dec 2024 14:32:10 +0100 Subject: [PATCH] Setup the fanuc_sim config with a tool-changing example --- src/fanuc_sim/config/config.yaml | 3 + .../control/picknik_fanuc.ros2_control.yaml | 23 +++++++ .../config/moveit/picknik_fanuc.srdf | 1 + .../fanuc_lrmate200id.ros2_control.xacro | 2 + src/fanuc_sim/description/picknik_fanuc.xacro | 55 ++++++++++++++- src/fanuc_sim/description/scene.xml | 53 +++++++++++++-- src/fanuc_sim/description/tool.urdf | 42 ++++++++++++ src/fanuc_sim/description/tool.xml | 44 ++++++++++++ src/fanuc_sim/objectives/activate_vacuum.xml | 19 ++++++ src/fanuc_sim/objectives/close_gripper.xml | 7 -- .../objectives/deactivate_vacuum.xml | 20 ++++++ src/fanuc_sim/objectives/open_gripper.xml | 8 --- .../objectives/pick_up_block_with_tool.xml | 48 +++++++++++++ src/fanuc_sim/objectives/pick_up_tool.xml | 68 +++++++++++++++++++ .../objectives/place_tool_in_tool_holder.xml | 50 ++++++++++++++ .../objectives/request_teleoperation.xml | 4 +- src/fanuc_sim/objectives/retract.xml | 33 +++++++++ .../objectives/setup_planning_scene.xml | 27 ++++++++ .../objectives/tool_attachment_example.xml | 20 ++++++ src/picknik_accessories | 2 +- 20 files changed, 503 insertions(+), 26 deletions(-) create mode 100644 src/fanuc_sim/description/tool.urdf create mode 100644 src/fanuc_sim/description/tool.xml create mode 100644 src/fanuc_sim/objectives/activate_vacuum.xml delete mode 100644 src/fanuc_sim/objectives/close_gripper.xml create mode 100644 src/fanuc_sim/objectives/deactivate_vacuum.xml delete mode 100644 src/fanuc_sim/objectives/open_gripper.xml create mode 100644 src/fanuc_sim/objectives/pick_up_block_with_tool.xml create mode 100644 src/fanuc_sim/objectives/pick_up_tool.xml create mode 100644 src/fanuc_sim/objectives/place_tool_in_tool_holder.xml create mode 100644 src/fanuc_sim/objectives/retract.xml create mode 100644 src/fanuc_sim/objectives/setup_planning_scene.xml create mode 100644 src/fanuc_sim/objectives/tool_attachment_example.xml diff --git a/src/fanuc_sim/config/config.yaml b/src/fanuc_sim/config/config.yaml index be3aff4..6b623c6 100644 --- a/src/fanuc_sim/config/config.yaml +++ b/src/fanuc_sim/config/config.yaml @@ -43,6 +43,7 @@ hardware: urdf_params: # Use "mock", "mujoco", or "real" - hardware_interface: "mujoco" + - mujoco_viewer: "false" # Sets ROS global params for launch. # [Optional] @@ -112,6 +113,8 @@ ros2_control: - "joint_trajectory_controller" - "servo_controller" - "joint_state_broadcaster" + - "tool_attach_controller" + - "suction_cup_controller" # - "servo_controller" # Load but do not start these controllers so they can be activated later if needed. # [Optional, default=[]] diff --git a/src/fanuc_sim/config/control/picknik_fanuc.ros2_control.yaml b/src/fanuc_sim/config/control/picknik_fanuc.ros2_control.yaml index 68aedf8..c8111bd 100644 --- a/src/fanuc_sim/config/control/picknik_fanuc.ros2_control.yaml +++ b/src/fanuc_sim/config/control/picknik_fanuc.ros2_control.yaml @@ -7,6 +7,29 @@ controller_manager: type: joint_trajectory_controller/JointTrajectoryController servo_controller: type: joint_trajectory_controller/JointTrajectoryController + # A controller to enable/disable the tool attachment interface at the robot flange. + # In sim, this is modeled as a weld constraint in Mujoco. + # In a real robot, this controller would activate a mechanism to attach/detach the tool at the robot flange. + tool_attach_controller: + type: position_controllers/GripperActionController + # A controller to enable/disable the suction cup. + # In sim, this is modeled as a weld constraint in Mujoco. + # In a real robot, this controller would activate / deactivate a suction cup mechanism. + suction_cup_controller: + type: position_controllers/GripperActionController + + +tool_attach_controller: + ros__parameters: + default: true + joint: suction_cup_tool_interface + allow_stalling: true + +suction_cup_controller: + ros__parameters: + default: true + joint: suction_cup_tool_tip + allow_stalling: true joint_state_broadcaster: ros__parameters: diff --git a/src/fanuc_sim/config/moveit/picknik_fanuc.srdf b/src/fanuc_sim/config/moveit/picknik_fanuc.srdf index 3fb1940..81eb162 100644 --- a/src/fanuc_sim/config/moveit/picknik_fanuc.srdf +++ b/src/fanuc_sim/config/moveit/picknik_fanuc.srdf @@ -19,6 +19,7 @@ + diff --git a/src/fanuc_sim/description/fanuc_lrmate200id.ros2_control.xacro b/src/fanuc_sim/description/fanuc_lrmate200id.ros2_control.xacro index e926a49..a0788da 100644 --- a/src/fanuc_sim/description/fanuc_lrmate200id.ros2_control.xacro +++ b/src/fanuc_sim/description/fanuc_lrmate200id.ros2_control.xacro @@ -5,6 +5,7 @@ params="name initial_positions_file hardware_interface mujoco_model" > + picknik_mujoco_ros/MujocoSystem $(arg mujoco_model) fanuc_sim + $(arg mujoco_viewer) 10 60 10 diff --git a/src/fanuc_sim/description/picknik_fanuc.xacro b/src/fanuc_sim/description/picknik_fanuc.xacro index 885c3fe..7e8a416 100644 --- a/src/fanuc_sim/description/picknik_fanuc.xacro +++ b/src/fanuc_sim/description/picknik_fanuc.xacro @@ -13,12 +13,61 @@ filename="$(find fanuc_sim)/description/fanuc_lrmate200id.ros2_control.xacro" /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + +