PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

RC Switch and Button support and refactor

Open junwoo091400 opened this issue 2 years ago • 9 comments

Describe problem solved by the proposed feature Currently, PX4 doesn't support the following setup :

  • Having one channel in RC configured for flight mode selection (e.g. Low : Position / High : Follow Me mode)
  • Having an RTL button for activating Return To Launch by just pressing on the button once.

As the PX4 only considers 'Switches' (where you need to keep the RC signal state fixed, opposed to buttons which only changes signal momentarily), it's impossible to have the Button setup. Meaning, I need to be keep on pressing the RTL button for the RTL to stay activated throughout the RTL maneuver.

Describe your preferred solution A clear and concise description of what you want to happen.

Describe possible alternatives A clear and concise description of alternative solutions or features you've considered.

Additional context Testing on the Mantis drone RC controller. Which has RTL button on lower-left and Flight mode button on lower-right.

image

FYI @dagar @MaEtUgR

junwoo091400 avatar Mar 16 '22 17:03 junwoo091400

So buttons do work in some cases if you can configure your controller appropriately. For example with the radiomaster tx16 the buttons aren't momentary and instead latch and light up once the button is selected. That way it sort of acts like a switch. Since it seems like you can't configure your controller, I suggest looking at how the kill-switch works since it executes a permanent action on a momentary pulse.

benjinne avatar Mar 18 '22 17:03 benjinne

Thanks for your input! Yes I will check how that works :)

junwoo091400 avatar Mar 29 '22 21:03 junwoo091400

Initial support and Unit tests being added here by @MaEtUgR : https://github.com/PX4/PX4-Autopilot/tree/rc-mode-switch-and-button

junwoo091400 avatar May 03 '22 20:05 junwoo091400

/bounty $0

junwoo091400 avatar Nov 05 '23 09:11 junwoo091400

/bounty $0.1

junwoo091400 avatar Nov 05 '23 09:11 junwoo091400

/bounty $1

junwoo091400 avatar Nov 05 '23 09:11 junwoo091400

💎 $1 bounty • PX4 Autopilot

Steps to solve:

  1. Start working: Comment /attempt #19341 with your implementation plan
  2. Submit work: Create a pull request including /claim #19341 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to PX4/PX4-Autopilot!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @junwoo091400 #19638

algora-pbc[bot] avatar Nov 05 '23 09:11 algora-pbc[bot]

💡 @junwoo091400 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Nov 05 '23 09:11 algora-pbc[bot]

This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-maintainers-call-november-07-2023/35031/1

DronecodeBot avatar Nov 07 '23 09:11 DronecodeBot