Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
rotorcraft_cam.c File Reference

Camera control module for rotorcraft. More...

+ Include dependency graph for rotorcraft_cam.c:

Go to the source code of this file.

Macros

#define ROTORCRAFT_CAM_ON   gpio_set
 Gpio output to turn camera power power on. More...
 
#define ROTORCRAFT_CAM_OFF   gpio_clear
 Gpio output to turn camera power power off. More...
 
#define _SERVO_PARAM(_s, _p)   SERVO_ ## _s ## _ ## _p
 
#define SERVO_PARAM(_s, _p)   _SERVO_PARAM(_s,_p)
 
#define ROTORCRAFT_CAM_PAN_MIN   0
 
#define ROTORCRAFT_CAM_PAN_MAX   INT32_ANGLE_2_PI
 

Functions

static void send_cam (struct transport_tx *trans, struct link_device *dev)
 
void rotorcraft_cam_set_mode (uint8_t mode)
 
void rotorcraft_cam_init (void)
 
void rotorcraft_cam_periodic (void)
 

Variables

uint8_t rotorcraft_cam_mode
 WP control. More...
 
int16_t rotorcraft_cam_tilt
 
int16_t rotorcraft_cam_tilt_pprz
 
int16_t rotorcraft_cam_pan
 

Detailed Description

Camera control module for rotorcraft.

The camera is controled by the heading of the vehicle for pan and can be controlled by a servo for tilt if defined.

Four modes:

  • NONE: no control
  • MANUAL: the servo position is set with PWM
  • HEADING: the servo position and the heading of the rotorcraft are set with angles
  • WP: the camera is tracking a waypoint (Default: CAM)

If ROTORCRAFT_CAM_SWITCH_GPIO is defined, this gpio is set/cleared to switch the power of the camera on in normal modes and disable it when in NONE mode. On boards with CAM_SWITCH, ROTORCRAFT_CAM_SWITCH_GPIO can be defined to CAM_SWITCH_GPIO.

Definition in file rotorcraft_cam.c.

Macro Definition Documentation

◆ _SERVO_PARAM

#define _SERVO_PARAM (   _s,
  _p 
)    SERVO_ ## _s ## _ ## _p

Definition at line 71 of file rotorcraft_cam.c.

◆ ROTORCRAFT_CAM_OFF

#define ROTORCRAFT_CAM_OFF   gpio_clear

Gpio output to turn camera power power off.

Control whether to set or clear the ROTORCRAFT_CAM_SWITCH_GPIO to turn off the camera power. Should be defined to either gpio_set or gpio_clear (default). Not used if ROTORCRAFT_CAM_SWITCH_GPIO is not defined.

Definition at line 66 of file rotorcraft_cam.c.

◆ ROTORCRAFT_CAM_ON

#define ROTORCRAFT_CAM_ON   gpio_set

Gpio output to turn camera power power on.

Control whether to set or clear the ROTORCRAFT_CAM_SWITCH_GPIO to turn on the camera power. Should be defined to either gpio_set (default) or gpio_clear. Not used if ROTORCRAFT_CAM_SWITCH_GPIO is not defined.

Definition at line 57 of file rotorcraft_cam.c.

◆ ROTORCRAFT_CAM_PAN_MAX

#define ROTORCRAFT_CAM_PAN_MAX   INT32_ANGLE_2_PI

Definition at line 85 of file rotorcraft_cam.c.

◆ ROTORCRAFT_CAM_PAN_MIN

#define ROTORCRAFT_CAM_PAN_MIN   0

Definition at line 84 of file rotorcraft_cam.c.

◆ SERVO_PARAM

#define SERVO_PARAM (   _s,
  _p 
)    _SERVO_PARAM(_s,_p)

Definition at line 72 of file rotorcraft_cam.c.

Function Documentation

◆ rotorcraft_cam_init()

void rotorcraft_cam_init ( void  )

◆ rotorcraft_cam_periodic()

◆ rotorcraft_cam_set_mode()

void rotorcraft_cam_set_mode ( uint8_t  mode)

Definition at line 93 of file rotorcraft_cam.c.

References mode, rotorcraft_cam_mode, ROTORCRAFT_CAM_MODE_NONE, ROTORCRAFT_CAM_OFF, and ROTORCRAFT_CAM_ON.

Referenced by rotorcraft_cam_init().

+ Here is the caller graph for this function:

◆ send_cam()

static void send_cam ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 87 of file rotorcraft_cam.c.

References dev, rotorcraft_cam_pan, and rotorcraft_cam_tilt.

Referenced by rotorcraft_cam_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ rotorcraft_cam_mode

uint8_t rotorcraft_cam_mode

WP control.

By default use WP_CAM waypoint if defined

Definition at line 69 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_periodic(), and rotorcraft_cam_set_mode().

◆ rotorcraft_cam_pan

int16_t rotorcraft_cam_pan

Definition at line 83 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), rotorcraft_cam_periodic(), and send_cam().

◆ rotorcraft_cam_tilt

int16_t rotorcraft_cam_tilt

Definition at line 75 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), rotorcraft_cam_periodic(), and send_cam().

◆ rotorcraft_cam_tilt_pprz

int16_t rotorcraft_cam_tilt_pprz

Definition at line 76 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), and rotorcraft_cam_periodic().