ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ros2_control joint limits

asked 2022-07-20 12:12:50 -0500

Cryoschrome gravatar image

OS: Ubuntu 22.04
Distro: Humble

Hi, I am trying to use MoveIt2! to control a custom robot. I have created a simple URDF files to test how to work with ros2_control. I have created a hardware interface component. When running the trajectory, it seems that the joint_limits that I have specified in the URDF file is not being enforced.


<?xml version="1.0"?>
<robot name="one_joint">
  <link name="base_link">
    <visual>
      <geometry>
        <cylinder length="0.6" radius="0.2"/>
      </geometry>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.6" radius="0.2"/>
      </geometry>
    </collision>
  </link>
  <link name="rotate_joint">
    <visual>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
      <origin rpy="1.57075 0 0" xyz="0.3 0 0"/>
    </visual>
    <collision>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
    </collision>
  </link>
  <joint name="base_to_rotate_joint" type="revolute">
    <!-- <safety_controller k_velocity="4" soft_lower_limit="-0.20" soft_upper_limit="0.20" /> -->
    <parent link="base_link"/>
    <child link="rotate_joint"/>
    <origin xyz="0 0 0.35"/>
    <axis xyz="0 0 1"/>
    <limit effort="87" lower="-6" upper="6" velocity="0.272645" />
  </joint>

  <ros2_control name="grab_joint1" type="actuator">
    <hardware>
      <plugin>grab_hardware_interface/GrabJointHardware</plugin>
    </hardware>
    <joint name="base_to_rotate_joint">
      <command_interface name="position">
        <param name="min">-6</param>
        <param name="max">6</param>
      </command_interface>
      <command_interface name="velocity">
        <param name="min">-0.27</param>
        <param name="max">0.27</param>
      </command_interface>
      <command_interface name="acceleration">
        <param name="min">-0.27</param>
        <param name="max">0.27</param>
      </command_interface>
      <state_interface name="position"/>
      <state_interface name="velocity"/>
    </joint>
  </ros2_control>
</robot>

Going through the ros2_control PRs I am completely confused on how to enforce the joint_limits. Can anyone shed some light on this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-07-20 12:40:38 -0500

AndyZe gravatar image

updated 2022-07-20 12:43:20 -0500

The ros2_control joint_trajectory_controller actually doesn't enforce joint limits at all right now :'| There's some work being done to fix that but it's not ready yet.

So, MoveIt is the module that's actually obeying joint limits when it creates a trajectory. MoveIt is not aware of these limit tags that you have put in the <ros2_control> block.

For MoveIt, you should specify the joint limits like this:

https://github.com/ros-planning/movei...

Or you can put the joint limits in joint_limits.yaml --> this will override whatever you have in the URDF.

edit flag offensive delete link more

Comments

Thank you for the reply. I got it working!

Cryoschrome gravatar image Cryoschrome  ( 2022-07-21 08:10:01 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-07-20 12:12:50 -0500

Seen: 657 times

Last updated: Jul 20 '22