Conversation
406dd1c to
591956d
Compare
* Similar to set_actuator Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
|
Cool, thanks! However, you have to do the change in https://github.com/mavlink/MAVSDK-Proto first and then run the generation, and then add your implementation. Also see: https://mavsdk.mavlink.io/main/en/cpp/contributing/plugins.html#add-api-to-proto |
Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
|
I had one CI error. I needed to run |
|
Thanks @Ryanf55. Can you just confirm what value "toggle" is? Is it 2? I would like to make the mavlink PR and then update the docs here accordingly. |
For ArduPilot, any value other than 0 and 1 is considered a toggle. |
|
I just thought it's a good time to do the spec work before we forget about it again. I couldn't actually see the source for toggle in Mission Planner, but I did see the I understand you want to get this PR in ASAP but you have to understand that as a MAVSDK maintainer I don't have the same urgency. If you need it right now, you can already fire of the command with MavlinkPassthrough or MavlinkDirect by the way. |
|
Ok. Of note, QGC only supports 0 and 1 as values. I can find time to test mission planner and check the MAVLink inspector to see what value it is using as toggle. |
|
Ok, so this was a false herring. Should we just make it an easy boolean then to set 0 or 1? I usually want the API surface with MAVSDK to be as small as possible instead of open ended interfaces that we tend to have in MAVLink. |
What do you think about an enum enum RelayState { Then we can add toggle later without breaking ABI. |
|
Perfect |
494c31e to
d0fc285
Compare
|
|
@Ryanf55 I hope you're ok that I took this over and pushed it over the finish line. |
|
The latest changes look good, thanks for finishing that up over the weekend!
…On Wed, Jan 21, 2026 at 6:47 PM Julian Oes ***@***.***> wrote:
*julianoes* left a comment (mavlink/MAVSDK#2750)
<#2750 (comment)>
@Ryanf55 <https://github.com/Ryanf55> I hope you're ok that I took this
over and pushed it over the finish line.
—
Reply to this email directly, view it on GitHub
<#2750 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF7DFDYLH3SY2ETXRNEIDEL4IAT2JAVCNFSM6AAAAACRSLY3Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOBSGAZTONBQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|





Purpose
Implement an action for MAV_CMD_DO_SET_RELAY
Testing Performed
Tested with ArduPilot 4.6 on CubeOrangePlus, verified with a logic analyzer that MainOut1 goes high/low when commanded.
Related Documentation
https://ardupilot.org/copter/docs/common-relay.html
Details
I copied all the code from set_actuator. Only difference is the 2nd parameter is also an int.
Demo
Follow up
It would be good to add some unit test coverage for the actuator and relay code. I'm happy to do that in another PR.