Paparazzi UAS  v5.15_devel-59-g8c145b7
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 extern void dc_send_command_common(uint8_t cmd);
125 
127 typedef enum {
136 
138 void dc_send_shot_position(void);
139 
140 /* Macro value used to indicate a discardable argument */
141 #ifndef DC_IGNORE
142 #define DC_IGNORE FLT_MAX
143 #endif
144 
145 /* Default values for buffer control */
146 #ifndef DC_IMAGE_BUFFER
147 #define DC_IMAGE_BUFFER 65535
148 #endif
149 
150 /******************************************************************
151  * FUNCTIONS
152  *****************************************************************/
153 
155 extern void dc_init(void);
156 
158 extern void dc_periodic(void);
159 
171 extern uint8_t dc_distance(float interval);
172 
189 extern uint8_t dc_circle(float interval, float start);
190 
191 #define dc_Circle(interval) dc_circle(interval, DC_IGNORE)
192 
215 extern uint8_t dc_survey(float interval, float x, float y);
216 
217 #define dc_Survey(interval) dc_survey(interval, DC_IGNORE, DC_IGNORE)
218 
219 
225 extern uint8_t dc_stop(void);
226 
227 #define dc_Stop(_) dc_stop()
228 
235 extern uint8_t dc_info(void);
236 
237 
238 #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:127
uint8_t dc_circle(float interval, float start)
Sets the dc control in circle mode.
Definition: dc.c:212
dc_command_type
Generic Set of Digital Camera Commands.
Definition: dc.h:96
float dc_gps_next_dist
Definition: dc.c:78
void dc_send_command(uint8_t cmd)
Send Command To Camera.
Definition: dc.h:111
float dc_gps_y
Definition: dc.c:80
Definition: dc.h:113
float dc_cam_angle
camera angle
Definition: dc.c:70
uint8_t dc_info(void)
Send an info message.
Definition: dc.c:163
void dc_periodic(void)
periodic function
Definition: dc.c:273
float dc_circle_interval
angle between dc shots in degree
Definition: dc.c:72
void dc_init(void)
initialize settings
Definition: dc.c:156
uint8_t dc_survey(float interval, float x, float y)
Sets the dc control in distance mode.
Definition: dc.c:234
float dc_gps_x
point of reference for the survey mode
Definition: dc.c:79
Definition: dc.h:100
Definition: dc.h:103
uint8_t dc_cam_tracing
Definition: dc.c:69
Definition: dc.h:99
float dc_circle_last_block
Definition: dc.c:74
void dc_send_command_common(uint8_t cmd)
Command sending function.
Definition: dc.c:189
dc_autoshoot_type dc_autoshoot
Definition: dc.c:67
Device independent GPS code (interface)
Definition: dc.h:109
float dc_survey_interval
distance between dc shots in meters
Definition: dc.c:77
Definition: dc.h:102
Definition: dc.h:116
uint8_t dc_stop(void)
Stop dc control.
Definition: dc.c:256
Definition: dc.h:106
float dc_circle_max_blocks
Definition: dc.c:75
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:73
API to get/set the generic vehicle states.
float dc_autoshoot_period
AutoShoot photos every X seconds.
Definition: dc.c:84
uint16_t dc_photo_nr
export the number of the last photo
Definition: dc.c:93
float dc_distance_interval
AutoShoot photos on distance to last shot in meters.
Definition: dc.c:83
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:68
Definition: dc.h:115
void dc_send_shot_position(void)
Send Down the coordinates of where the photo was taken.
Definition: dc.c:104
uint8_t dc_distance(float interval)
Sets the dc control in distance mode.
Definition: dc.c:199