How to solve the conflict among "/joint_states",urdf and tf's transform
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!