Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Camera control module for rotorcraft. More...
#include "modules/cam_control/rotorcraft_cam.h"
#include "subsystems/actuators.h"
#include "state.h"
#include "firmwares/rotorcraft/navigation.h"
#include "std.h"
#include "subsystems/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_pwm |
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.
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.
void rotorcraft_cam_init | ( | void | ) |
Definition at line 109 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_pwm, and send_cam().
void rotorcraft_cam_periodic | ( | void | ) |
Definition at line 127 of file rotorcraft_cam.c.
References int32_atan2(), INT32_COURSE_NORMALIZE, INT32_POS_FRAC, INT32_VECT2_NORM, INT32_VECT2_RSHIFT, nav_heading, 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_pwm, 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 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().
|
static |
Definition at line 91 of file rotorcraft_cam.c.
References 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 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().