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

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, i can see the stream of mti-g-700. However, I get the following error when I run the package ( 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


What do you mean by "call the messages in the folder of..."? And "when I run the package ("? 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

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 (,,

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

When I run the ($rosrun xsens_driver, the following error occurs:

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

github adreeses of the driver:

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


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

Seen: 285 times

Last updated: Sep 09 '15