6 from std_msgs.msg
import Header, Float32MultiArray, Int16MultiArray
7 from riptide_controllers.msg
import ThrusterTestAction
17 THRUSTER_PERCENT = 0.05
20 self.
pwm_pub = rospy.Publisher(
"command/pwm", Int16MultiArray, queue_size=5)
23 with open(rospy.get_param(
'~vehicle_config'),
'r')
as stream:
32 msg = Int16MultiArray()
33 msg.data = list(pwm.astype(int))
37 rospy.loginfo(
"Starting ThrusterTest Action")
41 if self.
_as.is_preempt_requested():
42 rospy.loginfo(
'Preempted ThrusterTest Action')
44 self.
_as.set_preempted()
47 thruster_type = self.
vehicle_file[
"thrusters"][i][
"type"]
49 if thruster_type == 0:
62 rospy.loginfo(
"ThrustTest succeeded")
63 self.
_as.set_succeeded()
65 if __name__ ==
'__main__':
66 rospy.init_node(
'thruster_test')