Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros 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 "estimator.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 89 of file cam.c.

Referenced by cam_init().

#define CAM_PAN0   RadOfDeg(0)

Definition at line 71 of file cam.c.

Referenced by cam_periodic().

#define CAM_TILT0   RadOfDeg(0)

Definition at line 77 of file cam.c.

Referenced by cam_periodic().

Function Documentation

void cam_ac_target ( void  )

Definition at line 268 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 178 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 103 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, estimator_x, and estimator_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 230 of file cam.c.

References cam_angles(), cam_pan_c, cam_target_alt, cam_target_x, cam_target_y, cam_tilt_c, estimator_hspeed_dir, estimator_phi, estimator_theta, estimator_x, estimator_y, estimator_z, and vPoint().

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 259 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 92 of file cam.c.

Referenced by vPoint().

uint8_t cam_mode

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

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

int16_t cam_pan_command

Definition at line 94 of file cam.c.

float cam_phi_c

Definition at line 81 of file cam.c.

Referenced by cam_angles().

uint8_t cam_target_ac

For CAM_MODE_WP_TARGET mode.

Definition at line 86 of file cam.c.

Referenced by cam_ac_target().

float cam_target_alt

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

Referenced by cam_waypoint_target().

float cam_target_x

Radians, for CAM_MODE_ANGLES mode.

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

Referenced by cam_angles().

float cam_tilt_c

Definition at line 79 of file cam.c.

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

int16_t cam_tilt_command

Definition at line 95 of file cam.c.