5 from marty_msgs.msg
import ServoMsg, ServoMsgArray
8 pub = rospy.Publisher(
'/marty/servo_array', ServoMsgArray, queue_size=10)
9 rospy.init_node(
'servo_test', anonymous=
True)
11 servo_cmd_array = ServoMsgArray()
12 servo_cmd_1 = ServoMsg()
13 servo_cmd_2 = ServoMsg()
14 servo_cmd_1.servo_id = 0
15 servo_cmd_1.servo_cmd = 60
16 servo_cmd_2.servo_id = 8
17 servo_cmd_2.servo_cmd = 0
18 servo_cmd_array.servo_msg.append(servo_cmd_1)
19 servo_cmd_array.servo_msg.append(servo_cmd_2)
22 while not rospy.is_shutdown():
24 pub.publish(servo_cmd_array)
28 if __name__ ==
'__main__':
31 except rospy.ROSInterruptException: