6 from control_msgs.msg
import (
7 FollowJointTrajectoryAction,
8 FollowJointTrajectoryGoal
10 from trajectory_msgs.msg
import JointTrajectoryPoint
17 FollowJointTrajectoryAction)
18 self.
__client.wait_for_server(rospy.Duration(5.0))
19 if not self.
__client.wait_for_server(rospy.Duration(5.0)):
20 rospy.logerr(
"Action Server Not Found")
21 rospy.signal_shutdown(
"Action Server not found")
27 goal = FollowJointTrajectoryGoal()
28 goal.trajectory.joint_names = [
"neck_yaw_joint",
"neck_pitch_joint"]
29 yawpoint = JointTrajectoryPoint()
34 yawpoint.time_from_start = rospy.Duration(nsecs=1)
35 goal.trajectory.points.append(yawpoint)
37 self.
__client.wait_for_result(rospy.Duration(0.1))
40 if __name__ ==
'__main__':
41 rospy.init_node(
"neck_test")
45 pitch = float(sys.argv[1])
48 np.set_angle(math.radians(0.0), math.radians(-60.0))
50 np.set_angle(math.radians(0.0), math.radians(50.0))
52 np.set_angle(math.radians(0.0), math.radians(0.0))
54 np.set_angle(math.radians(-90.0), math.radians(0.0))
56 np.set_angle(math.radians(80.0), math.radians(0.0))
58 np.set_angle(math.radians(0.0), math.radians(0.0))
def set_angle(self, yaw_angle, pitch_angle)