0

I am trying to install gym_gazebo on my Ubuntu 16.04 LTS system according to https://github.com/erlerobot/gym-gazebo

Everything is getting installed correctly, however, while trying to run python circuit2_turtlebot_lidar_qlearn.py , I get error as

ModuleNotFoundError: No module named 'std_msgs'.

This should be part of ros_comm project which I have installed but still I cannot see std_msgs related code file anywhere.

Can someone please point me to how can I install std_msgs, so that I can get rid of this error message?

Thanks in advance!

Pallavi
  • 548
  • 2
  • 9
  • 18

1 Answers1

0

that should be very straightforward:

 sudo apt-get install ros-<ros version>-std-msgs

Just replace with kinetic, or whatever you are using.

Ivan
  • 16
  • 3
  • Sorry I forgot to update. After doing some more research, I could install this from github and made some changes in folder structure so that code could recognize the location. However, now I am getting following error for this line "from std_msgs.msg import Header". **ImportError: cannot import name 'Header'** I checked my folder "std_msgs/msg" and found several files with .msg extension and among them there is a Header.msg file. However, since it is not .py file, import command does not recognize it. Is there any other step to convert these files to .PY file? – Pallavi Aug 08 '18 at 05:00
  • The thing is that ROS usually generates .h and .py files for you. Therefore I would say that maybe your Python instance doesn't know about ROS. I usually add ROS to my PYTHONPATH, here is my .bashrc c/p: export PYTHONPATH=$PYTHONPATH:/opt/ros/kinetic/lib/python2.7/dist-packages/ – Ivan Aug 08 '18 at 07:50
  • Finally, I could install std_msgs with the help of tutorial from ROS wiki and not getting error anymore. Earlier I was following the steps given in the github link for gym-gazebo. Thanks for your help! – Pallavi Aug 08 '18 at 09:16
  • Accepting the answer as it solves the original error. – Pallavi Aug 08 '18 at 09:17