ImportError: No module named mavros_msgs.msg

asked 2018-04-08 13:50:47 -0500

foong0920 gravatar image

updated 2018-04-08 15:28:30 -0500

Im using ros kinetic and Ubuntu 16.04

Im trying to do run this project but not running inside a docker container. I had copied the whole gym file from container to my desktop and try to run outside the docker container.

After i had done

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

I get this

/usr/lib/python2.7/dist-packages/skimage/viewer/qt/ 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 "", line 25, in <module>
    env = gym.make('GazeboCircuit2TurtlebotLidar-v0')
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 167, in make
    return registry.make(id)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 119, in make
    env = spec.make()
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 85, in make
    cls = load(self._entry_point)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 14, in load
    result = entry_point.load(False)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/", line 2324, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/thong/gym/gym-gazebo/gym_gazebo/envs/", line 12, in <module>
    from gym_gazebo.envs.gazebo_erlecopter_hover import GazeboErleCopterHoverEnv
  File "/home/thong/gym/gym-gazebo/gym_gazebo/envs/", line 14, in <module>
    from mavros_msgs.msg import OverrideRCIn
ImportError: No module named mavros_msgs.msg

And this is my turtlebot_setup.bash


if [ -z "$GAZEBO_MODEL_PATH" ]; then
  bash -c 'echo "export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:"`pwd`/../assets/models >> ~/.bashrc'
  bash -c 'sed "s,GAZEBO_MODEL_PATH=[^;]*,'GAZEBO_MODEL_PATH=`pwd`/../assets/models'," -i ~/.bashrc'

#Load turtlebot variables. Temporal solution
chmod +x catkin_ws/src/turtlebot_simulator/turtlebot_gazebo/env-hooks/
bash catkin_ws/src/turtlebot_simulator/turtlebot_gazebo/env-hooks/

#add turtlebot launch environment variable
if [ -z "$GYM_GAZEBO_WORLD_MAZE" ]; then
  bash -c 'echo "export GYM_GAZEBO_WORLD_MAZE="`pwd`/../assets/worlds/ >> ~/.bashrc'
  bash -c 'sed "s,GYM_GAZEBO_WORLD_MAZE=[^;]*,'GYM_GAZEBO_WORLD_MAZE=`pwd`/../assets/worlds/'," -i ~/.bashrc'
if [ -z "$GYM_GAZEBO_WORLD_CIRCUIT" ]; then
  bash -c 'echo "export GYM_GAZEBO_WORLD_CIRCUIT="`pwd`/../assets/worlds/ >> ~/.bashrc'
  bash -c 'sed "s,GYM_GAZEBO_WORLD_CIRCUIT=[^;]*,'GYM_GAZEBO_WORLD_CIRCUIT=`pwd`/../assets/worlds/'," -i ~/.bashrc'
if [ -z "$GYM_GAZEBO_WORLD_CIRCUIT2" ]; then
  bash -c 'echo "export GYM_GAZEBO_WORLD_CIRCUIT2="`pwd`/../assets/worlds/ >> ~/.bashrc'
  bash -c 'sed "s,GYM_GAZEBO_WORLD_CIRCUIT2=[^;]*,'GYM_GAZEBO_WORLD_CIRCUIT2=`pwd`/../assets/worlds/'," -i ~/.bashrc'
if [ -z "$GYM_GAZEBO_WORLD_CIRCUIT2C" ]; then
  bash -c 'echo "export GYM_GAZEBO_WORLD_CIRCUIT2C="`pwd`/../assets/worlds/ >> ~/.bashrc'
  bash -c 'sed "s,GYM_GAZEBO_WORLD_CIRCUIT2C=[^;]*,'GYM_GAZEBO_WORLD_CIRCUIT2C=`pwd`/../assets/worlds/'," -i ~/.bashrc'
if [ -z "$GYM_GAZEBO_WORLD_ROUND" ]; then
  bash -c 'echo "export GYM_GAZEBO_WORLD_ROUND="`pwd`/../assets/worlds/ >> ~/.bashrc'
  bash -c 'sed "s,GYM_GAZEBO_WORLD_ROUND=[^;]*,'GYM_GAZEBO_WORLD_ROUND=`pwd`/../assets/worlds/'," -i ~/.bashrc'

#copy altered urdf model
cp -r ../assets ...
edit retag flag offensive close merge delete


I don't have any experience, but why don't you try to follow the non-deprecated installation instructions for Ubuntu? Docker seems to be deprecated...

mgruhler gravatar image mgruhler  ( 2018-04-09 03:51:20 -0500 )edit