1、roscore运行报错
报错内容:
Traceback (most recent call last): ? File "/opt/ros/melodic/bin/roscore", line 72, in <module> ? ? import roslaunch ? File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 62, in <module> ? ? from .scriptapi import ROSLaunch ? File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/scriptapi.py", line 42, in <module> ? ? import roslaunch.parent ? File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 54, in <module> ? ? import roslaunch.server ? File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/server.py", line 79, in <module> ? ? from rosgraph_msgs.msg import Log ? File "/opt/ros/eloquent/lib/python3.6/site-packages/rosgraph_msgs/msg/__init__.py", line 1, in <module> ? ? from rosgraph_msgs.msg._clock import Clock ?# noqa: F401 ? File "/opt/ros/eloquent/lib/python3.6/site-packages/rosgraph_msgs/msg/_clock.py", line 56 ? ? class Clock(metaclass=Metaclass_Clock): ? ? ? ? ? ? ? ? ? ? ? ? ?^ SyntaxError: invalid syntax 解决办法:
cd /opt/ros/melodic
source?setup.bash
2、rviz运行报错,闪退
报错内容:
[ INFO] [1645687530.666154492]: rviz version 1.13.23 [ INFO] [1645687530.666203628]: compiled against Qt version 5.9.5 [ INFO] [1645687530.666211976]: compiled against OGRE version 1.9.0 (Ghadamon) [ INFO] [1645687530.669179157]: Forcing OpenGl version 0. [ INFO] [1645687532.074182707]: Stereo is NOT SUPPORTED [ INFO] [1645687532.074248483]: OpenGL device: SVGA3D; build: RELEASE; ?LLVM; [ INFO] [1645687532.074262172]: OpenGl version: 3.3 (GLSL 3.3) limited to GLSL 1.4 on Mesa system. rviz: symbol lookup error: /opt/ros/melodic/lib/libtf.so: undefined symbol: _ZN7tf2_ros6BufferC1EN3ros8DurationEb 查找问题:echo $LD_LIBRARY_PATH
/opt/ros/eloquent/opt/yaml_cpp_vendor/lib:/opt/ros/eloquent/opt/rviz_ogre_vendor/lib:/opt/ros/eloquent/lib/x86_64-linux-gnu:/opt/ros/eloquent/lib:/opt/ros/melodic/lib
问题分析:因为安装了ROS2(eloquent),导致环境变量被修改 解决办法:source setup.bash
?
|