0
$\begingroup$

I am trying to control a closed kinematic chain in Gazebo 11 using ros2_control and gazebo_ros2_control. I know, that closed kinematic chains are not supported by URDF, therefore I've closed the loop via SDF injection. The models get loaded properly, so I wanted to control them using:

complete_robot.urdf.xacro

<gazebo>
  <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
    <parameters>$(arg ur_simulation_controllers)</parameters>
  </plugin>
</gazebo>

onrobot_ros2_control.urdf.xacro

...
<ros2_control name="${gripper_name} type="system">
  <hardware>
    <xacro:if value="${sim_gazebo}">
      <plugin>gazebo_ros2_control/GazeboSystem</plugin>
    </xacro:if>
    ...
  </hardware>
  <!-- Joints -->
  ...
</ros2_control>
...

I tried to use a JointTrajectoryController for the control of the closed loop, but even before I send messages to the controller topic my gazebo server reports repeating warnings inside its log (.gazebo/server-11345/default.log):

[Wrn][Joint.cc:821] failed to find a clean set of connected links, i.e. this joint is inside a loop, cannot SetPosition kinematically.
[Dbg][Link.cc] we have a loop! cannot find nice subset of connected links, this link RG6_left_inner_knuckle connects back to parent wrist_3_link.

I think I'm not the only person using closed kinematic chains, since they are somewhat common in robotics (delta robots, grippers, etc). I also have found a video where someone is controlling such a kinematic loop, but in ROS1 according to the linked repository. Could someone point me in the right direction on how to achieve the controlled closed loop?

$\endgroup$

1 Answer 1

0
$\begingroup$

Yes it is possible, I also use it. First recommendation: Update to a ROS distribution which is not EOL already.

Which interface are you using? (position, velocity,...) How many joints do you want to control? You only can control a single joint of the closed-loop kinematics, the position of the others will be solved by gazebo.

$\endgroup$
3
  • $\begingroup$ Sorry, it took me a while to come back to the question. I'm updating to Humble. For the closed-loop, I want to control the position of one of the joints (it is a OnRobot Gripper). What is your approach Christoph? $\endgroup$
    – NotARobot
    Feb 1 at 8:43
  • $\begingroup$ Model your kinematic chain as described here, add a single command interface according to your hardware (where your real actuator is located), and add optionally state interfaces to all joints of the kinematic loop if you wish. $\endgroup$ Feb 2 at 16:30
  • $\begingroup$ Then use the single command interface in any ros2_controller (position_controller, joint_trajectory_controller, gripper_controller, ...) $\endgroup$ Feb 2 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.