roscore失败的问题/启动py程序找不到文件

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/fk1174/article/details/52671725

今天不知道咋回事roscore都出问题,虽然没搞懂为什么突然有了这个问题,但是还是有点指导咋回事了,记下来。

roscore报错:

kylefan@kylefan-Lenovo-G470:~$ roscore
WARNING: unable to configure logging. No log files will be generated
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/usr/bin/rosversion", line 85, in <module>
    version = rosstack.get_stack_version(stack_name)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 418, in get_stack_version
    return get_stack_version_by_dir(self.get_path(stack))
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 198, in get_path
    self._update_location_cache()
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 181, in _update_location_cache
    list_by_path(self._manifest_name, path, cache)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 67, in list_by_path
    root = ElementTree(None, os.path.join(d, PACKAGE_FILE))
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 611, in __init__
    self.parse(file)
  File "<string>", line 38, in parse
cElementTree.ParseError: not well-formed (invalid token): line 13, column 31
Invalid <param> tag: Cannot load command parameter [rosversion]: command [rosversion roslaunch] returned with code [1]. 

Param xml is <param command="rosversion roslaunch" name="rosversion"/>
The traceback for the exception was written to the log file
No handlers could be found for logger "roslaunch"

Google了下,大概的意思是source /opt/ros/indigo/setup.bash 这里有点问题,把.bashrc的这句话放到最底下就好了,之前它下面有句:source /home/kylefan/catkin_ws/devel/setup.bash,搞不懂以前咋没事,就这样吧。

还有一个小问题也写在这把,在写好×××.py之后忘了chmod +x ×××.py,就会导致启动不了的情况,chmod +x on a file only means, that you’ll make it executable. Right click on your script and chose Properties -> Permissions -> Allow executing file as program, leaves you with the exact same result as the command in terminal.

发现自己好菜,不会系统的自学,还没人带。呵呵。

展开阅读全文

没有更多推荐了,返回首页