DroneResponse / hardware-tests

0 stars 2 forks source link

The pilot must arm the drone before a flying test can proceed #13

Closed murphym18 closed 2 years ago

murphym18 commented 2 years ago

We're concerned about accidentally disarming mid-flight. This seems likely in case the pilot takes control from the companion computer.

The Problem

When the companion computer arms the drone, the arm/disarm toggle switch on the RC unit never leaves the disarm position. This has been fine so far because PX4 won't disarm while in offboard mode. But in some human-piloting modes like stabilized and manual mode PX4 will disarm mid-flight (this behavior is documented here). By default, the drone will go into stabilized mode if the pilot takes control from the companion computer. So we need to make sure that switch is set to the armed position before takeoff.

The Solution

To address this, we need to change the box and hover tests. We need the pilot to arm the drone with the RC transmitter. The pilot would do so in the usual way (the drone is armed by moving the toggle switch to the armed position and then doing a stick gesture).

So when the hover or box tests start, they will

  1. wait for the user to put the RC transmitter in the right state (where channel 5 is between 1320 and 1480 and channel 8 is less than 1500)
  2. check the pre-flight parameters
  3. wait for the pilot to arm the drone using the RC transmitter
  4. sleep for a few seconds
  5. takeoff
  6. continue with the test...

Thank you @n-snyder for pointing out this issue!

Edit: here the Prearm, Arm, Disarm Configuration guide.

murphym18 commented 2 years ago

Good news, everything worked as expected when I ran the hover and box tests. I ran the tests on my laptop and connected to PX4 over WiFi.

However, I ran both tests with the following modifications:

murphym18 commented 2 years ago

Here are some more details about the SD-HX10's RC configuration.

PX4 is configured to arm or disarm using a switch. The RC unit is programmed to send the arm signal when the pilot moves a switch and does a stick gesture.

murphym18 commented 2 years ago

Ok I tested it on the aero. I think this code is good to go!

Thanks again @n-snyder !