# Which channel controls the gain?

**URL:** <https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475>\
**Category:** Blue Robotics Software\
**Created:** [February 27, 2019, 6:12pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475 "2019-02-27T18:12:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![LudoDrone](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LudoDrone](https://discuss.bluerobotics.com/u/LudoDrone)\
**Post date:** [February 27, 2019, 6:12pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/1 "2019-02-27T18:12:34Z")

</div>

Dear all,

I want to control my bluerov in Manual mode using channel override, but I can’t find the Channel that increase/decrease the gain. On the logitech joystick it is mapped to the up/down arrow, but I can’t see which channels are modified on the Analyze tool of QGroundControl.

Is there a diagram showing the full mapping of channel/button somewhere? If that isn’t mapped on an RC channel, how can I change it programmatically (using the usual libraries such as pymavlink, DroneKit or mavros)?

Thank you all!

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [February 27, 2019, 6:23pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/2 "2019-02-27T18:23:42Z")

</div>

Gain is adjusted via a [button function](https://www.ardusub.com/operators-manual/full-parameter-list.html#btnn-parameters). The [MANUAL\_CONTROL](https://mavlink.io/en/messages/common.html#MANUAL_CONTROL) message must be used.

---

<div class="post-metadata">

**Author:** ![olaya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/olaya/32/1671_2.png) [@olaya](https://discuss.bluerobotics.com/u/olaya)\
**Post date:** [February 17, 2020, 3:42pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/3 "2020-02-17T15:42:20Z")

</div>

Hi all!

Regarding this question, it is not clear to me how to change the gain from mavros just as we do from QGroundControl.

I’m using bluerov\_ros\_playground package, and I want to modify it to add the functionality of changing the gain. This raises two questions for me:

1. Since the manual\_control message has pitch, yaw, etc. parameters, would it conflict with the rc\_override message used to command the robot?

2. How’s the button function (BTNn\_SFUNCTION) , related with the manual\_control message? There are axis fields and a buttons field. But it seems to only publish the state of the buttons. Or maybe it is that you have to write the value of the BTNn\_SFUNCTION command ( f.e. 42 for increasing the gain) on the ‘buttons’ field of MANUAL\_CONTROL?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [February 18, 2020, 12:35pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/4 "2020-02-18T12:35:06Z")

</div>

Hi Olaya,

> [@olaya](#):
>
> Since the manual\_control message has pitch, yaw, etc. parameters, would it conflict with the rc\_override message used to command the robot?

You can use MANUAL\_CONTROL to do what you want, ArduSub converts it to rc\_override:

> <https://github.com/ArduPilot/ardupilot/blob/741c467f0350202ab9d87906701c8bb4d78f2fc9/ArduSub/joystick.cpp#L54-L140>

> [@olaya](#):
>
> How’s the button function (BTNn\_SFUNCTION) , related with the manual\_control message?

This is done here:

> <https://github.com/ArduPilot/ardupilot/blob/741c467f0350202ab9d87906701c8bb4d78f2fc9/ArduSub/joystick.cpp#L142-L587>

---

<div class="post-metadata">

**Author:** ![olaya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/olaya/32/1671_2.png) [@olaya](https://discuss.bluerobotics.com/u/olaya)\
**Post date:** [February 19, 2020, 4:07pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/5 "2020-02-19T16:07:10Z")

</div>

Hi Patrick, thanks for your answer.

So, If I want to change the gain from pymavlink, I have to push the button in the joystick that I previously assigned to the change of gain (from QGroundControl), and then just send a MANUAL\_CONTROL message to the BlueROV with the state of the buttons?

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [February 23, 2020, 1:24am UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/6 "2020-02-23T01:24:20Z")

</div>

Hi Olaya,

You only need to fill `buttons` field of `MANUAL_CONTROL` with the correct bit set for you gain.  
Check our [pymavlink Send Manual Control example](https://www.ardusub.com/developers/pymavlink.html#Send%20Manual%20Control).

---

<div class="post-metadata">

**Author:** ![olaya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/olaya/32/1671_2.png) [@olaya](https://discuss.bluerobotics.com/u/olaya)\
**Post date:** [February 25, 2020, 6:04pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/7 "2020-02-25T18:04:15Z")

</div>

Thank you Patrick,  
That worked as you said 😀

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [March 2, 2020, 11:00pm UTC](https://discuss.bluerobotics.com/t/which-channel-controls-the-gain/4475/8 "2020-03-02T23:00:09Z")

</div>

Closed on March 2, 2020, 11:00pm UTC

This topic was automatically closed after 6 days. New replies are no longer allowed.
