Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Camera control module for rotorcraft. More...
#include "modules/cam_control/rotorcraft_cam.h"
#include "modules/actuators/actuators.h"
#include "state.h"
#include "firmwares/rotorcraft/navigation.h"
#include "std.h"
#include "modules/datalink/telemetry.h"
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 |
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:
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.
#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.
#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.
#define ROTORCRAFT_CAM_PAN_MAX INT32_ANGLE_2_PI |
Definition at line 85 of file rotorcraft_cam.c.
#define ROTORCRAFT_CAM_PAN_MIN 0 |
Definition at line 84 of file rotorcraft_cam.c.
#define SERVO_PARAM | ( | _s, | |
_p | |||
) | _SERVO_PARAM(_s,_p) |
Definition at line 72 of file rotorcraft_cam.c.
void rotorcraft_cam_init | ( | void | ) |
Definition at line 105 of file rotorcraft_cam.c.
References DefaultPeriodic, gpio_setup_output(), register_periodic_telemetry(), ROTORCRAFT_CAM_DEFAULT_MODE, rotorcraft_cam_pan, rotorcraft_cam_set_mode(), rotorcraft_cam_tilt, rotorcraft_cam_tilt_pprz, and send_cam().
void rotorcraft_cam_periodic | ( | void | ) |
Definition at line 121 of file rotorcraft_cam.c.
References ANGLE_FLOAT_OF_BFP, RotorcraftNavigation::heading, int32_atan2(), INT32_COURSE_NORMALIZE, INT32_POS_FRAC, INT32_VECT2_NORM, INT32_VECT2_RSHIFT, MAX_PPRZ, MIN_PPRZ, nav, Int32Eulers::psi, rotorcraft_cam_mode, ROTORCRAFT_CAM_MODE_HEADING, ROTORCRAFT_CAM_MODE_MANUAL, ROTORCRAFT_CAM_MODE_NONE, ROTORCRAFT_CAM_MODE_WP, rotorcraft_cam_pan, rotorcraft_cam_tilt, rotorcraft_cam_tilt_pprz, stateGetNedToBodyEulers_i(), stateGetPositionEnu_i(), VECT2_DIFF, waypoints, Int32Vect2::x, Int32Vect2::y, and EnuCoor_i::z.
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().
|
static |
Definition at line 87 of file rotorcraft_cam.c.
References dev, rotorcraft_cam_pan, and rotorcraft_cam_tilt.
Referenced by rotorcraft_cam_init().
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 83 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_pprz |
Definition at line 76 of file rotorcraft_cam.c.
Referenced by rotorcraft_cam_init(), and rotorcraft_cam_periodic().