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

Changing Joint from Fixed to Revolute Breaks TF

asked 2020-04-06 02:18:41 -0600

Hein Wessels gravatar image

Hello guys,

I'm fairly new to ROS and still learning. I've been struggling with this problem for a while, and I can't seem to solve it. I've dug through countless ROS Answers, but can't seem to find the solution.

I'm running through the URDF Tutorial and finished it. This is as in, if I run the last 13-diffdrive.launch all starts up correctly. To prove to myself that I know how it works, I attempted to make R2D2's legs also rotate at his shoulders, by changing the joint from fixed to revolute, which also requires a few additional changes as well.


So first what I did was change the following in the *.urdf.xacro file:

<joint name="base_to_${prefix}_leg" type="fixed">
      <parent link="base_link"/>
      <child link="${prefix}_leg"/>
      <origin xyz="0 ${reflect*(width+.02)} 0.25" />
</joint>

to

<joint name="base_to_${prefix}_leg" type="revolute">
      <parent link="base_link"/>
      <child link="${prefix}_leg"/>
      <origin xyz="0 ${reflect*(width+.02)} 0.25" />
      <axis xyz="0 1 0"/>      
      <limit effort="1000.0" lower="0.0" upper="0.548" velocity="0.5"/>
      <dynamics damping="0.0" friction="0.0"/>
</joint>

by copying code from the _gripper_joint. When running the launch file again it opens RViz and Gazebo with a little wheel controlling interface. In Gazebo everything displays correctly, and I can see the new joint swiwels when I drive R2D2 around. But, in RViz the legs are displayed at the origin and not at the shoulders. This because the TF Transform isn't published. I double checked this using the command rostopic echo /joint_states -n 1, which didn't display the new shoulder joint.


According to the tutorial to get the joint state published you need to add a transmission. So added the transmission like below, again copying from the _gripper_joint.

<joint name="base_to_${prefix}_leg" type="revolute">
      <parent link="base_link"/>
      <child link="${prefix}_leg"/>
      <origin xyz="0 ${reflect*(width+.02)} 0.25" />
      <axis xyz="0 1 0"/>      
      <limit effort="1000.0" lower="0.0" upper="0.548" velocity="0.5"/>
      <dynamics damping="0.0" friction="0.0"/>
</joint>
<transmission name="$base_to_${prefix}_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <actuator name="$base_to_${prefix}_motor">
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
      <joint name="$base_to_${prefix}_leg">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
      </joint>
</transmission>

This breaks a few things, and I don't understand where I'm going wrong. The symptoms that I see are the following:

  • Gazebo still seems to display the bot correctly, but gripper retracts into the body with no command given. This makes me think that some joints are getting confused.
  • In Gazebo I've lost control of the wheel, which is also why I think some joints are getting confused.
  • In RViz only half of the bot is loaded.
  • Nothing is being published in the /joint_states topic.
  • In the terminal I get the ...
(more)
edit retag flag offensive close merge delete

Comments

It would help (others) if you could show the complete urdf. It's a bit hard to figure out what the states of things is without it.

Also:

According to the tutorial to get the joint state published you need to add a transmission.

this is (most likely) only true if/when using Gazebo, as the standard joint_state_publisher won't care about transmissions at all.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-06 09:15:52 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-04-06 11:00:07 -0600

Try to change:

<transmission name="$base_to_${prefix}_trans">
<joint name="$base_to_${prefix}_leg">

To: ( Removing the $ ahead of the name )

<transmission name="base_to_${prefix}_trans">
<joint name="base_to_${prefix}_leg">

If the problem remains. Comment here.

edit flag offensive delete link more

Comments

That did the trick! I can't believe the issue was a simple copy-paste mistake. Thanks!

Hein Wessels gravatar image Hein Wessels  ( 2020-04-06 11:54:59 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-04-06 02:18:41 -0600

Seen: 856 times

Last updated: Apr 06 '20