Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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/navigation/traffic_info.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)
 
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_t 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 87 of file cam.c.

Referenced by cam_init().

#define CAM_PAN0   RadOfDeg(0)

Definition at line 69 of file cam.c.

Referenced by cam_periodic().

#define CAM_TILT0   RadOfDeg(0)

Definition at line 75 of file cam.c.

Referenced by cam_periodic().

Function Documentation

void cam_ac_target ( void  )

Definition at line 269 of file cam.c.

References ac_info_::alt, cam_target(), cam_target_ac, cam_target_alt, cam_target_x, cam_target_y, ac_info_::east, get_ac_info(), and ac_info_::north.

Referenced by cam_periodic().

+ Here is the call graph for this function:

+ 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 176 of file cam.c.

References ap_state, 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 101 of file cam.c.

References cam_mode, and CAM_MODE0.

void cam_nadir ( void  )

Point straight down.

Definition at line 246 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 228 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_ac_target(), 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 260 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:

Variable Documentation

bool_t cam_lock

Definition at line 90 of file cam.c.

Referenced by vPoint().

uint8_t cam_mode

Definition at line 89 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 71 of file cam.c.

Referenced by cam_angles(), cam_periodic(), and cam_target().

int16_t cam_pan_command

Definition at line 92 of file cam.c.

float cam_phi_c

Definition at line 79 of file cam.c.

Referenced by cam_angles().

uint8_t cam_target_ac

For CAM_MODE_WP_TARGET mode.

Definition at line 84 of file cam.c.

Referenced by cam_ac_target().

float cam_target_alt

Definition at line 82 of file cam.c.

Referenced by cam_ac_target(), 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 83 of file cam.c.

Referenced by cam_waypoint_target().

float cam_target_x

Radians, for CAM_MODE_ANGLES mode.

Definition at line 82 of file cam.c.

Referenced by cam_ac_target(), cam_nadir(), cam_segment_periodic(), cam_target(), and cam_waypoint_target().

float cam_target_y

Definition at line 82 of file cam.c.

Referenced by cam_ac_target(), cam_nadir(), cam_segment_periodic(), cam_target(), and cam_waypoint_target().

float cam_theta_c

Definition at line 80 of file cam.c.

Referenced by cam_angles().

float cam_tilt_c

Definition at line 77 of file cam.c.

Referenced by cam_angles(), cam_periodic(), and cam_target().

int16_t cam_tilt_command

Definition at line 93 of file cam.c.