Paparazzi UAS  v5.18.0_stable
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 "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
dc_cam_angle
float dc_cam_angle
camera angle
Definition: dc.c:70
uint16_t
unsigned short uint16_t
Definition: types.h:16
dc_info
uint8_t dc_info(void)
Send an info message.
Definition: dc.c:163
DC_HOME
@ DC_HOME
Definition: dc.h:112
DC_PLAY
@ DC_PLAY
Definition: dc.h:113
dc_circle_interval
float dc_circle_interval
angle between dc shots in degree
Definition: dc.c:72
dc_init
void dc_init(void)
initialize settings
Definition: dc.c:156
dc_survey
uint8_t dc_survey(float interval, float x, float y)
Sets the dc control in distance mode.
Definition: dc.c:234
DC_HOLD
@ DC_HOLD
Definition: dc.h:99
DC_AUTOSHOOT_CIRCLE
@ DC_AUTOSHOOT_CIRCLE
Definition: dc.h:133
dc_send_command_common
void dc_send_command_common(uint8_t cmd)
Command sending function.
Definition: dc.c:189
dc_autoshoot
dc_autoshoot_type dc_autoshoot
Definition: dc.c:67
DC_OFF
@ DC_OFF
Definition: dc.h:116
dc_autoshoot_type
dc_autoshoot_type
Auotmatic Digital Camera Photo Triggering modes.
Definition: dc.h:127
dc_circle
uint8_t dc_circle(float interval, float start)
Sets the dc control in circle mode.
Definition: dc.c:212
dc_command_type
dc_command_type
Generic Set of Digital Camera Commands.
Definition: dc.h:96
dc_gps_next_dist
float dc_gps_next_dist
Definition: dc.c:78
DC_AUTOSHOOT_SURVEY
@ DC_AUTOSHOOT_SURVEY
Definition: dc.h:132
DC_AUTOSHOOT_PERIODIC
@ DC_AUTOSHOOT_PERIODIC
Definition: dc.h:129
dc_circle_last_block
float dc_circle_last_block
Definition: dc.c:74
DC_MENU
@ DC_MENU
Definition: dc.h:111
dc_send_command
void dc_send_command(uint8_t cmd)
Send Command To Camera.
Definition: atmega_i2c_cam_ctrl.c:41
DC_RIGHT
@ DC_RIGHT
Definition: dc.h:109
std.h
dc_gps_y
float dc_gps_y
Definition: dc.h:73
gps.h
Device independent GPS code (interface)
DC_WIDER
@ DC_WIDER
Definition: dc.h:102
dc_circle_max_blocks
float dc_circle_max_blocks
Definition: dc.c:75
dc_periodic
void dc_periodic(void)
periodic function
Definition: dc.c:273
dc_photo_nr
uint16_t dc_photo_nr
export the number of the last photo
Definition: dc.c:93
uint8_t
unsigned char uint8_t
Definition: types.h:14
DC_TALLER
@ DC_TALLER
Definition: dc.h:103
dc_gps_x
float dc_gps_x
point of reference for the survey mode
Definition: dc.c:79
DC_LEFT
@ DC_LEFT
Definition: dc.h:108
FloatVect2::y
float y
Definition: pprz_algebra_float.h:51
dc_cam_tracing
uint8_t dc_cam_tracing
Definition: dc.c:69
dc_gps_count
uint16_t dc_gps_count
number of images taken since the last change of dc_mode
Definition: dc.c:68
DC_AUTOSHOOT_DISTANCE
@ DC_AUTOSHOOT_DISTANCE
Definition: dc.h:130
DC_GET_STATUS
@ DC_GET_STATUS
Definition: dc.h:97
DC_SHOOT
@ DC_SHOOT
Definition: dc.h:100
DC_DOWN
@ DC_DOWN
Definition: dc.h:106
dc_survey_interval
float dc_survey_interval
distance between dc shots in meters
Definition: dc.c:77
dc_send_shot_position
void dc_send_shot_position(void)
Send Down the coordinates of where the photo was taken.
Definition: dc.c:104
dc_distance
uint8_t dc_distance(float interval)
Sets the dc control in distance mode.
Definition: dc.c:199
DC_ON
@ DC_ON
Definition: dc.h:115
dc_stop
uint8_t dc_stop(void)
Stop dc control.
Definition: dc.c:256
FloatVect2::x
float x
Definition: pprz_algebra_float.h:50
dc_circle_start_angle
float dc_circle_start_angle
angle a where first image will be taken at a + delta
Definition: dc.c:73
state.h
DC_AUTOSHOOT_EXT_TRIG
@ DC_AUTOSHOOT_EXT_TRIG
Definition: dc.h:131
DC_AUTOSHOOT_STOP
@ DC_AUTOSHOOT_STOP
Definition: dc.h:128
dc_distance_interval
float dc_distance_interval
AutoShoot photos on distance to last shot in meters.
Definition: dc.c:83
DC_CENTER
@ DC_CENTER
Definition: dc.h:107
DC_UP
@ DC_UP
Definition: dc.h:105
dc_autoshoot_period
float dc_autoshoot_period
AutoShoot photos every X seconds.
Definition: dc.c:84