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

A subscriber (python script) problem? Please correct..... the error

asked 2013-08-12 00:09:00 -0600

lifelonglearner gravatar image

updated 2014-01-28 17:17:38 -0600

ngrennan gravatar image

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
roslib.load_manifest('test')
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)
      rospy.spin()

if __name__ == '__main__' :
      listener()

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

Traceback (most recent call last):
File "/home/admin-pc/mywork/test/scripts/subs1.py", line 4, in <module> 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$

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-08-12 01:42:11 -0600

pkohout gravatar image

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 ?

edit flag offensive delete link more

Comments

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.

lifelonglearner gravatar image lifelonglearner  ( 2013-08-12 03:04:16 -0600 )edit

Don't forget to source the setup.bash file for your catkin workspace in *every terminal* you are using.

dPackard gravatar image dPackard  ( 2013-08-12 07:40:54 -0600 )edit

I am using rosbuild for it ..... is there any specific suggestion in that regard Please tell.

lifelonglearner gravatar image lifelonglearner  ( 2013-08-12 15:09:08 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-12 00:09:00 -0600

Seen: 462 times

Last updated: Aug 12 '13