12 _feedback = FollowJointTrajectoryFeedback()
13 _result = FollowJointTrajectoryResult()
18 rospy.logwarn(
"Started Dummy Joint Trajectory Action Server")
19 rospy.logwarn(
"If joint < 0, set aborted")
20 rospy.logwarn(
"If joint >= 100, set preempted")
25 if len(goal.trajectory.points) > 0
and len(goal.trajectory.points[0].positions) > 0:
26 position = goal.trajectory.points[0].positions[0] * 180 / math.pi
27 rospy.loginfo(
"Received {}".format(position))
31 rospy.logwarn(
"Set aborted")
32 self.
_result.error_code = FollowJointTrajectoryResult.GOAL_TOLERANCE_VIOLATED
35 rospy.logwarn(
"Set preempted")
36 self.
_result.error_code = FollowJointTrajectoryResult.SUCCESSFUL
39 self.
_result.error_code = FollowJointTrajectoryResult.SUCCESSFUL
43 rospy.logwarn(
"Set aborted")
44 self.
_result.error_code = FollowJointTrajectoryResult.SUCCESSFUL
47 text=
'Controller manager forced preemption.')
49 rospy.logwarn(
"Set preempted")
50 self.
_result.error_code = FollowJointTrajectoryResult.SUCCESSFUL
51 self.
_as.set_preempted(
53 text=
'Trajectory preempted')
55 self.
_result.error_code = FollowJointTrajectoryResult.SUCCESSFUL
56 self.
_as.set_succeeded(
58 text=
'Trajectory succeeded.')
61 rospy.logwarn(
"Set aborted")
62 self.
_result.error_code = FollowJointTrajectoryResult.PATH_TOLERANCE_VIOLATED
63 self.
_result.error_string =
'After validation, trajectory execution failed in the arm with sub error code SUB_ERROR_NONE'
66 rospy.logwarn(
"Set preempted")
67 self.
_result.error_code = FollowJointTrajectoryResult.PATH_TOLERANCE_VIOLATED
68 self.
_result.error_string =
'Trajectory execution failed in the arm with sub error code 55\nThe speed while executing\\n\ the trajectory was too damn high and caused the robot to stop.\n'
72 self.
_result.error_code = FollowJointTrajectoryResult.SUCCESSFUL
75 if __name__ ==
'__main__':
76 rospy.init_node(
'dummy_jta')
77 robot = rospy.get_param(
'~robot',
'pr2')