0
$\begingroup$

Rosanswers logo

Hello,

I am trying to subscribe to turtlebot_node/sensor_state so that I can tell when my Turtlebot has bumped into something and handle it accordingly. Whenever I try to run it, however, it gives me the error message:

 File "/opt/ros/electric/stacks/turtlebot_apps/turtlebot_teleop 
 /bin/turtlebot_teleop_key", line 35, in <module>
     from turtlebot_node.msg import TurtlebotSensorState
 ImportError: No module named turtlebot_node.msg

My import statements are as follows:

from os import system
import curses
import roslib; roslib.load_manifest('turtlebot_teleop')
import rospy
import random
from turtlebot_node.msg import TurtlebotSensorState
from geometry_msgs.msg import Twist

From other examples I can find online, it seems like this should work. turtlebot_node is definitely running correctly and I have no trouble getting it to move without implementing a bump correction algorithm. What do you think is wrong?

Thanks, Matthew


Originally posted by saltzm on ROS Answers with karma: 1 on 2011-11-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

How did you install the turtlebot_node package? If it is from source, you need to run "make" to generate the message headers.


Originally posted by fergs with karma: 13902 on 2011-11-18

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by tfoote on 2011-11-26:
I recommend using rosmake in your package. The build system has to generate the message processing code which is failing to import.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.