Rosanswers logo

I am using th example from this link: http://wiki.ros.org/navigation/Tutorials/RobotSetup/Odom, for publishing my odo data from the robot, though I have made some small changes like:

  1. Added a callback, so as to subscribe to the incoming data from the robot.
  2. Changed the velocities to suit for differential drive robot.
  3. Small change in calculation of the robot position based on odo.

When I run the node with the launch file as below:

        <param name="robot_description" command="cat $(find my_robot_urdf)/my_robot.urdf" />
        <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
        <node name="my_state_publisher_temp" pkg="security_robot_urdf" type="my_state_publisher_temp" />

then open the rviz, select /odom as fixed frame in global options and add a robot model, I can see that robot moves in simulation exactly how the real robot moves in the world.

But when I run the same node using "rosrun" as rosrun folder my_state_publisher_temp, then open the rviz, select /odom as fixed frame in global options and add a robot model, I can see only the base_link moving according to the real robot in the world, But other links (I have wheels, scanner etc.) remains rigid at the initial position.

any insights why this happens..?

Many thanks in advance.

Originally posted by sumanth on ROS Answers with karma: 86 on 2014-08-13

Post score: 0


1 Answer 1


Rosanswers logo

In addition to running your nodes, the launch file you posted also sets the /robot_description parameter and runs the robot_state_publisher node.

Are you setting the /robot_description parameter and running robot_state_publisher when you run your node by hand?


You can set the /robot_description parameter with:

rosparam set /robot_description -t my_robot.urdf

And you can run the robot_state_publisher node with rosrun:

rosrun robot_state_publisher robot_state_publisher

(Note how both of these commands resemble the contents of your launch file)

Originally posted by ahendrix with karma: 47576 on 2014-08-13

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by sumanth on 2014-08-13:
No I guess, How can I do this..?

Comment by sumanth on 2014-08-13:
Super now it's working. and I got know how to set the parameters. Many many thanks.


Your Answer

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