I tried to run this code but doesn't work.
#!/usr/bin/env python
import roslib; roslib.load_manifest('rospy_tutorials')
import rospy
from std_msgs.msg import *
from stacks.shadow_robot.sr_robot_msgs.msg import JointControllerState
def callback(data):
rospy.loginfo(rospy.get_caller_id()+"I heard %s", data)
def listener():
rospy.init_node('listener', anonymous=True)
rospy.Subscriber("sh_ffj3_mixed_position_velocity_controller/command", JointControllerState, callback)
# spin() simply keeps python from exiting until this node is stopped
rospy.spin()
if __name__ == '__main__':
listener()
the answer for this is:
Traceback (most recent call last):
File "/home/paulo/ros_workspace/sandbox/beginner_tutorials/scripts/listener.py", line 7, in
from stacks.shadow_robot.sr_robot_msgs.msg import JointControllerState
ImportError: No module named stacks.shadow_robot.sr_robot_msgs.msg
How to import sr_robot_msgs?