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 CT_MIN Min(CAM_TA_MIN, CAM_TA_MAX)
79 #define CT_MAX Max(CAM_TA_MIN, CAM_TA_MAX)
84 #define ROTORCRAFT_CAM_PAN_MIN 0
85 #define ROTORCRAFT_CAM_PAN_MAX INT32_ANGLE_2_PI
87 static void send_cam(
struct transport_tx *trans,
struct link_device *
dev)
89 pprz_msg_send_ROTORCRAFT_CAM(trans,
dev, AC_ID,
96 #ifdef ROTORCRAFT_CAM_SWITCH_GPIO
107 #ifdef ROTORCRAFT_CAM_SWITCH_GPIO
112 #if ROTORCRAFT_CAM_USE_TILT
126 #if ROTORCRAFT_CAM_USE_TILT
129 #if ROTORCRAFT_CAM_USE_PAN
137 #if ROTORCRAFT_CAM_USE_TILT_ANGLES
140 (CAM_TA_MAX - CAM_TA_MIN);
142 #if ROTORCRAFT_CAM_USE_PAN
148 #ifdef ROTORCRAFT_CAM_TRACK_WP
155 #if ROTORCRAFT_CAM_USE_TILT_ANGLES
162 (CAM_TA_MAX - CAM_TA_MIN);
170 #if ROTORCRAFT_CAM_USE_TILT
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
#define VECT2_DIFF(_c, _a, _b)
int32_t psi
in rad with INT32_ANGLE_FRAC
#define INT32_VECT2_NORM(_v)
#define INT32_COURSE_NORMALIZE(_a)
#define ANGLE_FLOAT_OF_BFP(_ai)
#define INT32_VECT2_RSHIFT(_o, _i, _r)
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
Hardware independent API for actuators (servos, motor controllers).
int32_t int32_atan2(int32_t y, int32_t x)
struct RotorcraftNavigation nav
Rotorcraft navigation functions.
float heading
heading setpoint (in radians)
static void send_cam(struct transport_tx *trans, struct link_device *dev)
#define ROTORCRAFT_CAM_ON
Gpio output to turn camera power power on.
#define ROTORCRAFT_CAM_OFF
Gpio output to turn camera power power off.
uint8_t rotorcraft_cam_mode
WP control.
int16_t rotorcraft_cam_pan
void rotorcraft_cam_periodic(void)
int16_t rotorcraft_cam_tilt
int16_t rotorcraft_cam_tilt_pprz
void rotorcraft_cam_set_mode(uint8_t mode)
void rotorcraft_cam_init(void)
Camera control module for rotorcraft.
#define ROTORCRAFT_CAM_MODE_MANUAL
#define ROTORCRAFT_CAM_MODE_WP
#define ROTORCRAFT_CAM_DEFAULT_MODE
Default mode is NONE.
#define ROTORCRAFT_CAM_MODE_HEADING
#define ROTORCRAFT_CAM_MODE_NONE
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.