# Using MAVLink actions to control Servo Outputs

**URL:** <https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771>\
**Category:** Cockpit\
**Tags:** cockpit\
**Created:** [October 22, 2026, 4:21pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771 "2026-10-22T16:21:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jf5900](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jf5900](https://discuss.bluerobotics.com/u/jf5900)\
**Post date:** [October 22, 2026, 4:21pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/1 "2026-10-22T16:21:23Z")

</div>

Continuing the discussion from [Controlling a vehicle motion axis with controller triggers](https://discuss.bluerobotics.com/t/controlling-a-vehicle-motion-axis-with-controller-triggers/21096):

I linked this post because it is a similar issue and approach as to what I’m trying to figure out. For reference I’m using Cockpit (1.18.4) on a Raspberry Pi 3 on a Pixhawk 4. I currently am using BlueOS 1.4.7 with no other altered components. I use the desktop version of Cockpit compared to the BlueOS extension.

Right now, I’m trying to create a MAVLink action through Cockpit that controls Servo 5 and 6 when I press the LT and RT buttons. I have linked the .json file (as a .txt) for reference. I’ve spent about a week changing values but nothing seems to work. My Servo 5 and Servo 6 functions are set to RC Pass Through, and the variable {{SERVO\_5\_PWM}} is a compound variable that has a range of 1100 to 1900 with a resting value of 1500.

[mavlink-message-action (Servo 5 Up).txt](https://discuss.bluerobotics.com/uploads/short-url/x269LlQRU4XrqpxVKNPW0clMlj3.txt) (1.6 KB)

When reviewing the MAVLink inputs/outputs, the COMMAND\_LONG renders the command I’m sending, and the COMMAND\_ACK gives me a message saying that the command was accepted, BUT when look at the SERVO\_OUTPUT\_RAW, there is no incoming or Outgoing Messages. As a matter of fact, I don’t get anything from the SERVO\_OUTPUT\_RAW when I control the other motors through RCIN outputs.

[COMMAND\_ACK (Incoming Message).txt](https://discuss.bluerobotics.com/uploads/short-url/ZUk9zcuAfzATQbS4NQ0SfeC9ag.txt) (233 Bytes)

I’ve tried everything, and couldn’t come up with anything new to try so I decided to put it on the forum.

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [October 22, 2026, 6:37pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/2 "2026-10-22T18:37:11Z")

</div>

Hi @jf5900 -  
Welcome to the forums!  
What do you have connected to output 5 & 6? Are these vertical thrusters, or some other device you’re trying to control? What is your goal here - to control roll or something else?

I believe your issue is due to setting the Servo\_Function incorrectly. Instead of RC Pass Through, set the function to Disabled, and then DO\_SET\_SERVO via custom actions can control the output. Each trigger will send commands when activated, which will modify the output.

If you’re trying to control vehicle motion in this way, another approach entirely is required!

Worth noting that you’re running on legacy hardware, and you may have performance issues as BlueOS continues to develop!

---

<div class="post-metadata">

**Author:** ![jf5900](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jf5900](https://discuss.bluerobotics.com/u/jf5900)\
**Post date:** [October 23, 2026, 4:30pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/3 "2026-10-23T16:30:40Z")

</div>

Hey @tony-white

I have vertical thrusters connected to output 5 & 6. My goal is to just have them activate and deactivate depending on what button I press. I don’t really care how, but every attempt so far has not worked in my favor.

I believe that you are right about having to disable the Servo5\_Function, but when I disable it and reboot the AutoPilot, it resets the value to Motor5 (Same issue for Servo6). I couldn’t find anywhere that said why this happened, but I’m assuming that since it is a standard Servo motor, it is asusming that it needs a standard default, and that disabling it is not an option. Also, for the custom action Command ID, I type “MAV\_CMD\_DO\_SET\_SERVO”, right? Or do I just say “DO\_SET\_SERVO”.

I am trying to control vehicle motion, and I would be interested in learning what approach I have to take, because clearly the approaches I’ve taken so far are not the right ones.

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [October 24, 2026, 6:37pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/4 "2026-10-24T18:37:59Z")

</div>

Hi @jf5900 -  
Controlling motor outputs is a completely different problem, and thats why your attempts thus far have not been sucessful. This is because you were interfering with the autopilot’s ownership of those motors! By controlling the vertical thrusters, you influence both depth and roll. That is currently controlled by the vertical joystick axis (ascent/descent) or by adjusting the roll trim. It may be possible to map the roll axis to those triggers, or your depth control, but doing both would be a bit strange?  
When in Stabilize or Depth hold mode, the situation is further complicated by the autopilots need to run the motors to maintain depth and a level orientation… are you trying to do this type of control only in manual mode?

Can you share what is motivating you to want to control the vehicle in this way?

---

<div class="post-metadata">

**Author:** ![jf5900](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jf5900](https://discuss.bluerobotics.com/u/jf5900)\
**Post date:** [October 26, 2026, 4:11pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/5 "2026-10-26T16:11:06Z")

</div>

Hi @tony-white

I was trying to create this manual control action because the BlueROV2 would not do anything until I set the motor functions to RCIN values, which meant that I needed more joysticks to control all the motors. So instead, I set the back trigger to control it, which hasn’t been working, as you said earlier. When I’ve read the threads on here, I don’t understand how people can just control the BlueROV2, because I had to change the motor functions from “Motor #” to an RCIN function. Am I missing something or is there an error because I’m using the Legacy hardware?

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [October 26, 2026, 4:41pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/6 "2026-10-26T16:41:05Z")

</div>

Hi @jf5900 -  
When you say

> [@jf5900](#):
>
> would not do anything until I set the motor functions to RCIN values

Do you mean that you couldn’t operate the ROV at all until making those changes? Servo 5 and 6 should be vertical thrusters (motor # function) - did you [load the default parameters](https://blueos.cloud/docs/latest/usage/advanced/#parameters) for the BlueROV2?

Controlling the ROV movement is accomplished with the two joysticks by default - heading and depth on the right stick, and position fwd/backwards / left/right on the left stick (mode3 layout.) Is there some reason this approach doesn’t work for you?

You aren’t technically using legacy hardware if you’re using a Pixhawk 4!

If you can provide more context on your goals for the vehicle, we can better recommend what settings to configure.

---

<div class="post-metadata">

**Author:** ![jf5900](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jf5900](https://discuss.bluerobotics.com/u/jf5900)\
**Post date:** [October 28, 2026, 4:37pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/7 "2026-10-28T16:37:22Z")

</div>

Hey @tony-white

To answer your first question, there was no motor movement until I changed the Servo functions to RCIN. I was looking through the BlueOS interface like you said, but when I came across the “Load Recommended Parameter Sets,” there was nothing there.

Would resetting all parameters do the same thing? I don’t have anything important in the parameters, so I wouldn’t mind resetting them if it would help my case.

 ![Screenshot 2026-10-28 123301](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/3X/3/c/3cf9fe8908916d9116e50a599fdbceca3e6c7d7b.png)

Also, I am using a Raspberry Pi 3 with the Pixhawk, so I think I would be using Legacy hardware.

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [October 28, 2026, 5:49pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/8 "2026-10-28T17:49:05Z")

</div>

Hi @jf5900 -  
The pixhawk may be the reason you don’t see any parameters listed there. If you go to the PWM outputs tab, does the vehicle shown match the frame type you’re using? Can you share a screenshot of how your thruster outputs are all mapped from that page?

I’m a bit confused by your answer - are you saying the vertical thrusters didn’t respond to the joystick until you changed them from motor to RCIN servo function?

After resetting all parameters, the button to load recommended for heavy or standard ROV may appear. Did you complete the BlueOS setup wizard? You can reach it from the settings gear in the lower left of BlueOS if not - it may be good to do before trying a reset.

You shared what version of BlueOS you were running, but not the ArduSub firmware version. Can you share that, found on the Autopilot Firmware page?

---

<div class="post-metadata">

**Author:** ![jf5900](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jf5900](https://discuss.bluerobotics.com/u/jf5900)\
**Post date:** [October 29, 2026, 4:31pm UTC](https://discuss.bluerobotics.com/t/using-mavlink-actions-to-control-servo-outputs/23771/9 "2026-10-29T16:31:17Z")

</div>

Hey @tony-white

I must have done something wrong when I first setup the BlueROV2 because after resetting the parameters it started working (Also just got Cockpit 1.19.0). I might have not armed it? But Idk for sure. It works now, and we’ll see where this takes me next.

Thanks for all the support in figuring this out, looking forward to see where Blue Robotics goes next!!
