Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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_pwm
 
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

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

Definition at line 71 of file rotorcraft_cam.c.

#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.

Referenced by rotorcraft_cam_set_mode().

#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.

Referenced by rotorcraft_cam_set_mode().

#define ROTORCRAFT_CAM_PAN_MAX   INT32_ANGLE_2_PI

Definition at line 89 of file rotorcraft_cam.c.

#define ROTORCRAFT_CAM_PAN_MIN   0

Definition at line 88 of file rotorcraft_cam.c.

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

Definition at line 72 of file rotorcraft_cam.c.

Function Documentation

void rotorcraft_cam_init ( void  )
void rotorcraft_cam_set_mode ( uint8_t  mode)

Definition at line 97 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:

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

Definition at line 91 of file rotorcraft_cam.c.

References rotorcraft_cam_pan, and rotorcraft_cam_tilt.

Referenced by rotorcraft_cam_init().

+ Here is the caller graph for this function:

Variable Documentation

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().

int16_t rotorcraft_cam_pan

Definition at line 87 of file rotorcraft_cam.c.

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

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().

int16_t rotorcraft_cam_tilt_pwm

Definition at line 76 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), and rotorcraft_cam_periodic().