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

How to visualise under-actuated joints in rviz?

asked 2021-01-15 07:37:55 -0500

hanks gravatar image

updated 2022-07-24 11:05:00 -0500

lucasw gravatar image

I am working on a project where I have attached a custom-designed four-wheel cart on the rear axle of the Clearpath Robotics Ridgeback robot. I have two problems -

  1. The cart is attached with an underactuated continuous joint of which the value/position can be changed using the joint_state_publisher, but when the robot-trailer system is moved, the change in the orientation as in Gazebo is not reflected/visualized in rviz. The same problem exists with the wheels of the cart which are also underactuated. How do I get them visualized as their state changes in Gazebo?

  2. The cart keeps drifting about its hitch axis on its own when the robot is moved. I tried adding weight/payload on the cart but it didn't make a difference. I did set the coefficients of friction to zero as the robot model also had them set to zero. I'm not able to figure out the appropriate setup which can solve this problem.

Here are some pictures of the system I am using - https://drive.google.com/file/d/1xkEU... https://drive.google.com/file/d/1Xz2B... https://drive.google.com/file/d/1Tjo3...

image description image description image description

Please help me solve these problems. Thank You.

edit retag flag offensive close merge delete

Comments

1

Please do not link to images on Google drive. They tend to disappear. Please attach your images directly to the post. You have sufficient karma to do that.

gvdhoorn gravatar image gvdhoorn  ( 2021-01-15 09:54:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-01-15 08:41:38 -0500

tryan gravatar image

updated 2021-01-19 10:08:33 -0500

  1. Actuated or not, RViz reflects the current transform tree. If it's visualizing the robot but doesn't show updated poses, it's because RViz doesn't know about them. Do you have a robot_state_publisher node running? Here's an example from the tutorial:

    <launch>
      <!-- Load the urdf into the parameter server. -->  
      <param name="my_robot_description" textfile="$(find mypackage)/urdf/robotmodel.xml"/>
    
      <node pkg="robot_state_publisher" type="robot_state_publisher" name="rob_st_pub" >
        <remap from="robot_description" to="my_robot_description" />
        <remap from="joint_states" to="different_joint_states" />
      </node>
    </launch>
    
  2. If there's no friction, damping, or actuator, there's nothing to stop the joint once it starts moving, so what you describe sounds like expected behavior. If the behavior doesn't make sense--even for a fricitonless world-- then some of the other physical parameters may be off, but we'll need more information to track down the problem. The URDF joint wiki provides information on how to add damping or friction to a joint:

    <joint name="my_joint" type="floating">
      <origin xyz="0 0 1" rpy="0 0 3.1416"/>
      <parent link="link1"/>
      <child link="link2"/>
    
      <calibration rising="0.0"/>
      <dynamics damping="0.7" friction="0.0"/>  # Make one of these non-zero
      <limit effort="30" velocity="1.0" lower="-2.2" upper="0.7" />
      <safety_controller k_velocity="10" k_position="15" soft_lower_limit="-2.0" soft_upper_limit="0.5" />
    </joint>
    

If you want to see the casters move properly, you'll need surface friction between them and the ground. The Gazebo friction tutorial provides an example and some helpful links. You may also consider just modeling them as frictionless spheres, depending on your application.


Update 1

You can add actuators without using them, so the joint remains free to move. Since you're using a JointStateController, just add a transmission to each movable joint in ridgeback.urdf.xacro. Here's an example for cargo_cart_joint:

...

<joint name="cargo_cart_joint" type="revolute">
  <origin xyz="0 0 0.025" rpy="0 0 0" />
  <parent link="tow_hitch_link"/>
  <child link="cargo_cart_link" />
  <axis xyz="0 0 1" />
  <limit lower="-${PI/2}" upper="${PI/2}" velocity="0" effort="0"/>
  <dynamics damping="${damping_coef}" friction="${friction_coef}" />
</joint>

<transmission name="cargo_cart_trans">
  <type>transmission_interface/SimpleTransmission</type>
  <joint name="cargo_cart_joint">
    <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
  </joint>
  <actuator name="cargo_cart_joint_actuator">
    <mechanicalReduction>1</mechanicalReduction>
  </actuator>
</transmission>

...

Then, ridgeback_joint_publisher will publish the states of those joints. It only finds joints "registered to a hardware_interface::JointStateInterface" as mentioned in the ros_control wiki. You'll also have to get rid of joint_state_publisher_gui in empty_world.launch as that will collide and cause the published joint state to flip back and forth.


Update 2

I agree that revolute joints seem to behave as expected, though I don't know why the continuous joints don't. In any case, I recommend adding some trailing distance to the casters to encourage "following" behavior, and adding damping/friction to address the drift/skid issue. I changed your URDF file as ... (more)

edit flag offensive delete link more

Comments

Thank you for your reply. Here is the state of the problems according to your suggestions -

  1. I actually do have a robot_state_publisher node running, but the joint_state_publisher that is attached to it is not publishing the joints that I have added. Is it because I haven't attached any transmission or actuator plugin to them? Because I want them underactuated. I couldn't figure out how to add them to the control.yaml file where the joint_state_publisher is defined.

  2. I tried adding friction and damping (various values) to the wheels but they either stop swiveling or keep swiveling. In either case, the cart still drifts. Is there any specific information I can provide to help track down the problems? And about the wheel design, I am actually trying to model a cart/trolley and for that reason, I designed the swivel wheels instead of spheres for castors. I want to ...

(more)
hanks gravatar image hanks  ( 2021-01-15 23:49:56 -0500 )edit

Please post your URDF and launch files, and I'll take a closer look at your issues.

tryan gravatar image tryan  ( 2021-01-16 15:15:41 -0500 )edit

Sure, I have made a drive folder since I won't be able to add all the files here. I have added the necessary files and here is how they are executed/called -

The empty_world.launch file calls the other respective files in the following order -

empty_world.launch -> joint_state_publiesher_gui; empty_world.launch (gazebo_ros); spawn_ridgeback.launch(ridgeback_gazebo) -> description.launch(ridgeback_description); control.launch -> ridgeback.urdf.xacro; robot_state_publisher

Here are the files - https://drive.google.com/drive/folder...

Please let me know if you need any other files or details. I really have to solve this problem to move further in my project. Thank you for your help.

hanks gravatar image hanks  ( 2021-01-17 01:26:06 -0500 )edit

Let's make sure we handle "Issue 1" first. You are correct that the behavior is related to not having attached transmissions; however, you also have two joint state publishers: one from ros_control and one from joint_state_publisher_gui. Your cart wheels don't appear to move because the second (GUI) is publishing zeros by default. See Update 1 in my answer for further details, and let me know if that doesn't solve the issue.

tryan gravatar image tryan  ( 2021-01-17 17:35:25 -0500 )edit

I added the transmissions to the joints and removed the joint_state_publisher_gui node as you suggested, and it partly worked. The cargo_cart_joint works as I wanted and also reflects the joint position in rviz. But the holder joints (for swivel) and cart-wheel joints don't rotate at all (they remain stuck in the default position). The cart drift problem still persists.

I updated the empty_world.launch and ridgeback.urdf.xacro files and also added some recordings for you here - https://drive.google.com/drive/folder...

Please take a look and let me know what can be done. Thanks a lot for the help.

UPDATE - I changed the holder joints and cart-wheel joints to revolute joints with -pi to pi limits from continuous joints and now they work like the cargo_cart_joint. Cart drift/skid problem still persists. Have added another video labeled revolute joints for you to the same folder.

hanks gravatar image hanks  ( 2021-01-17 23:16:37 -0500 )edit

Friction/damping should take care of the drifting, and I would add some trailing distance to the casters. I'll add a modified URDF to my answer to show you what I mean.

The wheels should definitely be continuous; otherwise, the cart will only be able to roll a short distance before the wheels lock and start skidding. The continuous joints moved for me, though not as I expected, and the revolute joints definitely move more naturally. I'm not sure why that is and won't really have time to investigate for awhile. Since your initial question is answered, I suggest opening a new question specific to the caster wheel issue (unless you can find an answer already posted or are satisfied with the revolute joints).

tryan gravatar image tryan  ( 2021-01-19 10:08:57 -0500 )edit

Thank you for all your help. The friction and damping values have solved the drift problem. The new problem is, since the continuous joints of the cart-wheels don't rotate, the cart is not stable when the robot is moving. Currently trying to solve that but not able to figure out the reason the wheel joints won't rotate. They still do rotate when I change the joints to revolute, but as you said, revolute joints won't work for the wheels.

Anyway, thank you for the help, really appreciate it. If you do get time, please investigate why the continuous wheel joints won't rotate. Thank you.

hanks gravatar image hanks  ( 2021-01-20 23:28:53 -0500 )edit

Hey @tryan, I have started another question with some issues I'm facing. Here is the link - https://answers.ros.org/question/3708... Please take a look if possible, thanks.

hanks gravatar image hanks  ( 2021-02-03 08:06:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-01-15 07:37:55 -0500

Seen: 653 times

Last updated: Jul 24 '22