Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
dc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 
36 #ifndef DC_H
37 #define DC_H
38 
39 #include "float.h"
40 #include "std.h"
41 #include "state.h"
42 #include "generated/airframe.h"
43 #include "modules/gps/gps.h"
44 
46 extern uint16_t dc_photo_nr;
47 
49 extern uint16_t dc_gps_count;
50 
52 extern float dc_exposure;
53 
54 /*
55  * Variables for PERIODIC mode.
56  */
58 extern float dc_autoshoot_period;
59 
60 
61 /*
62  * Variables for DISTANCE mode.
63  */
65 extern float dc_distance_interval;
66 
67 
68 /*
69  * Variables for SURVEY mode.
70  */
72 extern float dc_survey_interval;
73 
75 extern float dc_gps_x, dc_gps_y;
76 
77 extern float dc_gps_next_dist;
78 
79 
80 /*
81  * Variables for CIRCLE mode.
82  */
84 extern float dc_circle_start_angle;
85 
87 extern float dc_circle_interval;
88 
89 extern float dc_circle_max_blocks;
90 extern float dc_circle_last_block;
91 
92 
94 extern float dc_cam_angle;
95 extern uint8_t dc_cam_tracing;
96 
98 typedef enum {
100 
101  DC_HOLD = 13,
102  DC_SHOOT = 32,
103 
104  DC_WIDER = 'w',
105  DC_TALLER = 't',
106 
107  DC_UP = 'u',
108  DC_DOWN = 'd',
109  DC_CENTER = 'c',
110  DC_LEFT = 'l',
111  DC_RIGHT = 'r',
112 
113  DC_MENU = 'm',
114  DC_HOME = 'h',
115  DC_PLAY = 'p',
116 
117  DC_ON = 'O',
118  DC_OFF = 'o',
119 
121 
123 extern void dc_send_command(uint8_t cmd);
124 
126 extern void dc_send_command_common(uint8_t cmd);
127 
129 extern void dc_set_expo(float expo);
130 
132 typedef enum {
141 
143 void dc_send_shot_position(void);
144 
145 /* Macro value used to indicate a discardable argument */
146 #ifndef DC_IGNORE
147 #define DC_IGNORE FLT_MAX
148 #endif
149 
150 /* Default values for buffer control */
151 #ifndef DC_IMAGE_BUFFER
152 #define DC_IMAGE_BUFFER 65535
153 #endif
154 
155 /******************************************************************
156  * FUNCTIONS
157  *****************************************************************/
158 
160 extern void dc_init(void);
161 
163 extern void dc_periodic(void);
164 
176 extern uint8_t dc_distance(float interval);
177 
194 extern uint8_t dc_circle(float interval, float start);
195 
196 #define dc_Circle(interval) dc_circle(interval, DC_IGNORE)
197 
220 extern uint8_t dc_survey(float interval, float x, float y);
221 
222 #define dc_Survey(interval) dc_survey(interval, DC_IGNORE, DC_IGNORE)
223 
224 
230 extern uint8_t dc_stop(void);
231 
232 #define dc_Stop(_) dc_stop()
233 
240 extern uint8_t dc_info(void);
241 
242 
243 #endif // DC_H
float dc_circle_start_angle
angle a where first image will be taken at a + delta
Definition: dc.c:75
float dc_survey_interval
distance between dc shots in meters
Definition: dc.c:79
void dc_periodic(void)
periodic function
Definition: dc.c:279
uint8_t dc_survey(float interval, float x, float y)
Sets the dc control in distance mode.
Definition: dc.c:240
void dc_init(void)
initialize settings
Definition: dc.c:158
float dc_distance_interval
AutoShoot photos on distance to last shot in meters.
Definition: dc.c:85
dc_autoshoot_type dc_autoshoot
Definition: dc.c:67
uint8_t dc_stop(void)
Stop dc control.
Definition: dc.c:262
dc_command_type
Generic Set of Digital Camera Commands.
Definition: dc.h:98
@ DC_HOLD
Definition: dc.h:101
@ DC_GET_STATUS
Definition: dc.h:99
@ DC_CENTER
Definition: dc.h:109
@ DC_HOME
Definition: dc.h:114
@ DC_PLAY
Definition: dc.h:115
@ DC_OFF
Definition: dc.h:118
@ DC_WIDER
Definition: dc.h:104
@ DC_UP
Definition: dc.h:107
@ DC_SHOOT
Definition: dc.h:102
@ DC_LEFT
Definition: dc.h:110
@ DC_MENU
Definition: dc.h:113
@ DC_TALLER
Definition: dc.h:105
@ DC_DOWN
Definition: dc.h:108
@ DC_ON
Definition: dc.h:117
@ DC_RIGHT
Definition: dc.h:111
void dc_send_command_common(uint8_t cmd)
Command sending function.
Definition: dc.c:192
float dc_circle_last_block
Definition: dc.c:76
void dc_send_command(uint8_t cmd)
Send Command To Camera.
float dc_gps_next_dist
Definition: dc.c:80
uint16_t dc_photo_nr
export the number of the last photo
Definition: dc.c:95
float dc_gps_x
point of reference for the survey mode
Definition: dc.c:81
uint8_t dc_distance(float interval)
Sets the dc control in distance mode.
Definition: dc.c:205
uint8_t dc_cam_tracing
Definition: dc.c:69
float dc_autoshoot_period
AutoShoot photos every X seconds.
Definition: dc.c:86
uint16_t dc_gps_count
number of images taken since the last change of dc_mode
Definition: dc.c:68
void dc_send_shot_position(void)
Send Down the coordinates of where the photo was taken.
Definition: dc.c:106
float dc_exposure
camera exposure
Definition: dc.c:72
uint8_t dc_info(void)
Send an info message.
Definition: dc.c:166
float dc_gps_y
Definition: dc.h:75
float dc_circle_interval
angle between dc shots in degree
Definition: dc.c:74
uint8_t dc_circle(float interval, float start)
Sets the dc control in circle mode.
Definition: dc.c:218
float dc_cam_angle
camera angle
Definition: dc.c:70
float dc_circle_max_blocks
Definition: dc.c:77
dc_autoshoot_type
Auotmatic Digital Camera Photo Triggering modes.
Definition: dc.h:132
@ DC_AUTOSHOOT_DISTANCE
Definition: dc.h:135
@ DC_AUTOSHOOT_PERIODIC
Definition: dc.h:134
@ DC_AUTOSHOOT_SURVEY
Definition: dc.h:137
@ DC_AUTOSHOOT_EXT_TRIG
Definition: dc.h:136
@ DC_AUTOSHOOT_CIRCLE
Definition: dc.h:138
@ DC_AUTOSHOOT_STOP
Definition: dc.h:133
void dc_set_expo(float expo)
Set camera exposure.
Definition: dc.c:202
Device independent GPS code (interface)
API to get/set the generic vehicle states.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98