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
dc.h File Reference

Standard Digital Camera Control Interface. More...

#include "float.h"
#include "std.h"
#include "led.h"
#include "state.h"
#include "subsystems/nav.h"
#include "generated/airframe.h"
#include "subsystems/gps.h"
+ Include dependency graph for dc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define dc_send_shot_position()   {}
 
#define DC_IGNORE   FLT_MAX
 
#define DC_IMAGE_BUFFER   65535
 
#define DC_IMAGE_BUFFER_TPI   0
 
#define dc_Circle(interval)   dc_circle(interval, DC_IGNORE)
 
#define dc_Survey(interval)   dc_survey(interval, DC_IGNORE, DC_IGNORE)
 
#define dc_Stop(_)   dc_stop()
 

Enumerations

enum  dc_command_type {
  DC_GET_STATUS = 0, DC_HOLD = 13, DC_SHOOT = 32, DC_WIDER = 'w',
  DC_TALLER = 't', DC_UP = 'u', DC_DOWN = 'd', DC_CENTER = 'c',
  DC_LEFT = 'l', DC_RIGHT = 'r', DC_MENU = 'm', DC_HOME = 'h',
  DC_PLAY = 'p', DC_ON = 'O', DC_OFF = 'o'
}
 
enum  dc_autoshoot_type {
  DC_AUTOSHOOT_STOP = 0, DC_AUTOSHOOT_PERIODIC = 1, DC_AUTOSHOOT_DISTANCE = 2, DC_AUTOSHOOT_EXT_TRIG = 3,
  DC_AUTOSHOOT_SURVEY = 4, DC_AUTOSHOOT_CIRCLE = 5
}
 

Functions

void dc_send_command (uint8_t cmd)
 
uint8_t dc_circle (float interval, float start)
 Sets the dc control in circle mode. More...
 
uint8_t dc_survey (float interval, float x, float y)
 Sets the dc control in distance mode. More...
 
uint8_t dc_stop (void)
 Sets the dc control in inactive mode, stopping all current actions. More...
 
uint8_t dc_info (void)
 Send an info message containing information about position, course, buffer and all other internal variables used by the dc control. More...
 
static void dc_init (void)
 
static float dim_mod (float a, float b, float m)
 
static void dc_periodic_4Hz (void)
 

Variables

uint16_t dc_gps_count
 
float dc_gps_dist
 
float dc_gps_next_dist
 
float dc_circle_start_angle
 
float dc_circle_interval
 
float dc_circle_max_blocks
 
float dc_gps_x
 
float dc_gps_y
 
float dc_circle_last_block
 
bool_t dc_probing
 
uint8_t dc_buffer_timer
 
float dc_cam_angle
 
uint8_t dc_cam_tracing
 
dc_autoshoot_type dc_autoshoot
 
uint8_t dc_autoshoot_quartersec_period
 
uint8_t dc_autoshoot_meter_grid
 

Detailed Description

Standard Digital Camera Control Interface.

-Standard IO -I2C Control

Usage: (from the flight plan, the settings or any airborne code):

  • dc_send_command( )
  • set the appropriate autoshoot mode (off/time/distance/trigger)
  • use the module periodic function to set the autorepeat interval
  • define SENSOR_SYNC_SEND to get the DC_SHOT_MESSAGE on every SHOOT command

Definition in file dc.h.

Macro Definition Documentation

#define dc_Circle (   interval)    dc_circle(interval, DC_IGNORE)

Definition at line 158 of file dc.h.

Referenced by SpiralNav().

#define DC_IGNORE   FLT_MAX

Definition at line 131 of file dc.h.

Referenced by dc_circle(), and dc_survey().

#define DC_IMAGE_BUFFER   65535

Definition at line 136 of file dc.h.

#define DC_IMAGE_BUFFER_TPI   0

Definition at line 140 of file dc.h.

#define dc_send_shot_position ( )    {}
#define dc_Stop (   _)    dc_stop()

Definition at line 187 of file dc.h.

#define dc_Survey (   interval)    dc_survey(interval, DC_IGNORE, DC_IGNORE)

Definition at line 178 of file dc.h.

Enumeration Type Documentation

Enumerator
DC_AUTOSHOOT_STOP 
DC_AUTOSHOOT_PERIODIC 
DC_AUTOSHOOT_DISTANCE 
DC_AUTOSHOOT_EXT_TRIG 
DC_AUTOSHOOT_SURVEY 
DC_AUTOSHOOT_CIRCLE 

Definition at line 106 of file dc.h.

Enumerator
DC_GET_STATUS 
DC_HOLD 
DC_SHOOT 
DC_WIDER 
DC_TALLER 
DC_UP 
DC_DOWN 
DC_CENTER 
DC_LEFT 
DC_RIGHT 
DC_MENU 
DC_HOME 
DC_PLAY 
DC_ON 
DC_OFF 

Definition at line 78 of file dc.h.

Function Documentation

uint8_t dc_circle ( float  interval,
float  start 
)

Sets the dc control in circle mode.

The 'start' value is the reference course and 'intervall' the minimum angle between shots. If 'start' is 0 the current course is used instead.

In this mode the dc control assumes a perfect circular course. The first picture is taken at angle start+interval.

Definition at line 112 of file dc.c.

References dc_autoshoot, DC_AUTOSHOOT_CIRCLE, dc_circle_interval, dc_circle_last_block, dc_circle_max_blocks, dc_circle_start_angle, dc_gps_count, DC_IGNORE, dc_info(), dc_probing, stateGetNedToBodyEulers_f(), and TRUE.

+ Here is the call graph for this function:

uint8_t dc_info ( void  )

Send an info message containing information about position, course, buffer and all other internal variables used by the dc control.

Definition at line 89 of file dc.c.

References dc_autoshoot, dc_autoshoot_quartersec_period, dc_circle_interval, dc_circle_last_block, dc_circle_start_angle, dc_gps_count, dc_gps_dist, dc_gps_next_dist, dc_gps_x, dc_gps_y, DefaultChannel, DefaultDevice, stateGetNedToBodyEulers_f(), and stateGetPositionEnu_f().

Referenced by dc_circle(), dc_stop(), and dc_survey().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dc_init ( void  )
inlinestatic

Definition at line 198 of file dc.h.

References dc_autoshoot_meter_grid, and dc_autoshoot_quartersec_period.

Referenced by atmega_i2c_cam_ctrl_init(), led_cam_ctrl_init(), and servo_cam_ctrl_init().

+ Here is the caller graph for this function:

void dc_send_command ( uint8_t  cmd)

Definition at line 44 of file atmega_i2c_cam_ctrl.c.

References atmega_i2c_cam_ctrl_send(), DC_ON, DC_PUSH, dc_send_shot_position, DC_SHOOT, DC_SHUTTER_DELAY, DC_TALLER, dc_timer, and DC_WIDER.

Referenced by atmega_i2c_cam_ctrl_periodic(), dc_periodic_4Hz(), and SpiralNav().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t dc_stop ( void  )

Sets the dc control in inactive mode, stopping all current actions.

Definition at line 153 of file dc.c.

References dc_autoshoot, DC_AUTOSHOOT_STOP, and dc_info().

Referenced by poly_survey_adv(), and SpiralNav().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t dc_survey ( float  interval,
float  x,
float  y 
)

Sets the dc control in distance mode.

The values of 'x' and 'y' are the coordinates of the reference point used for the distance calculations. If 'y' is 0 the value of 'x' is interpreted as index of a waypoint declared in the flight plan. If both 'x' and 'y' are 0 the current position will be used as reference point.

In this mode, the dc control assumes a perfect line formed course since the distance is calculated relative to the first given point of reference. So not usable for circles or other comparable shapes.

Definition at line 133 of file dc.c.

References dc_autoshoot, DC_AUTOSHOOT_SURVEY, dc_gps_count, dc_gps_dist, dc_gps_next_dist, dc_gps_x, dc_gps_y, DC_IGNORE, dc_info(), stateGetPositionEnu_f(), waypoints, EnuCoor_f::x, and EnuCoor_f::y.

Referenced by poly_survey_adv().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static float dim_mod ( float  a,
float  b,
float  m 
)
static

Definition at line 219 of file dc.h.

Referenced by dc_periodic_4Hz().

+ Here is the caller graph for this function:

Variable Documentation

dc_autoshoot_type dc_autoshoot

Definition at line 29 of file dc.c.

Referenced by dc_circle(), dc_info(), dc_periodic_4Hz(), dc_stop(), and dc_survey().

uint8_t dc_autoshoot_meter_grid

Definition at line 27 of file dc.c.

Referenced by dc_init(), and dc_periodic_4Hz().

uint8_t dc_autoshoot_quartersec_period

Definition at line 28 of file dc.c.

Referenced by dc_info(), dc_init(), and dc_periodic_4Hz().

uint8_t dc_buffer_timer
float dc_cam_angle

Definition at line 32 of file dc.c.

Referenced by SpiralNav().

uint8_t dc_cam_tracing

Definition at line 31 of file dc.c.

Referenced by SpiralNav().

float dc_circle_interval

Definition at line 34 of file dc.c.

Referenced by dc_circle(), dc_info(), and dc_periodic_4Hz().

float dc_circle_last_block

Definition at line 36 of file dc.c.

Referenced by dc_circle(), dc_info(), and dc_periodic_4Hz().

float dc_circle_max_blocks

Definition at line 37 of file dc.c.

Referenced by dc_circle(), and dc_periodic_4Hz().

float dc_circle_start_angle

Definition at line 35 of file dc.c.

Referenced by dc_circle(), dc_info(), and dc_periodic_4Hz().

uint16_t dc_gps_count

Definition at line 30 of file dc.c.

Referenced by dc_circle(), dc_info(), dc_periodic_4Hz(), and dc_survey().

float dc_gps_dist

Definition at line 39 of file dc.c.

Referenced by dc_info(), dc_periodic_4Hz(), and dc_survey().

float dc_gps_next_dist

Definition at line 40 of file dc.c.

Referenced by dc_info(), dc_periodic_4Hz(), and dc_survey().

float dc_gps_x

Definition at line 41 of file dc.c.

Referenced by dc_info(), dc_periodic_4Hz(), and dc_survey().

float dc_gps_y

Definition at line 42 of file dc.c.

Referenced by dc_info(), dc_periodic_4Hz(), and dc_survey().

bool_t dc_probing

Definition at line 44 of file dc.c.

Referenced by dc_circle(), and dc_periodic_4Hz().