Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 "subsystems/gps.h"
44 
46 extern uint16_t dc_photo_nr;
47 
49 extern uint16_t dc_gps_count;
50 
51 
52 /*
53  * Variables for PERIODIC mode.
54  */
56 extern float dc_autoshoot_period;
57 
58 
59 /*
60  * Variables for DISTANCE mode.
61  */
63 extern float dc_distance_interval;
64 
65 
66 /*
67  * Variables for SURVEY mode.
68  */
70 extern float dc_survey_interval;
71 
73 extern float dc_gps_x, dc_gps_y;
74 
75 extern float dc_gps_next_dist;
76 
77 
78 /*
79  * Variables for CIRCLE mode.
80  */
82 extern float dc_circle_start_angle;
83 
85 extern float dc_circle_interval;
86 
87 extern float dc_circle_max_blocks;
88 extern float dc_circle_last_block;
89 
90 
92 extern float dc_cam_angle;
93 extern uint8_t dc_cam_tracing;
94 
96 typedef enum {
98 
99  DC_HOLD = 13,
100  DC_SHOOT = 32,
101 
102  DC_WIDER = 'w',
103  DC_TALLER = 't',
104 
105  DC_UP = 'u',
106  DC_DOWN = 'd',
107  DC_CENTER = 'c',
108  DC_LEFT = 'l',
109  DC_RIGHT = 'r',
110 
111  DC_MENU = 'm',
112  DC_HOME = 'h',
113  DC_PLAY = 'p',
114 
115  DC_ON = 'O',
116  DC_OFF = 'o',
117 
119 
121 extern void dc_send_command(uint8_t cmd);
122 
124 typedef enum {
133 
135 void dc_send_shot_position(void);
136 
137 /* Macro value used to indicate a discardable argument */
138 #ifndef DC_IGNORE
139 #define DC_IGNORE FLT_MAX
140 #endif
141 
142 /* Default values for buffer control */
143 #ifndef DC_IMAGE_BUFFER
144 #define DC_IMAGE_BUFFER 65535
145 #endif
146 
147 /******************************************************************
148  * FUNCTIONS
149  *****************************************************************/
150 
152 extern void dc_init(void);
153 
155 extern void dc_periodic(void);
156 
168 extern uint8_t dc_distance(float interval);
169 
186 extern uint8_t dc_circle(float interval, float start);
187 
188 #define dc_Circle(interval) dc_circle(interval, DC_IGNORE)
189 
212 extern uint8_t dc_survey(float interval, float x, float y);
213 
214 #define dc_Survey(interval) dc_survey(interval, DC_IGNORE, DC_IGNORE)
215 
216 
222 extern uint8_t dc_stop(void);
223 
224 #define dc_Stop(_) dc_stop()
225 
232 extern uint8_t dc_info(void);
233 
234 
235 #endif // DC_H
unsigned short uint16_t
Definition: types.h:16
Definition: dc.h:105
dc_autoshoot_type
Auotmatic Digital Camera Photo Triggering modes.
Definition: dc.h:124
uint8_t dc_circle(float interval, float start)
Sets the dc control in circle mode.
Definition: dc.c:179
dc_command_type
Generic Set of Digital Camera Commands.
Definition: dc.h:96
float dc_gps_next_dist
Definition: dc.c:73
void dc_send_command(uint8_t cmd)
Send Command To Camera.
Definition: dc.h:111
float dc_gps_y
Definition: dc.c:75
Definition: dc.h:113
float dc_cam_angle
camera angle
Definition: dc.c:65
uint8_t dc_info(void)
Send an info message.
Definition: dc.c:139
void dc_periodic(void)
periodic function
Definition: dc.c:240
float dc_circle_interval
angle between dc shots in degree
Definition: dc.c:67
void dc_init(void)
initialize settings
Definition: dc.c:132
uint8_t dc_survey(float interval, float x, float y)
Sets the dc control in distance mode.
Definition: dc.c:201
float dc_gps_x
point of reference for the survey mode
Definition: dc.c:74
Definition: dc.h:100
Definition: dc.h:103
uint8_t dc_cam_tracing
Definition: dc.c:64
Definition: dc.h:99
float dc_circle_last_block
Definition: dc.c:69
dc_autoshoot_type dc_autoshoot
Definition: dc.c:62
Device independent GPS code (interface)
Definition: dc.h:109
float dc_survey_interval
distance between dc shots in meters
Definition: dc.c:72
Definition: dc.h:102
Definition: dc.h:116
uint8_t dc_stop(void)
Stop dc control.
Definition: dc.c:223
Definition: dc.h:106
float dc_circle_max_blocks
Definition: dc.c:70
unsigned char uint8_t
Definition: types.h:14
float dc_circle_start_angle
angle a where first image will be taken at a + delta
Definition: dc.c:68
API to get/set the generic vehicle states.
float dc_autoshoot_period
AutoShoot photos every X seconds.
Definition: dc.c:79
uint16_t dc_photo_nr
export the number of the last photo
Definition: dc.c:88
float dc_distance_interval
AutoShoot photos on distance to last shot in meters.
Definition: dc.c:78
Definition: dc.h:112
Definition: dc.h:108
Definition: dc.h:107
uint16_t dc_gps_count
number of images taken since the last change of dc_mode
Definition: dc.c:63
Definition: dc.h:115
void dc_send_shot_position(void)
Send Down the coordinates of where the photo was taken.
Definition: dc.c:96
uint8_t dc_distance(float interval)
Sets the dc control in distance mode.
Definition: dc.c:166