URDF and joint_state_publisher
Hi,
I'm trying to create a new robot model that implements a LIDAR and a camera, all of that using rtabmap_ros.
In order to do that, I created the following basic URDF:
<?xml version="1.0"?>
<robot name="erl_ugv">
<link name="base_footprint"/>
<link name="base_link"/>
<link name="laser_link"/>
<joint name="base_link_joint" type="fixed">
<parent link="base_footprint"/>
<child link="base_link"/>
<origin xyz="0 0 0.025" rpy="0 0 0"/>
</joint>
<joint name="laser_link_joint" type="fixed">
<parent link="base_link"/>
<child link="laser_link"/>
<origin xyz="0.08 0.006 0.44" rpy="0 0 0"/>
</joint>
</robot>
(it's the fixed structure of the robot). I also created the parser.cpp file as explained on this tutorial
I tried to make all of this work thanks to the following launch file:
<launch>
<arg name="model"/>
<param name="robot_description" textfile="$(find erl_ugv_description)/urdf/erl_ugv.urdf"/>
<param name="use_gui" value="true"/>
<param name="use_sim_time" value="false"/>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" respawn="false"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find erl_ugv_description)/urdf.rviz" required="true" />
<node pkg="tf" type="static_transform_publisher" name="base_laser_link" args="0.08 0.006 0.44 0 0 0 /base_link /base_laser_link 100" />
<node pkg="tf" type="static_transform_publisher" name="laser" args="0.08 0.006 0.44 0 0 0 /base_link /laser 100" />
<node pkg="tf" type="static_transform_publisher" name="camera_link" args="0.095 0 0.225 0 0 0 /base_link /camera_link 100" />
</launch>
with erl_ugv_description being the name of the dedicated package created in my catkin_ws
The thing is, when I roslaunch the previous file, I get the expected tf and axes in rviz. But also an error that says
[joint_state_publisher-2] process has died
I'm wondering whether the non completion of this tutorial on creating a state_publisher node with a C++ code is responsible for my failure. I'm asking this here because I don't understand how I could adapt the C++ code to my situation (a fixed structure, so what about the odom_trans, hinc, etc ? ...).
Thanks !
EDIT
Here is the log of the roslaunch with the launch file pasted at the beginning of this post.
turtlebot@turtlebot-14:~/erl/logs_new$ roslaunch erl_ugv_description beta.launch... logging to /home/turtlebot/.ros/log/072eb570-7041-11e7-93b9-605718b05f9f/roslaunch-turtlebot-14-4597.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://10.42.0.148:33667/
SUMMARY
========
PARAMETERS
* /robot_description: <?xml version="1....
* /rosdistro: indigo
* /rosversion: 1.11.21
* /use_gui: True
* /use_sim_time: False
NODES
/
base_laser_link (tf/static_transform_publisher)
camera_link (tf/static_transform_publisher)
joint_state_publisher (joint_state_publisher/joint_state_publisher)
laser (tf/static_transform_publisher)
robot_state_publisher (robot_state_publisher/state_publisher)
rviz (rviz/rviz)
ROS_MASTER_URI=http://10.42.0.148:11311
core service [/rosout] found
process[joint_state_publisher-1]: started with pid [4615]
process[robot_state_publisher-2]: started with pid [4616]
process[rviz-3]: started with pid [4619]
process[base_laser_link-4]: started with pid [4620]
process[laser-5]: started with pid [4621]
process[camera_link-6]: started with pid [4626]
Traceback (most recent call last):
File "/opt/ros/indigo/lib ...
It's not really possible to figure out why the node died without seeing your code. I know that you followed the tutorial, but there could be errors in your code. Also, is that all that ROS is telling you?
that's the thing, I didn't follow the last tutorial with the C++ code (thus, nothing is compiled/executed), because I don't understand the use of this code & a colleague seems to make all of this work without the C++ script.
see my Edit in the question for what ROS is telling me when I roslaunch my custom .launch. See EDIT 2 for question clarification.
Did you look into the part of the traceback that says
UnboundLocalError: local variable 'slider' referenced before assignment
?Also, what were you and your colleague expecting
RViz
to do? It visualizes topics and information.Solve (magically ? ... :P) the joint_state_publisher error ...
UnboundLocalError: local variable 'slider' referenced before assignment
isn't coming from my code. Could it be a ROS code bug ?