Setting up Joystick Button to Activate AUX1 For Turtle Mode
-
Looking to utilize the joystick functionality of PX4 to activate turtle mode, however joystick buttons cannot manipulate the RC Channels what-so-ever. I'm curious if anyone has found a solution to solve this or if a custom flight mode in PX4 will be necessary.
-
Hi @Jeremy-Frederick I'm not sure if we intended to support turtle mode via joystick or have tested this functionality out so I can't guarantee that this will satisfy what you are trying to accomplish, but from what I can see in the code the steps I listed below would be a good place to start. So to enable turtle mode you will need to:
-
Set up your joystick in QGC (In joystick tab select your joystick/controller and set up your channels, etc)
-
You can now press buttons on your joystick while running the command
px4-listener manual_control_input
to see which buttons provide a non-zero value in the aux1 or aux2 fields (Some of them might not! See image below for example of non-zero value, 512 here)
-
Once you know which buttons can be used (give a non-zero value when pressed), then enable turtle mode by setting the parameter MODAL_IO_MODE to either 1 or 2 (depending which aux channel you want to enable/control turtle mode). You may need to reboot your vehicle here!
-
Finally you will need to hold down one of the buttons while in turtle mode (unless you have a button/switch on your joystick that is not a momentary button/switch)
Aside from what I mentioned here, you could use this ELRS LED driver we have here on how we implemented a similar feature (LED bar controlled by buttons on a controller/joystick) as a reference for how you could implement the functionality you want if the steps here don't work for you.
If you haven't already seen this page you can find more info about turtle mode parameters on our tech docs.
-
-
Or, you can add this feature in PX4. but, this would take more time to implement