Automatically Raise and Lower Landing Gear


I’m looking for information about how to get my aircraft to automatically deploy landing gear when it is landing in an autonomous mission.

The aircraft has a Pixhawk 6C onboard and is using the Standard Plane configuration. It flies well without any tuning and I was able to fly my first autonomous mission recently. However, the landing gear failed to deploy and the aircraft belly landed. There was some damage but nothing a little duct tape and CA glue couldn’t fix. :smiley:

In manual mode I can raise and lower the landing gear with a switch on my RC controller which I have set up with channel 6.

It isn’t clear to me if the standard plane airframe supports retracts or not. I have done some searching in the forums, documentation, and the source code but haven’t been able to figure it out yet. Any tips on this subject to help me narrow down the search space would be appreciated.



After a deeper dive into the software and the documentation I see that the landing_gear uORB message is published by the flight_mode_manager and that the value GEAR_UP is set in FlightTaskAuto::update() if the altitude above ground is greater than 2 meters. GEAR_DOWN is set in FlightTaskAuto::_prepareLandSetpoints(). It appears that _prepareLandSetpoints() is invoked for landing waypoints in mission mode.

According to the Control Allocation (Mixing) | PX4 User Guide page Actuator Control Pipeline diagram, the output PWM drivers subscribe to the landing_gear topic.

The uORB Publication/Subscription Graph | PX4 User Guide page shows these publication/subscription connections as well.

I checked my .ulog file with PlotJuggler for the landing_gear message. When I search landing_gear I get the following.


The values of these setpoints were always 0 in the time series. It isn’t clear to me yet if this is the value of the landing_gear topic or something else related to landing gear. I was not expecting landing_gear to be part of the position_setpoint_triplet.

Searching the actuator_controls_0 topic, it is clear that group 0 (attitude) index 7 (landing gear) is always set to zero, which means that the gear will not deploy. You can see that control index 4 (flaps) goes to 1 immediately before landing, so flaps were working.

I think this implies that the standard plane airframe does not support landing gear. I don’t see any parameters in airframes/2100_standard_plane related to landing gear either. The next step is to figure out how to modify the configuration so that PX4 knows that the airframe has landing gear and which PWM channels and drives to use for GEAR_DOWN and GEAR_UP.

Hello @sastel. Did you find a solution to this one yet? I am currently finding the same issue in SITL for fixed wing - leads me to the same conclusion that landing gear control / actuation is currently not supported in PX4 for fixed wing… I’m thinking I may need to look at using “manual” mission items to control PWM at specific times for the landing gear as an interim solution - but I’m keen to hear what solution you have come to…

Hi @Jono. I have been too busy to look at it since my last post.

Automatically raising and lowering the landing gear is supported in the software, however, the standard plane airframe is configured for pass through of the remote control gear switch.

The standard plane airframe used the AETRFG (Aileron Elevator Throttle Rudder Flaps Gear) mixer which is in ROMFS/px4fmu_test/mixers/AETRFG.main.mix in v1.13.0-beta2. If you look at the mixer file you will see that it is configured for manual pass-through and not automatic control.

The old mixing method (which is described in Mixing and Actuators | PX4 User Guide) has recently been replaced by control allocation (link in my previous post).

Once I have more time to look at this my plan is to build the latest version of source code, and to configure the control allocator for my aircraft.

Please let me know if you manage to figure it out before I get to it. :smiley:

Hi @sastel , Ok no problem - thanks for that reply. I have also been diverted onto another project but will get back to this soon. I have historically played around with the traditional mixer file, but am now just coming to terms with the new mixing method and its limitations - the problems I have been having relate to the latest build and the new mixing method. I will certainly share anything I find here as well (you do the same too!).

Keep in touch,