Skip to content

Commit

Permalink
use mavros arming service to arm
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasAntener committed Feb 28, 2015
1 parent 7fb82e7 commit 5706e1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integrationtests/demo_tests/mavros_offboard_posctl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from std_msgs.msg import Header
from geometry_msgs.msg import PoseStamped, Quaternion
from tf.transformations import quaternion_from_euler
from mavros.srv import CommandBool

class OffboardPosctlTest(unittest.TestCase):

Expand All @@ -57,6 +58,7 @@ def setUp(self):
rospy.Subscriber('px4_multicopter/vehicle_control_mode', vehicle_control_mode, self.vehicle_control_mode_callback)
rospy.Subscriber("px4_multicopter/mavros/position/local", PoseStamped, self.position_callback)
self.pubSpt = rospy.Publisher('px4_multicopter/mavros/setpoint/local_position', PoseStamped, queue_size=10)
self.cmdArm = rospy.ServiceProxy("px4_multicopter/mavros/cmd/arming", CommandBool)
self.rate = rospy.Rate(10) # 10hz
self.hasPos = False

Expand Down Expand Up @@ -111,10 +113,15 @@ def reach_position(self, x, y, z, timeout):

self.assertTrue(count < timeout, "took too long to get to position")

def arm(self):
return self.cmdArm(value=True)

#
# Test offboard POSCTL
#
def test_posctl(self):
self.assertTrue(self.arm(), "Could not arm")

# prepare flight path assertion
positions = (
(0,0,0),
Expand Down

0 comments on commit 5706e1d

Please sign in to comment.