Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rotorcraft_cam.h File Reference
#include "generated/airframe.h"
#include "generated/flight_plan.h"
#include "math/pprz_algebra_int.h"
#include "std.h"
#include "led.h"
+ Include dependency graph for rotorcraft_cam.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ROTORCRAFT_CAM_MODE_NONE   0
 Camera control module for rotorcraft. More...
 
#define ROTORCRAFT_CAM_MODE_MANUAL   1
 
#define ROTORCRAFT_CAM_MODE_HEADING   2
 
#define ROTORCRAFT_CAM_MODE_WP   3
 
#define ROTORCRAFT_CAM_DEFAULT_MODE   ROTORCRAFT_CAM_MODE_NONE
 Default mode is NONE. More...
 
#define ROTORCRAFT_CAM_ON   {}
 Cam power control. More...
 
#define ROTORCRAFT_CAM_OFF   {}
 
#define ROTORCRAFT_CAM_USE_TILT   0
 Cam tilt control. More...
 
#define ROTORCRAFT_CAM_USE_PAN   1
 Use angles for tilt in HEADING and WP modes. More...
 
#define rotorcraft_cam_SetCamMode(_v)
 Set camera mode. More...
 
#define ROTORCRAFT_CAM_STICK_TILT_INC   RadOfDeg(10.)
 Cam control from datalink message. More...
 
#define ROTORCRAFT_CAM_STICK_PAN_INC   RadOfDeg(20.)
 
#define ROTORCRAFT_CAM_STICK_PARSE(_dl_buffer)
 

Functions

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_pan
 
int16_t rotorcraft_cam_tilt_pwm
 

Macro Definition Documentation

#define ROTORCRAFT_CAM_DEFAULT_MODE   ROTORCRAFT_CAM_MODE_NONE

Default mode is NONE.

Definition at line 54 of file rotorcraft_cam.h.

Referenced by rotorcraft_cam_init().

#define ROTORCRAFT_CAM_MODE_HEADING   2

Definition at line 49 of file rotorcraft_cam.h.

Referenced by rotorcraft_cam_periodic().

#define ROTORCRAFT_CAM_MODE_MANUAL   1

Definition at line 48 of file rotorcraft_cam.h.

Referenced by rotorcraft_cam_periodic().

#define ROTORCRAFT_CAM_MODE_NONE   0

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)

The CAM_SWITCH can be used to power the camera in normal modes and disable it when in NONE mode

Definition at line 47 of file rotorcraft_cam.h.

Referenced by rotorcraft_cam_periodic().

#define ROTORCRAFT_CAM_MODE_WP   3

Definition at line 50 of file rotorcraft_cam.h.

Referenced by rotorcraft_cam_periodic().

#define ROTORCRAFT_CAM_OFF   {}

Definition at line 74 of file rotorcraft_cam.h.

#define ROTORCRAFT_CAM_ON   {}

Cam power control.

By default CAM_SWITCH is used Warning: LED_ON set GPIO low on some boards (lpc) LED_OFF set GPIO high on some boards (lpc)

Definition at line 67 of file rotorcraft_cam.h.

#define rotorcraft_cam_SetCamMode (   _v)
Value:
{ \
else { ROTORCRAFT_CAM_ON; } \
}
#define ROTORCRAFT_CAM_ON
Cam power control.
#define ROTORCRAFT_CAM_OFF
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer
#define ROTORCRAFT_CAM_MODE_NONE
Camera control module for rotorcraft.
uint8_t rotorcraft_cam_mode
WP control.

Set camera mode.

Camera is powered down in NONE mode if CAM_{ON|OFF} are defined

Definition at line 123 of file rotorcraft_cam.h.

Referenced by rotorcraft_cam_init().

#define ROTORCRAFT_CAM_STICK_PAN_INC   RadOfDeg(20.)

Definition at line 137 of file rotorcraft_cam.h.

#define ROTORCRAFT_CAM_STICK_PARSE (   _dl_buffer)
Value:
{ \
rotorcraft_cam_tilt += (int16_t)((ANGLE_BFP_OF_REAL(ROTORCRAFT_CAM_STICK_TILT_INC)/127.)*(float)DL_ROTORCRAFT_CAM_STICK_tilt(_dl_buffer)); \
rotorcraft_cam_pan += (int16_t)((ANGLE_BFP_OF_REAL(ROTORCRAFT_CAM_STICK_PAN_INC)/127.)*(float)DL_ROTORCRAFT_CAM_STICK_pan(dl_buffer)); \
}
#define ROTORCRAFT_CAM_STICK_PAN_INC
#define ANGLE_BFP_OF_REAL(_af)
#define ROTORCRAFT_CAM_STICK_TILT_INC
Cam control from datalink message.
signed short int16_t
Definition: types.h:17
#define INT32_COURSE_NORMALIZE(_a)
int16_t rotorcraft_cam_pan
int16_t rotorcraft_cam_tilt
uint8_t dl_buffer[MSG_SIZE]
Definition: main_demo5.c:59

Definition at line 140 of file rotorcraft_cam.h.

#define ROTORCRAFT_CAM_STICK_TILT_INC   RadOfDeg(10.)

Cam control from datalink message.

camera tilt and pan are incremented by STICK_TILT_INC and STICK_PAN_INC when maximum command is received from the stick

Definition at line 134 of file rotorcraft_cam.h.

#define ROTORCRAFT_CAM_USE_PAN   1

Use angles for tilt in HEADING and WP modes.

Cam pan control. By default use pan control (heading)

Definition at line 99 of file rotorcraft_cam.h.

#define ROTORCRAFT_CAM_USE_TILT   0

Cam tilt control.

By default use tilt control if a servo is assigned

Definition at line 84 of file rotorcraft_cam.h.

Function Documentation

void rotorcraft_cam_init ( void  )

Variable Documentation

uint8_t rotorcraft_cam_mode

WP control.

By default use WP_CAM waypoint if defined

Definition at line 30 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_periodic().

int16_t rotorcraft_cam_pan

Definition at line 48 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), and rotorcraft_cam_periodic().

int16_t rotorcraft_cam_tilt

Definition at line 36 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), and rotorcraft_cam_periodic().

int16_t rotorcraft_cam_tilt_pwm

Definition at line 37 of file rotorcraft_cam.c.

Referenced by rotorcraft_cam_init(), and rotorcraft_cam_periodic().