Getting 'rosgraph resource not found' when trying to get turtlebot local_plan?
Hi,
I'm trying to get the 'geometry_msgs/Poses'
message from the '/move_base/DWAPlannerROS/local_plan'
topic for the Kobuki Turtlebot. My current code is as follows: (This is an extremely minimal implementation where I am just accessing the value of the X position).
#!/usr/bin/env python
import rospy
from nav_msgs.msg import Path
def callback(data):
global xPos
xPos = data.Pose.position.X;
def getPlan():
rospy.init_node('plangetter', anonymous=False);
while not rospy.is_shutdown():
rospy.Subscriber('/move_base/DWAPlannerROS/local_plan', Path, callback);
rospy.sleep(1);
print "X is: " + xPos;
if __name__ == '__main__':
try:
getPlan();
except rospy.ROSInterruptException:
pass
My questions are:
1) Why am I getting a 'rospkg.common.ResourceNotFound: rosgraph'
error when running this code? I have checked my ROS_PACKAGE_PATH
and used rospack find rosgraph
to confirm that ROS has access to the package. I have also made sure my PYTHONPATH is correct.
2) Am I correctly subscribing to the topic and getting the data? If not, what is the correct way?
Thanks in advance!