我使用ros kinetic和Ubuntu 16.04
我试图运行此项目但不在docker容器内运行。我已将整个健身房文件从容器复制到我的桌面,并尝试在docker容器外运行。
我完成后
user@user-HP-Pavilion-15-Notebook-PC:~/gym/gym-gazebo/gym_gazebo/envs/installation$ bash turtlebot_setup.bash
user@user-HP-Pavilion-15-Notebook-PC:~/gym/gym-gazebo/examples/scripts_turtlebot$ python circuit2_turtlebot_lidar_qlearn.py
我明白了
/usr/lib/python2.7/dist-packages/skimage/viewer/qt/__init__.py:18: UserWarning: Could not import PyQt4: ImageViewer not available!
warnings.warn("Could not import PyQt4: ImageViewer not available!")
Could not import matplotlib -- skimage.viewer not available.
Traceback (most recent call last):
File "circuit2_turtlebot_lidar_qlearn.py", line 25, in <module>
env = gym.make('GazeboCircuit2TurtlebotLidar-v0')
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 119, in make
env = spec.make()
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 85, in make
cls = load(self._entry_point)
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 14, in load
result = entry_point.load(False)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in load
return self.resolve()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/thong/gym/gym-gazebo/gym_gazebo/envs/__init__.py", line 12, in <module>
from gym_gazebo.envs.gazebo_erlecopter_hover import GazeboErleCopterHoverEnv
File "/home/thong/gym/gym-gazebo/gym_gazebo/envs/gazebo_erlecopter_hover.py", line 14, in <module>
from mavros_msgs.msg import OverrideRCIn
ImportError: No module named mavros_msgs.msg
这是我的turtlebot_setup.bash
#!/bin/bash
if [ -z "$GAZEBO_MODEL_PATH" ]; then
bash -c 'echo "export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:"`pwd`/../assets/models >> ~/.bashrc'
else
bash -c 'sed "s,GAZEBO_MODEL_PATH=[^;]*,'GAZEBO_MODEL_PATH=`pwd`/../assets/models'," -i ~/.bashrc'
fi
#Load turtlebot variables. Temporal solution
chmod +x catkin_ws/src/turtlebot_simulator/turtlebot_gazebo/env-hooks/25.turtlebot-gazebo.sh.em
bash catkin_ws/src/turtlebot_simulator/turtlebot_gazebo/env-hooks/25.turtlebot-gazebo.sh.em
#add turtlebot launch environment variable
if [ -z "$GYM_GAZEBO_WORLD_MAZE" ]; then
bash -c 'echo "export GYM_GAZEBO_WORLD_MAZE="`pwd`/../assets/worlds/maze.world >> ~/.bashrc'
else
bash -c 'sed "s,GYM_GAZEBO_WORLD_MAZE=[^;]*,'GYM_GAZEBO_WORLD_MAZE=`pwd`/../assets/worlds/maze.world'," -i ~/.bashrc'
fi
if [ -z "$GYM_GAZEBO_WORLD_CIRCUIT" ]; then
bash -c 'echo "export GYM_GAZEBO_WORLD_CIRCUIT="`pwd`/../assets/worlds/circuit.world >> ~/.bashrc'
else
bash -c 'sed "s,GYM_GAZEBO_WORLD_CIRCUIT=[^;]*,'GYM_GAZEBO_WORLD_CIRCUIT=`pwd`/../assets/worlds/circuit.world'," -i ~/.bashrc'
fi
if [ -z "$GYM_GAZEBO_WORLD_CIRCUIT2" ]; then
bash -c 'echo "export GYM_GAZEBO_WORLD_CIRCUIT2="`pwd`/../assets/worlds/circuit2.world >> ~/.bashrc'
else
bash -c 'sed "s,GYM_GAZEBO_WORLD_CIRCUIT2=[^;]*,'GYM_GAZEBO_WORLD_CIRCUIT2=`pwd`/../assets/worlds/circuit2.world'," -i ~/.bashrc'
fi
if [ -z "$GYM_GAZEBO_WORLD_CIRCUIT2C" ]; then
bash -c 'echo "export GYM_GAZEBO_WORLD_CIRCUIT2C="`pwd`/../assets/worlds/circuit2c.world >> ~/.bashrc'
else
bash -c 'sed "s,GYM_GAZEBO_WORLD_CIRCUIT2C=[^;]*,'GYM_GAZEBO_WORLD_CIRCUIT2C=`pwd`/../assets/worlds/circuit2c.world'," -i ~/.bashrc'
fi
if [ -z "$GYM_GAZEBO_WORLD_ROUND" ]; then
bash -c 'echo "export GYM_GAZEBO_WORLD_ROUND="`pwd`/../assets/worlds/round.world >> ~/.bashrc'
else
bash -c 'sed "s,GYM_GAZEBO_WORLD_ROUND=[^;]*,'GYM_GAZEBO_WORLD_ROUND=`pwd`/../assets/worlds/round.world'," -i ~/.bashrc'
fi
#copy altered urdf model
cp -r ../assets/urdf/kobuki_urdf/urdf/ catkin_ws/src/kobuki/kobuki_description
#copy laser mesh file
cp ../assets/meshes/lidar_lite_v2_withRay.dae catkin_ws/src/kobuki/kobuki_description/meshes
exec bash # reload bash
我该怎么做才能解决这个问题?以及如何正确安装包?
答案 0 :(得分:1)
使用rosmsg list
检查您的Env路径中是否有Msg。
如果你没有它然后它是你的路径问题尝试寻找主要ROS文件夹的setup.bash(或者如果U从你的工作区的源setup.bash编译它)
编辑1
您可以使用apt install ros-kinetic-mavros ros-kinetic-mavros-msgs