56 #ifndef ROTORCRAFT_CAM_ON
57 #define ROTORCRAFT_CAM_ON gpio_set
65 #ifndef ROTORCRAFT_CAM_OFF
66 #define ROTORCRAFT_CAM_OFF gpio_clear
71 #define _SERVO_PARAM(_s,_p) SERVO_ ## _s ## _ ## _p
72 #define SERVO_PARAM(_s,_p) _SERVO_PARAM(_s,_p)
77 #if ROTORCRAFT_CAM_USE_TILT
78 #define ROTORCRAFT_CAM_TILT_NEUTRAL SERVO_PARAM(ROTORCRAFT_CAM_TILT_SERVO, NEUTRAL)
79 #define ROTORCRAFT_CAM_TILT_MIN SERVO_PARAM(ROTORCRAFT_CAM_TILT_SERVO, MIN)
80 #define ROTORCRAFT_CAM_TILT_MAX SERVO_PARAM(ROTORCRAFT_CAM_TILT_SERVO, MAX)
81 #define D_TILT (ROTORCRAFT_CAM_TILT_MAX - ROTORCRAFT_CAM_TILT_MIN)
82 #define CT_MIN Min(CAM_TA_MIN, CAM_TA_MAX)
83 #define CT_MAX Max(CAM_TA_MIN, CAM_TA_MAX)
88 #define ROTORCRAFT_CAM_PAN_MIN 0
89 #define ROTORCRAFT_CAM_PAN_MAX INT32_ANGLE_2_PI
91 static void send_cam(
struct transport_tx *trans,
struct link_device *
dev)
93 pprz_msg_send_ROTORCRAFT_CAM(trans, dev, AC_ID,
100 #ifdef ROTORCRAFT_CAM_SWITCH_GPIO
111 #ifdef ROTORCRAFT_CAM_SWITCH_GPIO
115 #if ROTORCRAFT_CAM_USE_TILT
132 #if ROTORCRAFT_CAM_USE_TILT
135 #if ROTORCRAFT_CAM_USE_PAN
143 #if ROTORCRAFT_CAM_USE_TILT_ANGLES
146 (CAM_TA_MAX - CAM_TA_MIN);
148 #if ROTORCRAFT_CAM_USE_PAN
154 #ifdef ROTORCRAFT_CAM_TRACK_WP
161 #if ROTORCRAFT_CAM_USE_TILT_ANGLES
168 (CAM_TA_MAX - CAM_TA_MIN);
176 #if ROTORCRAFT_CAM_USE_TILT
int32_t psi
in rad with INT32_ANGLE_FRAC
#define ROTORCRAFT_CAM_MODE_WP
Rotorcraft navigation functions.
Camera control module for rotorcraft.
Periodic telemetry system header (includes downlink utility and generated code).
int16_t rotorcraft_cam_tilt_pwm
#define ROTORCRAFT_CAM_MODE_MANUAL
static void send_cam(struct transport_tx *trans, struct link_device *dev)
#define VECT2_DIFF(_c, _a, _b)
int16_t rotorcraft_cam_pan
void rotorcraft_cam_periodic(void)
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
#define ROTORCRAFT_CAM_DEFAULT_MODE
Default mode is NONE.
#define ROTORCRAFT_CAM_MODE_HEADING
Hardware independent API for actuators (servos, motor controllers).
#define ROTORCRAFT_CAM_MODE_NONE
#define INT32_VECT2_NORM(_v)
#define DefaultPeriodic
Set default periodic telemetry.
static const struct usb_device_descriptor dev
#define ROTORCRAFT_CAM_ON
Gpio output to turn camera power power on.
int16_t rotorcraft_cam_tilt
#define ROTORCRAFT_CAM_OFF
Gpio output to turn camera power power off.
void rotorcraft_cam_init(void)
API to get/set the generic vehicle states.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
#define INT32_COURSE_NORMALIZE(_a)
uint8_t rotorcraft_cam_mode
WP control.
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
#define INT32_VECT2_RSHIFT(_o, _i, _r)
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
int32_t nav_heading
with INT32_ANGLE_FRAC
void rotorcraft_cam_set_mode(uint8_t mode)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
int32_t int32_atan2(int32_t y, int32_t x)