Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces 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)   { cam_pan_command = x; imcu_set_command(COMMAND_CAM_PAN, cam_pan_command);}
 
#define cam_SetTiltCommand(x)   { cam_tilt_command = x; imcu_set_command(COMMAND_CAM_TILT, cam_tilt_command);}
 

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)    { cam_pan_command = x; imcu_set_command(COMMAND_CAM_PAN, cam_pan_command);}

Definition at line 78 of file cam.h.

#define cam_SetTiltCommand (   x)    { cam_tilt_command = x; imcu_set_command(COMMAND_CAM_TILT, cam_tilt_command);}

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

Function Documentation

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:

Variable Documentation

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