JointTrajectoryAction gives success status when robot is run-stopped
When the (PR2) robot is run-stopped and clearly has the wrong joint angles, actionlib returns a success status for the action. (set_joints function prints "Success"). Is this a bug?
class Head:
def set_joints(self,pan,tilt,time_from_start=1.5,blocking=True):
traj = JointTrajectory()
traj.joint_names = ['head_pan_joint','head_tilt_joint']
traj.points.append(JointTrajectoryPoint(positions=(pan,tilt),time_from_start=rospy.Duration(time_from_start)))
controller = 'head_traj_controller'
client = actionlib.SimpleActionClient(find_action("/"+controller), JointTrajectoryAction)
client.wait_for_server()
g = JointTrajectoryGoal()
g.trajectory = traj
client.send_goal(g)
print "sent goal for controller",controller
if blocking:
try:
client.wait_for_result()
except KeyboardInterrupt:
client.cancel_goal()
raise
if client.get_state() == GoalStatus.SUCCEEDED:
print "Success"
else:
print "Failure"
elsewhere in code,
head = Head()
head.set_joints(0,.75)
Asked by joschu on 2011-08-20 07:06:18 UTC
Comments