Ask Your Question
1

JointTrajectoryAction gives success status when robot is run-stopped [closed]

asked 2011-08-20 07:06:18 -0500

joschu gravatar image

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)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2012-08-03 12:39:39

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-08-03 12:39:28 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

That sounds like a bug.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-08-20 07:06:18 -0500

Seen: 214 times

Last updated: Aug 03 '12