Skip to content

Commit

Permalink
Fix gripper mimic joint control (#8)
Browse files Browse the repository at this point in the history
* Fix gripper mimic joint control

* Add dummy joint to prevent Joint not found error

[move_group-3] [ERROR] [1692102600.709104192] [moveit_robot_model.robot_model]: Joint 'crane_x7_gripper_finger_b_joint_mimic' not found in model 'crane_x7'

See ros-controls/gazebo_ros2_control#173
  • Loading branch information
fabid authored Aug 24, 2023
1 parent 73cd53f commit e810a76
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
11 changes: 10 additions & 1 deletion urdf/crane_x7.gazebo_ros2_control.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
name_joint_6
name_joint_7
name_joint_gripper_finger_a
name_joint_gripper_finger_b
joint_1_lower_limit
joint_1_upper_limit
joint_2_lower_limit
Expand Down Expand Up @@ -113,7 +114,15 @@
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="${name_joint_gripper_finger_b}">
<param name="mimic">${name_joint_gripper_finger_a}</param>
<param name="multiplier">1</param>
<command_interface name="position"/>
<state_interface name="position"/>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>

</ros2_control>
</xacro:macro>
</robot>
</robot>
2 changes: 1 addition & 1 deletion urdf/crane_x7.ros2_control.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@

</ros2_control>
</xacro:macro>
</robot>
</robot>
1 change: 1 addition & 0 deletions urdf/crane_x7.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
name_joint_6="${NAME_JOINT_6}"
name_joint_7="${NAME_JOINT_7}"
name_joint_gripper_finger_a="${NAME_JOINT_GRIPPER_FINGER_A}"
name_joint_gripper_finger_b="${NAME_JOINT_GRIPPER_FINGER_B}"
joint_1_lower_limit="${JOINT_1_LOWER_LIMIT}"
joint_1_upper_limit="${JOINT_1_UPPER_LIMIT}"
joint_2_lower_limit="${JOINT_2_LOWER_LIMIT}"
Expand Down
9 changes: 9 additions & 0 deletions urdf/crane_x7_wide_two_finger_gripper.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@
</inertial>
</link>

<!--Dummy joint/link to prevent error with mimic joint
See https://github.com/ros-controls/gazebo_ros2_control/issues/173
-->
<joint name="${name_joint_gripper_finger_b}_mimic" type="fixed">
<parent link="world" />
<child link="dummy_mimic_fix" />
</joint>
<link name="dummy_mimic_fix"/>

<joint name="${name_joint_gripper_finger_b}" type="revolute">
<origin xyz="0.012 0.0 0.024" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
Expand Down

0 comments on commit e810a76

Please sign in to comment.