uas-at-ucla / suas-23-24

Software/Vision operations for UAS@UCLA, 2023-2024. For a list of tasks, visit https://github.com/orgs/uas-at-ucla/projects/1
3 stars 0 forks source link

Research Auto-Arm Procedure #11

Closed nathanchan631 closed 12 months ago

nathanchan631 commented 1 year ago

Look into how PX4 does pre-arm checks and what requirements are needed for the drone to arm.

AidenW0ng commented 1 year ago

PX4 documentation (https://docs.px4.io/v1.13/en/flying/pre_flight_checks.html):

PX4 checks if any systems on the drone are inconsistent (gyroscope, GPS, position, etc). It also checks if the battery is usable as in the simulation I got a "Preflight Fail: Battery Unhealthy" message and was unable to arm. It seems that all of these except the battery problem can be fixed with a series of calibrations performed by the mavsdk.calibration class. Once everything is calibrated we can arm the drone using the mavsdk.action class command arm()

AidenW0ng commented 1 year ago

We can also check if the drone is armable using the mavsdk.telemetry.Health object and use the appropriate calibrations if is it not armable.

nathanchan631 commented 1 year ago

Looks good! You can implement code for arming into flight/main.py if it's short, and if it's longer, make a separate script under flight/src. Just make sure to test if it arms the plane using the sim. If arming fails, we want to pause execution until it's successful.