Rosanswers logo

I am trying to write the python script to subscribe topic "cmd_vel_mux/input/teleop" as keyboard Teleop node publishes message on this topic

#!/usr/bin/env python

import roslib
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import String
def callback(data):
     print rospy.get_name(),  "%f %f %f %f %f %f" %data.linx %data.liny %data.linz %data.angx %data.angy %data.angz

def listener():
      rospy.init_node('subs1', anonymous=True)
      rospy.Subscriber("cmd_vel_mux/input/teleop", Twist, callback)
if __name__ == '__main__' :

Error on terminal ............

Traceback (most recent call last):
File "/home/admin-pc/mywork/test/scripts/subs1.py", line 4, in roslib.load_manifest('test')
File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest
sys.path = _generate_python_path(package_name, _rospack) + sys.path
File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/launcher.py", line 93, in _generate_python_path
m = rospack.get_manifest(pkg)
File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 133, in get_manifest return self._load_manifest(name)
File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 172, in _load_manifest retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name)
File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 164, in get_path raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound: test
ROS path [0]=/opt/ros/groovy/share/ros
ROS path [1]=/opt/ros/groovy/share
ROS path [2]=/opt/ros/groovy/stacks
ROS path [3]=/home/admin-pc/mywork
ROS path [4]=/home/admin-pc/ros_workspace$

Originally posted by lifelonglearner on ROS Answers with karma: 205 on 2013-08-12

Post score: 0


1 Answer 1


Rosanswers logo

The error means that rospkg cannot find the package "test". Have you create it as a package, and is it location in your ROS_PACKAGE_PATH ? Does rospack find test finds the path ?

Originally posted by pkohout with karma: 336 on 2013-08-12

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by lifelonglearner on 2013-08-12:
I have to check by rospack find test again. However I have checked it earlier and it was working well. More over there 3-4 more scrips in the this test package and all are working well. If there is some other possibility then please let me know.

Comment by dPackard on 2013-08-12:
Don't forget to source the setup.bash file for your catkin workspace in every terminal you are using.

Comment by lifelonglearner on 2013-08-12:
I am using rosbuild for it ..... is there any specific suggestion in that regard Please tell.


Your Answer

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