ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

custom messages fail to import in python

asked 2015-09-09 07:04:52 -0500

guneycan gravatar image

I catkinized xsens_mti_ros_node package and did 'source devel/setup.bash'. Thete is no error message after comping the package. Probably compiled correctly because I can call the messages in the folder of custom_msgs.msg. With running the file of mtdevice.py, i can see the stream of mti-g-700. However, I get the following error when I run the package (mtnode.py). Error: ImportError: No module named custom_msgs.msg I have wasted a couple of days but I could not solve the problem. How can I figure this out?

edit retag flag offensive close merge delete

Comments

What do you mean by "call the messages in the folder of..."? And "when I run the package (mtnode.py)"? And I suggest you Google the error message you got; there are several similar question threads some of which might give you a hint.

130s gravatar image 130s  ( 2015-09-09 07:50:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-09 08:19:13 -0500

guneycan gravatar image

Addition to the src folder, there is another folder called custom_msgs and under custom_msgs there is a subfolder called msg. When I run the rosmsg ($rosmsg show baroSample.msg), I get back the correct response.

In the src folder, there are three python files (mtdef.py, mtdevice.py, mtnode.py).

When I run mtdevice.py ($rosrun xsens_driver mtdevice.py), I get back the data from IMU and streaming on the screen.

When I run the mtnode.py ($rosrun xsens_driver mtnode.py), the following error occurs:

Traceback (most recent call last) File ...mtnode.py, line 14, in <module> from custom_msgs.msg import baroSample ImportError: No moduled named custom_msgs.msg

github adreeses of the driver: https://github.com/xsens/xsens_mti_ro...

besides, I did google the problem, but I could not find the solution or hint.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-09 07:04:52 -0500

Seen: 284 times

Last updated: Sep 09 '15