关于ROS [joint_state_publisher-1] process has died [pid 3045, exit code 1, cmd /opt/ros/kinetic/lib..

问题描述:

运行 roslaunch smartcar_description base.urdf.rviz.launch


出现错误:

ERROR: the config file '/opt/ros/kinetic/share/urdf_tutorial/urdf.vcg' is a .vcg file, which is the old rviz config format.
       New config files have a .rviz extension and use YAML formatting.  The format changed
       between Fuerte and Groovy.  There is not (yet) an automated conversion program.
[rviz-3] process has died [pid 4230, exit code 1, cmd /opt/ros/kinetic/lib/rviz/rviz -d /opt/ros/kinetic/share/urdf_tutorial/urdf.vcg __name:=rviz __log:=/home/kim/.ros/log/f7c26a52-9473-11e8-888d-60f677c336e2/rviz-3.log].
log file: /home/kim/.ros/log/f7c26a52-9473-11e8-888d-60f677c336e2/rviz-3*.log
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher", line 474, in 
    jsp = JointStatePublisher()
  File "/opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher", line 149, in __init__
    robot = xml.dom.minidom.parseString(description)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: XML or text declaration not at start of entity: line 1, column 1
[joint_state_publisher-1] process has died [pid 4228, exit code 1, cmd /opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/kim/.ros/log/f7c26a52-9473-11e8-888d-60f677c336e2/joint_state_publisher-1.log].
log file: /home/kim/.ros/log/f7c26a52-9473-11e8-888d-60f677c336e2/joint_state_publisher-1*.log

改正方法:

1. 对于第一个错误,将launch文件最后vcg改成rviz;

      

    

2. 对于第二个错误,将urdf文件第一行前面到空格全部去掉,一般格式正确后都会有颜色的,写urdf一定要注意格式;

 

你可能感兴趣的:(ROS学习)