Ask Your Question

Need to better understand robot_state_publisher [closed]

asked 2013-08-23 03:17:56 -0500

rnunziata gravatar image

updated 2013-08-24 02:28:50 -0500

Update: I believe that this error form the robot_stat_publisher is because I have two different files for the model. One a urdf that for rviz and the other an sdf for gazebo. I think this is causing confusion for the publisher. I have been unsuccessful at getting a single urdf to run under both gazebo and rviz without errors.

I am publishing joint states for wheels to robot_state_publisher that does NOT translate them to tf. Rviz states that there is no transformation between map and wheel. What is robot_state_publisher doing that it thinks joint_states below are not correct? Am I publishing the joint states incorrectly? From looking at the robot_state_publisher.cpp I can not see how it uses the joint state message. It get a tree but I have two models for the same robot. One in sdf for gazebo and one in urdf for rviz. They are loaded under different robot description params.

How can I translate from jointStateMsg directly to TransformStamped message and bypass the robot_state_publisher?

Error:   TF_NAN_INPUT: Ignoring transform for child_frame_id "right_wheel" from authority "/robot_state_publisher" because of a nan value in the transform (-nan -nan -nan) (-nan -nan -nan -nan)

The code:

void jointStateCallback1(const control_msgs::JointControllerState msg)
     sensor_msgs::JointState jointStateMsg;;
     jointStateMsg.header.frame_id = "base_link";
     jointStateMsg.header.stamp = msg.header.stamp;[0] = "joint1";
     jointStateMsg.position[0] = msg.process_value;
     jointStateMsg.velocity[0] = msg.process_value_dot;

From rostopic echo /joint_states

  seq: 1805
    secs: 231
    nsecs: 908000000
  frame_id: base_link
name: ['joint1']
position: [-1.2626024562217015]
velocity: [0.015212120726772037]
effort: []
  seq: 1806
    secs: 231
    nsecs: 908000000
  frame_id: base_link
name: ['joint2']
position: [0.632293076018593]
velocity: [0.018082079331372874]
effort: []
edit retag flag offensive reopen merge delete

Closed for the following reason too localized by rnunziata
close date 2013-08-24 13:06:23

2 Answers

Sort by ยป oldest newest most voted

answered 2013-08-24 09:26:52 -0500

dornhege gravatar image

Your post doesn't really contain enough information to give concrete advise.

Converting from a JointState to tf transform would basically mean to implement the robot_state_publisher yourself. You could build a custom robot-specific one, but given that you have a URDF, this shouldn't be necessary.

Basically robot_state_publisher will publish transforms for all links in your URDF, where there was joint state information received that connects those links by joints. So, if you are missing a transform, either there is no chain for that in the URDF or there is at least one joint in the URDF, where you are not publishing the specific joint state for.

edit flag offensive delete link more

answered 2013-08-24 13:05:59 -0500

rnunziata gravatar image

Close ....will re visit this issue when I get some other things working that make this issue difficult to debug.

edit flag offensive delete link more

Question Tools



Asked: 2013-08-23 03:17:56 -0500

Seen: 777 times

Last updated: Aug 24 '13