Ask Your Question
0

How to solve the conflict among "/joint_states",urdf and tf's transform

asked 2016-11-29 22:14:41 -0500

scopus gravatar image

updated 2016-11-30 10:40:54 -0500

gvdhoorn gravatar image

Hi, all! My question are from this question published before. You don't need to read that question. Because I have found that this maybe totally because multiple postion values in the message /joint_states which is published by joint_state_publisher and received by robot_state_publisher.

In a word, we are constructing a 3D scanning hardware system, in which a dynamixel motor rotates a Hokuyo scanner to obtain a 3D map. We use urdf and package robot_state_publisher to construct the tf tree as this tutorial says. But from the display of 3D models and the tf tree, the revolute joint where the motor rotates the scanner couldn't work normally.

As this question said, we found that the frame_id "HN07_N101" ( the revolute joint on the Dynamixel motor) which rotates around its own blue "Z" axis couldn't be displayed normally.

From the displayed tf tree in rviz, It seems that the frame "HN07_N101" couldn't roate smoothly. We check the topic "/joint_states" as follows:

hodor@hodor:~$ rostopic echo /joint_states | grep position
position: [0.0]
position: [0.22242721424341796]
position: [0.0]
position: [-0.09050486648525283]
position: [0.0]
position: [-0.40803888957758055]
...
position: [0.0]
position: [-1.5677283652191252]
position: [0.0]

It seems that there is conflict between the message published by joint_state_publisher( zero value) and the message published by our project. This conflict leads two different position value in the topic "/joint_states" which possible causes the unsmooth rotation of frame "HN07_N101".

My launch file is :

<?xml version="1.0"?>

    <launch>
      <param name="robot_description" textfile="$(find ins_threedscan_description)/urdf/Work.urdf" />
       <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
       <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
       <node name="rviz" pkg="rviz" type="rviz" args="-d $(find ins_threedscan_description)/rviz_cfg/work.rviz" />
        <node pkg="loam_back_and_forth" type="scantoCloud_bf" name="scantoCloud_bf" output="screen" launch-prefix = "$(arg launch_prefix)"/>

      </launch>

Does anybody know how to solve this confict? Best Regards!

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-30 05:33:25 -0500

gvdhoorn gravatar image

Does anybody know how to solve this confict? Best Regards!

yes: you don't need a joint_state_publisher instance if you have some other node in your system that already publishes JointState messages (in this case for your Dynamixel joints).

See how to publish real robot-arm joint_states by ROS for a related question and some more explanation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-29 22:14:41 -0500

Seen: 163 times

Last updated: Nov 30 '16