Hi community,
i want to read the end position at the "joint_states"-topic. "Plan and Execute" via MoveIt! is successful.
I subscribe the "joint_states"-topic to read it, but if i want to read the end position, the subscribe will be in an endless loop.
How can i read the end position after "Plan and Execute" one time ??
Here is my code:
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import JointState
from control_msgs.msg import FollowJointTrajectoryActionResult
#from control_msgs.msg import FollowJointTrajectoryActionGoal
def callback(data):
print "I hear: ", data.status.status
if data.status.status == 3:
rospy.Subscriber("joint_states", JointState, callback_pos)
def callback_pos(data):
print "Position: ", data.position
def listener():
rospy.init_node('listener', anonymous=True)
rospy.Subscriber("joint_trajectory_action/result", FollowJointTrajectoryActionResult, callback)
rospy.spin()
if __name__ == '__main__':
listener()
Thanks 4 help