Ask Your Question
0

No module named msg

asked 2017-04-11 12:37:37 -0500

mattMGN gravatar image

Hello,

I am using an Arduino Uno with a Raspberry Pi on ROS indigo. When I run this command : rosrun rosserial_python serial_node.py

I don't understand why I get this error message :

pi@raspberrypi:~/catkin_ws/src $ rosrun rosserial_python serial_node.py

Traceback (most recent call last):

File "/home/pi/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 40, in <module> import rosserial_python

File "/home/pi/catkin_ws/devel/lib/python2.7/dist-packages/rosserial_python/__ init__ .py", line 35, in <module> exec(__fh.read())

File "<'string'>", line 1, in <'module'>

File "/home/pi/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 47, in <'module'>

from rosserial_msgs.msg import *

ImportError : No module named msg

And I also don't understand where my script is looking for when running 'from rosserial_msgs.msg import*' line in python. In :

  • /home/pi/catkin_ws/src/rosserial/rosserial_msgs/msg

Or in :

  • /usr/local/lib/python2.7/dist-packages

Or somewhere else ?

Regards,

Matthieu

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-04-12 01:11:33 -0500

updated 2017-04-12 01:20:00 -0500

Make sure that you have run catkin_make inside the catkin_ws directory. If you have already done that, I suspect that you have not added your catkin_ws in your bashrc. If you haven't, just run the following command:

echo "source /home/pi/catkin_ws/devel/setup.bash" >> /home/pi/.bashrc

Then close all terminals or run (on each open terminal):

source /home/pi/.bashrc
edit flag offensive delete link more

Comments

Thanks you very much. It works!

I missed >> /home/pi/.bashrc

mattMGN gravatar image mattMGN  ( 2017-04-12 02:31:23 -0500 )edit

Glad I helped! Don't forget to mark the question as solved, to help others too!

gstavrinos gravatar image gstavrinos  ( 2017-04-12 02:48:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-04-11 12:37:37 -0500

Seen: 846 times

Last updated: Apr 12 '17