-
@fuzz 客气,修改完再试试是否可以正常使用ROS
-
@小鱼 已经可以成功运行小乌龟了
-
-
@小鱼 @fuzz 按照帖子的内容修改了,又出现了下面的错误,请问大佬们怎么解决啊?谢谢~ (我的环境和fuzz的一样)
Traceback (most recent call last):
File "/opt/ros/melodic/bin/roscore", line 37, in <module>
from roslaunch.nodeprocess import DEFAULT_TIMEOUT_SIGINT, DEFAULT_TIMEOUT_SIGTERM
File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/init.py", line 39, in <module>
import rospkg
ModuleNotFoundError: No module named 'rospkg' -
解决了
pip3 install rospkg -
我装的python3可是也出现了这个问题
-
@gaoxu515 为什么这个我输入后报错
-
Traceback (most recent call last):
File "/usr/bin/roscore", line 37, in <module>
from roslaunch.nodeprocess import DEFAULT_TIMEOUT_SIGINT, DEFAULT_TIMEOUT_SIGTERM
File "/usr/lib/python3/dist-packages/roslaunch/init.py", line 62, in <module>
from .scriptapi import ROSLaunch
File "/usr/lib/python3/dist-packages/roslaunch/scriptapi.py", line 42, in <module>
import roslaunch.parent
File "/usr/lib/python3/dist-packages/roslaunch/parent.py", line 54, in <module>
import roslaunch.server
File "/usr/lib/python3/dist-packages/roslaunch/server.py", line 80, in <module>
from rosgraph_msgs.msg import Log
ImportError: cannot import name 'Log' from 'rosgraph_msgs.msg' (/opt/ros/rolling/lib/python3.10/site-packages/rosgraph_msgs/msg/init.py) -
@1412846703 ros2不需要输入rosroce来跑小乌龟,直接输入ros2 run turtlesim turtlesim_node
之后再开个命令行输入ros2 run turtlesim turtle_teleop_key就可以了。
详见 https://zhuanlan.zhihu.com/p/481084074#:~:text=启动小乌龟仿真器: ros2 run turtlesim turtlesim_node 启动后可以看到一个仿真器:,另外需要打开一个终端,在里面运行键盘控制的节点,命令如下: ros2 run turtlesim turtle_teleop_key 正如打印信息所述,可以通过键盘上的方向箭头移动小乌龟,可以通过G|B|V|C|D|E|R|T这些按键进行旋转到一个绝对的方向,F取消旋转,Q退出。 -
@1412846703 解决了吗,我也是这个问题