Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Pan/Tilt camera library. More...
#include <math.h>
#include "cam.h"
#include "modules/nav/common_nav.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "state.h"
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
Macros | |
#define | CAM_PAN0 RadOfDeg(0) |
#define | CAM_TILT0 RadOfDeg(0) |
#define | CAM_MODE0 CAM_MODE_OFF |
Functions | |
void | cam_nadir (void) |
Point straight down. More... | |
void | cam_angles (void) |
Computes the servo values from cam_pan_c and cam_tilt_c. More... | |
void | cam_target (void) |
Computes the right angles from target_x, target_y, target_alt. More... | |
void | cam_waypoint_target (void) |
void | cam_ac_target (void) |
static void | send_cam (struct transport_tx *trans, struct link_device *dev) |
void | cam_init (void) |
void | cam_periodic (void) |
For CAM_MODE_AC_TARGET mode. More... | |
Variables | |
float | cam_pan_c |
float | cam_tilt_c |
float | cam_phi_c |
float | cam_theta_c |
float | cam_target_x |
Radians, for CAM_MODE_ANGLES mode. More... | |
float | cam_target_y |
float | cam_target_alt |
uint8_t | cam_target_wp |
For CAM_MODE_XY_TARGET mode. More... | |
uint8_t | cam_target_ac |
For CAM_MODE_WP_TARGET mode. More... | |
uint8_t | cam_mode |
bool | cam_lock |
int16_t | cam_pan_command |
int16_t | cam_tilt_command |
Pan/Tilt camera library.
Definition in file cam.c.
#define CAM_MODE0 CAM_MODE_OFF |
void cam_ac_target | ( | void | ) |
Definition at line 317 of file cam.c.
Referenced by cam_periodic().
void cam_angles | ( | void | ) |
Computes the servo values from cam_pan_c and cam_tilt_c.
Definition at line 203 of file cam.c.
References cam_pan_c, CAM_PAN_MAX, CAM_PAN_MIN, cam_phi_c, cam_theta_c, cam_tilt_c, CAM_TILT_MAX, CAM_TILT_MIN, MAX_PPRZ, MIN_PPRZ, and TRIM_PPRZ.
Referenced by cam_periodic(), cam_target(), and state2stereocam().
void cam_init | ( | void | ) |
Definition at line 119 of file cam.c.
References cam_mode, CAM_MODE0, DefaultPeriodic, register_periodic_telemetry(), and send_cam().
void cam_nadir | ( | void | ) |
Point straight down.
Definition at line 280 of file cam.c.
References cam_target(), cam_target_alt, cam_target_x, cam_target_y, stateGetPositionEnu_f(), EnuCoor_f::x, and EnuCoor_f::y.
Referenced by cam_periodic().
void cam_periodic | ( | void | ) |
For CAM_MODE_AC_TARGET mode.
Definition at line 129 of file cam.c.
References AP_MODE_AUTO1, AP_MODE_AUTO2, autopilot_get_mode(), cam_ac_target(), cam_angles(), cam_mode, CAM_MODE_AC_TARGET, CAM_MODE_ANGLES, CAM_MODE_NADIR, CAM_MODE_OFF, CAM_MODE_RC, CAM_MODE_STABILIZED, CAM_MODE_WP_TARGET, CAM_MODE_XY_TARGET, cam_nadir(), CAM_PAN0, cam_pan_c, cam_target(), CAM_TILT0, cam_tilt_c, cam_waypoint_target(), LED_OFF, LED_ON, MAX_PPRZ, and MIN_PPRZ.
void cam_target | ( | void | ) |
Computes the right angles from target_x, target_y, target_alt.
Definition at line 261 of file cam.c.
References cam_angles(), cam_pan_c, cam_target_alt, cam_target_x, cam_target_y, cam_tilt_c, FloatEulers::phi, stateGetHorizontalSpeedDir_f(), stateGetNedToBodyEulers_f(), stateGetPositionEnu_f(), stateGetPositionUtm_f(), FloatEulers::theta, vPoint(), EnuCoor_f::x, and EnuCoor_f::y.
Referenced by cam_nadir(), cam_periodic(), and cam_waypoint_target().
void cam_waypoint_target | ( | void | ) |
Definition at line 295 of file cam.c.
References cam_target(), cam_target_alt, cam_target_wp, cam_target_x, cam_target_y, ground_alt, nb_waypoint, WaypointX, and WaypointY.
Referenced by cam_periodic().
|
static |
Definition at line 102 of file cam.c.
References cam_phi_c, cam_target_x, cam_target_y, cam_theta_c, and dev.
Referenced by cam_init().
uint8_t cam_mode |
Definition at line 90 of file cam.c.
Referenced by cam_init(), cam_periodic(), cam_segment_periodic(), cam_segment_stop(), and vPoint().
float cam_pan_c |
Definition at line 72 of file cam.c.
Referenced by cam_angles(), cam_periodic(), and cam_target().
float cam_phi_c |
Definition at line 80 of file cam.c.
Referenced by cam_angles(), and send_cam().
float cam_target_alt |
Definition at line 83 of file cam.c.
Referenced by cam_nadir(), cam_segment_periodic(), cam_target(), and cam_waypoint_target().
uint8_t cam_target_wp |
For CAM_MODE_XY_TARGET mode.
Definition at line 84 of file cam.c.
Referenced by cam_waypoint_target().
float cam_target_x |
Radians, for CAM_MODE_ANGLES mode.
Definition at line 83 of file cam.c.
Referenced by cam_nadir(), cam_segment_periodic(), cam_target(), cam_waypoint_target(), and send_cam().
float cam_target_y |
Definition at line 83 of file cam.c.
Referenced by cam_nadir(), cam_segment_periodic(), cam_target(), cam_waypoint_target(), and send_cam().
float cam_theta_c |
Definition at line 81 of file cam.c.
Referenced by cam_angles(), and send_cam().
float cam_tilt_c |
Definition at line 78 of file cam.c.
Referenced by cam_angles(), cam_periodic(), and cam_target().