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

Revision history [back]

click to hide/show revision 1
initial version

your problem is with ROS and Rviz, so the launch file to reproduce the problem could shortened quite a bit to make the problem more clear. ROS and robot state relevant launch file:

<launch> 

  <!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="/ack/joint_states" />
  </node>

  <!-- Start Joint state publisher node which will publish the joint values -->
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />


  <!-- Load the URDF into the ROS Parameter Server  -->

  <param name="robot_description" textfile="$(find ack_description)/urdf/ackermann_1.urdf" />

  <!-- Launch rviz -->
  <node name="rviz" pkg="rviz" type="rviz" 
    args="-d $(find ack_description)/urdf.rviz" required="true" />

</launch>

There are quite a few things I don't like about this launch file in general. But the transforms will be found if you remove the line <remap from="/joint_states" to="/ack/joint_states" />. You are launching controller_spawner in ack namespace, so I'm guessing you added that remap because of that node. If that is true, add the remap inside the controller_spawner node instead.


Other notes about the shortened launch file:

The robot_description is loaded after the state publishers, I guess it works, but it is not a logical order for the flow.

You have the required="true" argument for rviz node. In my experience this is usually a bad idea. Rviz will crash if you try to visualize anything substantial on it for some period of time and the required arg will take down all of the nodes you have launched. If your goal is to always have rviz open then use the respawn="true" argument instead.