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

来源:互联网 发布:淘宝延迟收货什么意思 编辑:程序博客网 时间:2024/05/04 10:31

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

roscore报错:

kylefan@kylefan-Lenovo-G470:~$ roscoreWARNING: unable to configure logging. No log files will be generatedChecking log directory for disk usage. This may take awhile.Press Ctrl-C to interruptDone 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 parsecElementTree.ParseError: not well-formed (invalid token): line 13, column 31Invalid <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 fileNo 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.

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

0 0