Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cam.c File Reference

Pan/Tilt camera library. More...

#include <math.h>
#include "cam.h"
#include "subsystems/navigation/common_nav.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "state.h"
#include "subsystems/datalink/telemetry.h"
+ Include dependency graph for cam.c:

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
 

Detailed Description

Pan/Tilt camera library.

Definition in file cam.c.

Macro Definition Documentation

#define CAM_MODE0   CAM_MODE_OFF

Definition at line 88 of file cam.c.

Referenced by cam_init().

#define CAM_PAN0   RadOfDeg(0)

Definition at line 70 of file cam.c.

Referenced by cam_periodic().

#define CAM_TILT0   RadOfDeg(0)

Definition at line 76 of file cam.c.

Referenced by cam_periodic().

Function Documentation

void cam_ac_target ( void  )

Definition at line 317 of file cam.c.

Referenced by cam_periodic().

+ Here is the caller graph for this function:

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(), and cam_target().

+ Here is the caller graph for this function:

void cam_init ( void  )

Definition at line 119 of file cam.c.

References cam_mode, CAM_MODE0, DefaultPeriodic, register_periodic_telemetry(), and send_cam().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_cam ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 102 of file cam.c.

References cam_phi_c, cam_target_x, cam_target_y, cam_theta_c, FloatVect3::x, and FloatVect3::y.

Referenced by cam_init().

+ Here is the caller graph for this function:

Variable Documentation

bool cam_lock

Definition at line 91 of file cam.c.

Referenced by vPoint().

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().

int16_t cam_pan_command

Definition at line 93 of file cam.c.

float cam_phi_c

Definition at line 80 of file cam.c.

Referenced by cam_angles(), and send_cam().

uint8_t cam_target_ac

For CAM_MODE_WP_TARGET mode.

Definition at line 85 of file cam.c.

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().

int16_t cam_tilt_command

Definition at line 94 of file cam.c.