40 #ifndef ROTORCRAFT_CAM_H
41 #define ROTORCRAFT_CAM_H
44 #include "generated/airframe.h"
48 #define ROTORCRAFT_CAM_MODE_NONE 0
49 #define ROTORCRAFT_CAM_MODE_MANUAL 1
50 #define ROTORCRAFT_CAM_MODE_HEADING 2
51 #define ROTORCRAFT_CAM_MODE_WP 3
54 #ifndef ROTORCRAFT_CAM_DEFAULT_MODE
55 #define ROTORCRAFT_CAM_DEFAULT_MODE ROTORCRAFT_CAM_MODE_NONE
61 #ifdef ROTORCRAFT_CAM_TILT_SERVO
62 #define ROTORCRAFT_CAM_USE_TILT 1
64 #define ROTORCRAFT_CAM_USE_TILT 0
69 #if defined ROTORCRAFT_CAM_TILT_ANGLE_MIN && defined ROTORCRAFT_CAM_TILT_ANGLE_MAX && defined ROTORCRAFT_CAM_USE_TILT
70 #define CAM_TA_MIN ANGLE_BFP_OF_REAL(ROTORCRAFT_CAM_TILT_ANGLE_MIN)
71 #define CAM_TA_MAX ANGLE_BFP_OF_REAL(ROTORCRAFT_CAM_TILT_ANGLE_MAX)
72 #define ROTORCRAFT_CAM_USE_TILT_ANGLES 1
78 #ifndef ROTORCRAFT_CAM_USE_PAN
79 #define ROTORCRAFT_CAM_USE_PAN 1
85 #ifndef ROTORCRAFT_CAM_TRACK_WP
87 #define ROTORCRAFT_CAM_TRACK_WP WP_CAM
104 #define rotorcraft_cam_SetCamMode(_v) { \
105 rotorcraft_cam_set_mode(_v); \
112 #ifndef ROTORCRAFT_CAM_STICK_TILT_INC
113 #define ROTORCRAFT_CAM_STICK_TILT_INC RadOfDeg(10.)
115 #ifndef ROTORCRAFT_CAM_STICK_PAN_INC
116 #define ROTORCRAFT_CAM_STICK_PAN_INC RadOfDeg(20.)
119 #define ROTORCRAFT_CAM_STICK_PARSE(_dl_buffer) { \
120 rotorcraft_cam_tilt += (int16_t)((ANGLE_BFP_OF_REAL(ROTORCRAFT_CAM_STICK_TILT_INC)/127.)*(float)DL_ROTORCRAFT_CAM_STICK_tilt(_dl_buffer)); \
121 rotorcraft_cam_pan += (int16_t)((ANGLE_BFP_OF_REAL(ROTORCRAFT_CAM_STICK_PAN_INC)/127.)*(float)DL_ROTORCRAFT_CAM_STICK_pan(dl_buffer)); \
122 INT32_COURSE_NORMALIZE(rotorcraft_cam_pan); \
int16_t rotorcraft_cam_tilt_pwm
Some architecture independent helper functions for GPIOs.
void rotorcraft_cam_periodic(void)
void rotorcraft_cam_set_mode(uint8_t mode)
void rotorcraft_cam_init(void)
int16_t rotorcraft_cam_pan
int16_t rotorcraft_cam_tilt
uint8_t rotorcraft_cam_mode
WP control.
Paparazzi fixed point algebra.