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:
- Added a callback, so as to subscribe to the incoming data from the robot.
- Changed the velocities to suit for differential drive robot.
- Small change in calculation of the robot position based on odo.
When I run the node with the launch file as below:
<launch> <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" /> </launch>
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.
Post score: 0