Ask Your Question
0

How to solve 'ImportError: No module named door_msgs.msg' ?

asked 2012-08-06 04:12:23 -0500

sam gravatar image

updated 2014-01-28 17:13:15 -0500

ngrennan gravatar image

I followed PR2 Opens a Door tutorial.

when I run

  hg clone https://kforge.ros.org/doors/hg
  svn co https://code.ros.org/svn/wg-ros-pkg/stacks/motion_planning_common/trunk/mapping_msgs
  svn co https://code.ros.org/svn/wg-ros-pkg/stacks/motion_planning_common/trunk/geometric_shapes_msgs

  export ROBOT=sim
  roslaunch pr2_doors_gazebo_demo pr2_doors_demo.launch
  rosrun pr2_doors_executive trigger_opendoor.py

It says:

  ira@ira-K42JP:~/code/ros/test$ rosrun pr2_doors_executive trigger_opendoor.py
  Traceback (most recent call last):
    File "/home/ira/code/ros/sam_gazebo/hg/pr2_doors_executive/scripts/trigger_opendoor.py", line 33, in <module>
      import roslib; roslib.load_manifest('pr2_doors_executive')
    File "/opt/ros/electric/ros/core/roslib/src/roslib/launcher.py", line 75, in load_manifest
      sys.path = prefix + _generate_python_path(package_name, [], os.environ) + sys.path
    File "/opt/ros/electric/ros/core/roslib/src/roslib/launcher.py", line 131, in _generate_python_path
      raise roslib.packages.InvalidROSPkgException("While loading package '%s': %s"%(d.package, str(e)))
  roslib.packages.InvalidROSPkgException: While loading package 'pr2_doors_actions': While loading package 'door_handle_detector': While loading package 'mapping_msgs': While loading package 'geometric_shapes_msgs': Cannot locate installation of package geometric_shapes_msgs: [rospack] couldn't find package [geometric_shapes_msgs]. ROS_ROOT[/opt/ros/electric/ros] ROS_PACKAGE_PATH[/home/ira/code/ros:/opt/ros/electric/stacks]
  ira@ira-K42JP:~/code/ros/test$ rosrun pr2_doors_executive trigger_opendoor.py
  Traceback (most recent call last):
    File "/home/ira/code/ros/sam_gazebo/hg/pr2_doors_executive/scripts/trigger_opendoor.py", line 37, in <module>
      from door_msgs.msg import DoorAction, DoorGoal, Door
  ImportError: No module named door_msgs.msg
  ira@ira-K42JP:~/code/ros/test$

How to solve it?

Thank you~

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-08-06 04:55:08 -0500

Lorenz gravatar image

Did you execute

rosmake pr2_doors_executive

When you are installing packages from source, you need to rosmake them.

edit flag offensive delete link more

Comments

I can run it. And it shows:Waiting for open door action server Sending goal to open door action server. But why pr2 doesn't move? I can't see PR2 do anything.

sam gravatar image sam  ( 2012-08-06 05:26:20 -0500 )edit

As @dornhege pointed out already, the code is written for cturtle and is probably unmaintained. I wouldn't expect it to work in electric.

Lorenz gravatar image Lorenz  ( 2012-08-06 05:31:45 -0500 )edit

Sure,you're right. But I think if I know how tofix it maybe I can learn more ROS. Or should I post on another question?

sam gravatar image sam  ( 2012-08-06 05:47:33 -0500 )edit
1

If you do this to learn more, you'll need to debug what is going on, i.e. understand how it's supposed to work and then see where it hangs. But for learning how things in ROS work, I'd suggest taking something more recent as things might have changed drastically.

dornhege gravatar image dornhege  ( 2012-08-06 06:35:50 -0500 )edit

Where to start to figure out? And how to make sure what I need? Thank you~

sam gravatar image sam  ( 2012-08-06 22:23:08 -0500 )edit

Reading source code is always a good starting point. Use rxgraph, rostopic info, rostopic list, rosnode info and rosnode list to find out which nodes are connected/unconnected. Find out why the unconnected nodes are not connected and fix that by starting the missing nodes. And read source code :)

Lorenz gravatar image Lorenz  ( 2012-08-06 22:38:30 -0500 )edit
0

answered 2012-08-06 04:36:15 -0500

dornhege gravatar image

Do you have a door_msgs package? Are the respective packages in your ROS_PACKAGE_PATH?

Also, the tutorial is for cturtle. What ROS version do you run? If it's not cturtle packages might not be there anymore/named differently/APIs changed.

edit flag offensive delete link more

Comments

door_msgs is include in https://kforge.ros.org/doors/hg. And I make sure it is in ROS_PACKAGE_PATH. I use electric. I want to know how to fixed it to learn more ROS. And... why ROS couldn't support early version? Thank you~

sam gravatar image sam  ( 2012-08-06 04:46:51 -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

Stats

Asked: 2012-08-06 04:12:23 -0500

Seen: 1,068 times

Last updated: Aug 06 '12