0
$\begingroup$

Rosanswers logo

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.name.resize(1);
     jointStateMsg.position.resize(1);
     jointStateMsg.velocity.resize(1);
     jointStateMsg.header.frame_id = "base_link";
     jointStateMsg.header.stamp = msg.header.stamp;
     jointStateMsg.name[0] = "joint1";
     jointStateMsg.position[0] = msg.process_value;
     jointStateMsg.velocity[0] = msg.process_value_dot;
     pubJointState.publish(jointStateMsg);
}

From rostopic echo /joint_states

header: 
  seq: 1805
  stamp: 
    secs: 231
    nsecs: 908000000
  frame_id: base_link
name: ['joint1']
position: [-1.2626024562217015]
velocity: [0.015212120726772037]
effort: []
---
header: 
  seq: 1806
  stamp: 
    secs: 231
    nsecs: 908000000
  frame_id: base_link
name: ['joint2']
position: [0.632293076018593]
velocity: [0.018082079331372874]
effort: []

Originally posted by rnunziata on ROS Answers with karma: 713 on 2013-08-23

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2013-08-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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