# BlueROV2 lamp and camera tilt does not work with RC input

**URL:** https://discuss.bluerobotics.com/t/bluerov2-lamp-and-camera-tilt-does-not-work-with-rc-input/10103
**Category:** QGroundControl
**Tags:** ardusub, pymavlink
**Created:** [July 6, 2021, 3:50pm UTC](https://discuss.bluerobotics.com/t/bluerov2-lamp-and-camera-tilt-does-not-work-with-rc-input/10103 "2021-07-06T15:50:58Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)
#### Post date: [July 8, 2021, 5:22am UTC](https://discuss.bluerobotics.com/t/bluerov2-lamp-and-camera-tilt-does-not-work-with-rc-input/10103/2 "2021-07-08T05:22:32Z")

</div>

# RC Inputs/Outputs

> [@Brandonyxf](#):
>
> I tried the code
> 
> ```auto
> set_rc_channel_pwm(8, 1900)
> 
> ```
> 
> and
> 
> ```auto
> set_rc_channel_pwm(7, 1900)
> 
> ```
> 
> I also tried ’ Control Camera Gimbal’ in the manual [‘http://www.ardusub.com/developers/pymavlink.html’](http://www.ardusub.com/developers/pymavlink.html)  
> still, nothing happened.
> 
> I check the Qgroundcontrol, where the channel of the lamp is 7 and camera tilt is 8.

This seems like you’ve got your [RC Inputs and Outputs](https://www.ardusub.com/developers/rc-input-and-output.html) confused. The Lights and Camera pages on QGC are specifying the **RC Output** (servo) channels (the physical Pixhawk ports that things are plugged into), which by default are 7 (lights 1) and 8 (camera tilt) respectively. The **RC Inputs** are instead to do with some of the control commands related to the joystick inputs, for which the defaults are 8 (camera tilt) and 9 (lights 1 level).

## Camera Tilt Sweep with Speed

In saying that, the ‘camera tilt’ functionality there is a bit misleading (and poorly documented). Our [Send RC (Joystick)](https://www.ardusub.com/developers/pymavlink.html#send-rc-joystick) example sets the camera tilt RC Input channel (8) to 1900 pwm, and specifies that it sets camera tilt to 45^{\text{o}} with full speed. I’ve just spent some time figuring out what that means, and apparently **the ‘pwm’ value** that gets set here **determines the speed for a sweep from the current tilt angle to \pm45^{\text{o}}**. The way that works is that 1500 is the ‘zero’ speed setting (do nothing, go nowhere), and 1100 is ‘full speed to -45^\text{o}’, while 1900 is ‘full speed to +45^\text{o}’. As some pointers:

- Anything above 1500 will always go all the way to +45^\text{o}, but 1700 will do so at seemingly half the speed that 1900 would. The same applies for the opposite direction (1100 is about double the speed of 1300, and 1499 is **incredibly** slow).
- If the camera is already at one of the extremes then additional signals to the same side do nothing (e.g. if the tilt angle is currently -45^\text{o} then `rc_channels_override_send(8, 1100)` will go full-speed to where it already is, so it won’t move).
- The latest command is the one that is acted on, so if you do one call for `rc_channels_override_send(8, 1300)` and then when it’s partway there you do another call for `rc_channels_override_send(8, 1100)` then it will change to full speed the rest of the way to -45^\text{o}.
- you may need to run the following command between your `wait_heartbeat` and your first  
`set_rc_channel_pwm` call, to configure the mount controls to RC mode:

```python
    master.mav.mount_configure_send(
        master.target_system,
        master.target_component, 
        mavutil.mavlink.MAV_MOUNT_MODE_RC_TARGETING, 
        0, 0, 0)

```

- I’m not sure how ‘full speed’ is set/determined, but it’s not the full speed of the servo (see below)

# Setting Camera Mount Angle

It’s also possible to directly set the camera mount tilt angle instead of doing a smooth camera sweep to one of the extents. That’s what our [Control Camera Gimbal](https://www.ardusub.com/developers/pymavlink.html#control-camera-gimbal) example does, and any tilt angle you set there is moved to as fast as the servo can, which is considerably faster than the `set_rc_channel_pwm` tilt sweep, but that also means you can’t really see any image details in the brief period where the servo is moving (the frames get too much motion blur).

There’s also a slightly simpler command for mount control:

```python
master.mav.mount_control_send(
    master.target_system,
    master.target_component,
    tilt, # cdeg, -4500 to 4500
    0, # roll cdeg
    0, # pan cdeg
    0) # save_position (not used)

```

but if you’ve been using RC control beforehand then you’ll need to explicitly set the camera mount to mavlink mode (instead of RC mode) before the `mount_control_send` commands will work:

```auto
master.mav.mount_configure_send(
    master.target_system,
    master.target_component, 
    mavutil.mavlink.MAV_MOUNT_MODE_MAVLINK_TARGETING, 
    0, 0, 0)

```

# Lights

You can control the lights using either `set_rc_channels_pwm(9, pwm)`, or `master.set_servo(7, pwm)` assuming your lights are plugged in to MAIN OUT 7 of the Pixhawk. There shouldn’t be requirement to set a mode or anything for either of those approaches - if you have a valid connection to your autopilot they should work.

# QGC Error: Missing Parameters

> [@Brandonyxf](#):
>
> It also gave me warning in the yellow box.
> 
> ![Screenshot from 2021-07-01 17-29-27](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/2/28867baeb68116397b216448f96e0bdce25dfb62.png)

Which versions of QGroundControl and ArduSub are you using? “Missing Parameters” means that some of the parameters QGroundControl is expecting are missing from your installed ArduSub firmware, which is either because your QGroundControl version is very new (includes added parameters that don’t exist in ArduSub), or your ArduSub version is very old (some parameters that did exist have been renamed).

---

_[View the full topic](https://discuss.bluerobotics.com/t/bluerov2-lamp-and-camera-tilt-does-not-work-with-rc-input/10103)._
