ROS中遇到的问题:no transform from [left_back_wheel] to [base_link]


软件环境:Ubuntu 16.04

     ROS kinetic

问题发现:

ROS学习(1)使用URDF创建机器人3D仿真模型
原地址:http://blog.csdn.net/akunainiannian/article/details/44985423

在URDF文件中构建机器人模型,并通过*.launch文件启动RViz观察构建的URDF文件,能启动Rviz但发现有如下错误提示:


Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher", line 361, in 
    jsp = JointStatePublisher()
  File "/opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher", line 41, in __init__
    robot = xml.dom.minidom.parseString(description).getElementsByTagName('robot')[0]
  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 9426, exit code 1, cmd /opt/ros/kinetic/lib/joint_state_publisher/
joint_state_publisher __name:=joint_state_publisher __log:=/home/mingde-yao/.ros/log/8db3b6bc-74da-11e6-9418-000c297f6d5a/
joint_state_publisher-1.log].
log file: /home/mingde-yao/.ros/log/8db3b6bc-74da-11e6-9418-000c297f6d5a/joint_state_publisher-1*.log



在Rviz中是这个鬼样子:

ROS中遇到的问题:no transform from [left_back_wheel] to [base_link]_第1张图片




使用下面指令:
check_urdf *.urdf 

查看urdf文件没有问题。


尝试1:

搜索发现 hitgavin 也有类似的问题,但我进行如下操作后


sudo apt-get install unicode  

发现问题并没有得到解决。

尝试2:hitgavin 提到了这篇文章,

有回答如下:

Your example works fine for me, except it doesn't like extra spaces before the

xml version="1.0"?>

line, but I assume that's just formatting for this page.


遂检查自己的URDF文件,原来是第一行多了一个空格,导致不能识别文件,删掉后问题得到解决!

对于初学者来说,写东西的时候一定要注意格式!!!


参考:

1、http://blog.csdn.net/akunainiannian/article/details/44985423

2、http://blog.csdn.net/hitgavin/article/details/51997379
3、http://answers.ros.org/question/201372/rviz-keep-saying-no-transform-from-front_left-to-base_link/



你可能感兴趣的:(ROS)