Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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

◆ CAM_MODE0

#define CAM_MODE0   CAM_MODE_OFF

Definition at line 88 of file cam.c.

◆ CAM_PAN0

#define CAM_PAN0   RadOfDeg(0)

Definition at line 70 of file cam.c.

◆ CAM_TILT0

#define CAM_TILT0   RadOfDeg(0)

Definition at line 76 of file cam.c.

Function Documentation

◆ cam_ac_target()

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:

◆ cam_angles()

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

+ Here is the caller graph for this function:

◆ cam_init()

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:

◆ cam_nadir()

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:

◆ cam_periodic()

◆ cam_target()

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:

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_cam()

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, dev, FloatVect3::x, and FloatVect3::y.

Referenced by cam_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ cam_lock

bool cam_lock

Definition at line 91 of file cam.c.

Referenced by vPoint().

◆ cam_mode

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

◆ cam_pan_c

float cam_pan_c

Definition at line 72 of file cam.c.

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

◆ cam_pan_command

int16_t cam_pan_command

Definition at line 93 of file cam.c.

◆ cam_phi_c

float cam_phi_c

Definition at line 80 of file cam.c.

Referenced by cam_angles(), and send_cam().

◆ cam_target_ac

uint8_t cam_target_ac

For CAM_MODE_WP_TARGET mode.

Definition at line 85 of file cam.c.

◆ cam_target_alt

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

◆ cam_target_wp

uint8_t cam_target_wp

For CAM_MODE_XY_TARGET mode.

Definition at line 84 of file cam.c.

Referenced by cam_waypoint_target().

◆ cam_target_x

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

◆ cam_target_y

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

◆ cam_theta_c

float cam_theta_c

Definition at line 81 of file cam.c.

Referenced by cam_angles(), and send_cam().

◆ cam_tilt_c

float cam_tilt_c

Definition at line 78 of file cam.c.

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

◆ cam_tilt_command

int16_t cam_tilt_command

Definition at line 94 of file cam.c.