0
$\begingroup$

Rosanswers logo

I have a package named sp1s, I added a URDF, as simple as below:

    <?xml version="1.0"?>
<robot name="sp1s">
  <link name="base_link">
    <visual>
      <geometry>
        <box size="0.27 .15 .003"/>
      </geometry>
      <material name="white">
         <color rgba="1 1 1 .5"/>
    </material>
    </visual>
  </link>
  
  <link name="front_left">
    <visual>
      <geometry>
       <cylinder length=".025" radius="0.034"></cylinder>
      </geometry>
      <material name="yellow">
          <color rgba="1 1 0 1"/>
      </material>  
    </visual>
  </link>
  
  <joint name="base_to_front_left" type="continuous">
    <origin rpy="1.57075  0  0" xyz="0.06  0.064  -0.011"/>
    <parent link="base_link"/>
    <child link="front_left"/>    
    <axis xyz="0 0 1"/>
  </joint>
  
</robot>

Here is the launch file I edited:

<launch>
    <arg name="model" />
    <arg name="gui" default="False" />
    <param name="robot_description" textfile="$(arg model)" />
    <param name="use_gui" value="$(arg gui)"/>
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz"  args="-d  $(find sp1s)/urdf.rviz" required="true"/>
</launch>

When I launch it by "roslaunch sp1s display.launch model:=urdf/sp1s.urdf", the Rviz keep saying "No transform from [front_left] to [base_link]". I double checked my urdf content, I believe it caused by using joint type "continuous".

I strongly believe its a bug. When I follow the urdf_tutorial by 'roslaunch urdf_tutorial display.launch model:=urdf/06-flexible.urdf gui:=True', it was showing fine. But I changed the 06-flexible.urdf simply by add one space at the last empty line, launch it again it would say same thing on RViz

Why its happening, how to work around it?


Originally posted by Dragon Qu on ROS Answers with karma: 73 on 2015-01-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I got it! It took me a whole day to figure out why. joint_state_publisher failed to parse the urdf xml file. It dumped error message:

UnicodeEncodeError: 'ascii' codec can't encode character

I used XML copy editor to compile the file. It was wrong. I should use Text Editor to do it. joint_state_publisher doesn't support Unicode xml file. But check_urdf is fine with that.


Originally posted by Dragon Qu with karma: 73 on 2015-01-21

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by David Lu on 2015-01-21:
Glad you could figure it out. In the future, when something breaks like this, add the output="screen" attribute to nodes that might be giving you trouble so that you can see these error messages easier.

$\endgroup$

Your Answer

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