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

Can't find the custom message....ImportError: No module named wam_node.msg

asked 2014-07-17 17:14:12 -0500

rkitect gravatar image

updated 2014-07-17 17:16:34 -0500

I have wasted my whole day figuring this thing out. I can rosrun both packages, but python just cant find that "wam_node" package. I have used c++ before to use the same message and it worked. I don't know what is wrong ? Am I missing something ?

Any help/suggestion is appreciated. Thanks in advance.

Error when I run the package (rosrun hand_control

Traceback (most recent call last):
  File "/home/rohit/catkin_ws/src/BMI-robot-arm-control/hand_control/src/", line 12, in <module>
    from wam_node.msg import HandPosVel
ImportError: No module named wam_node.msg

Python code for import:

from std_msgs.msg import String
from biotac_sensors.msg import BioTacHand
from wam_node.msg import HandPosVel

"rosmsg list | grep Hand"output:


manifest.xml of hand_control package :

  <description brief="hand_control">


  <review status="unreviewed" notes=""/>
  <depend package="wam_node"/>
  <depend package="wam_msgs"/>
  <depend package="wam_srvs"/>
  <depend package="wam_control"/>

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-07-19 19:03:33 -0500

ahendrix gravatar image

It looks like you're mixing catkin and rosbuild packages somehow. This is generally not a good idea.

Your hand_control package is in a catkin workspace, but it has an old-style rosbuild manifest.

Is the wam_node package a catkin package or a rosbuild package?

If wam_node is a rosbuild pacakge, you can't depend on it or use it from a catkin package.

If your hand_control package and wam_node are both rosbuild packages, you'll need the old import roslib; roslib.load_manifest('package') line at the beginning of your python node in order to set up your python path correctly.

edit flag offensive delete link more


Yeah, I do have packages all mixed up, so that can be a problem. But anyways, now I have built a new catkin package and replicated the messages from wam_node for this package and it works fine.

rkitect gravatar image rkitect  ( 2014-07-19 21:55:59 -0500 )edit

answered 2014-07-17 19:50:04 -0500

DevonW gravatar image

updated 2014-07-17 19:50:32 -0500

Catkin can't find it because it doesn't know your catkin_ws/src/ environment exists. Try doing

cd catkin_ws && source devel/setup.bash

then re-run the code. It should now know about your created-from-source messages.

edit flag offensive delete link more


I have that in my .bashrc, I can rosrun wam_node and all other packages in catkin_ws , anyways I tried sourcing that file again but it still cant import the wam_node.msg.

rkitect gravatar image rkitect  ( 2014-07-18 10:00:31 -0500 )edit

Question Tools

1 follower


Asked: 2014-07-17 17:14:12 -0500

Seen: 2,112 times

Last updated: Jul 19 '14