Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cam.h File Reference

Pan/Tilt camera API. More...

#include <inttypes.h>
#include "inter_mcu.h"
+ Include dependency graph for cam.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAM_MODE_OFF   0 /* Do nothing */
 
#define CAM_MODE_ANGLES   1 /* Input: servo angles */
 
#define CAM_MODE_NADIR   2 /* Input: () */
 
#define CAM_MODE_XY_TARGET   3 /* Input: target_x, target_y */
 
#define CAM_MODE_WP_TARGET   4 /* Input: waypoint no */
 
#define CAM_MODE_AC_TARGET   5 /* Input: ac id */
 
#define CAM_MODE_STABILIZED   6
 
#define CAM_MODE_RC   7
 
#define CAM_PAN_MAX   90
 
#define CAM_PAN_MIN   -90
 
#define CAM_TILT_MAX   90
 
#define CAM_TILT_MIN   -90
 
#define cam_SetPanCommand(x)   { ap_state->commands[COMMAND_CAM_PAN] = cam_pan_command = x;}
 
#define cam_SetTiltCommand(x)   { ap_state->commands[COMMAND_CAM_TILT] = cam_tilt_command = x;}
 
#define SEND_CAM(_trans, _dev)
 

Functions

void cam_periodic (void)
 For CAM_MODE_AC_TARGET mode. More...
 
void cam_init (void)
 

Variables

uint8_t cam_mode
 
uint8_t cam_lock
 
float cam_phi_c
 
float cam_theta_c
 
float cam_pan_c
 
float cam_tilt_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...
 
int16_t cam_pan_command
 
int16_t cam_tilt_command
 

Detailed Description

Pan/Tilt camera API.

Definition in file cam.h.

Macro Definition Documentation

#define CAM_MODE_AC_TARGET   5 /* Input: ac id */

Definition at line 38 of file cam.h.

Referenced by cam_periodic().

#define CAM_MODE_ANGLES   1 /* Input: servo angles */

Definition at line 34 of file cam.h.

Referenced by cam_periodic().

#define CAM_MODE_NADIR   2 /* Input: () */

Definition at line 35 of file cam.h.

Referenced by cam_periodic().

#define CAM_MODE_OFF   0 /* Do nothing */

Definition at line 33 of file cam.h.

Referenced by cam_periodic(), and cam_segment_stop().

#define CAM_MODE_RC   7

Definition at line 40 of file cam.h.

Referenced by cam_periodic(), and vPoint().

#define CAM_MODE_STABILIZED   6

Definition at line 39 of file cam.h.

Referenced by cam_periodic(), and vPoint().

#define CAM_MODE_WP_TARGET   4 /* Input: waypoint no */

Definition at line 37 of file cam.h.

Referenced by cam_periodic(), and vPoint().

#define CAM_MODE_XY_TARGET   3 /* Input: target_x, target_y */

Definition at line 36 of file cam.h.

Referenced by cam_periodic(), cam_segment_periodic(), and vPoint().

#define CAM_PAN_MAX   90

Definition at line 44 of file cam.h.

Referenced by cam_angles(), and vPoint().

#define CAM_PAN_MIN   -90

Definition at line 47 of file cam.h.

Referenced by cam_angles(), and vPoint().

#define cam_SetPanCommand (   x)    { ap_state->commands[COMMAND_CAM_PAN] = cam_pan_command = x;}

Definition at line 78 of file cam.h.

#define cam_SetTiltCommand (   x)    { ap_state->commands[COMMAND_CAM_TILT] = cam_tilt_command = x;}

Definition at line 80 of file cam.h.

#define CAM_TILT_MAX   90

Definition at line 50 of file cam.h.

Referenced by cam_angles(), and vPoint().

#define CAM_TILT_MIN   -90

Definition at line 53 of file cam.h.

Referenced by cam_angles(), and vPoint().

#define SEND_CAM (   _trans,
  _dev 
)
Value:
{ \
int16_t phi = DegOfRad(cam_phi_c); \
int16_t theta = DegOfRad(cam_theta_c); \
DOWNLINK_SEND_CAM(_trans, _dev, &phi, &theta, &x, &y); \
}
float cam_target_y
Definition: cam.c:84
float cam_theta_c
Definition: cam.c:82
signed short int16_t
Definition: types.h:17
float cam_phi_c
Definition: cam.c:81
float cam_target_x
Radians, for CAM_MODE_ANGLES mode.
Definition: cam.c:84

Definition at line 99 of file cam.h.

Referenced by send_cam().

Function Documentation

void cam_init ( void  )

Definition at line 114 of file cam.c.

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

+ Here is the call graph for this function:

Variable Documentation

uint8_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.