30 #include "generated/modules.h"
31 #include "generated/airframe.h"
37 #define DC_CTRL_PARROT_MYKONOS_RECORD_DELAY 0.05
40 #define DC_CTRL_PARROT_MYKONOS_LOG_DELAY 50
43 #define DC_CTRL_PARROT_MYKONOS_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * DC_CTRL_PARROT_MYKONOS_PERIODIC_FREQ))
46 #ifndef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY
47 #define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY 5.0
49 #define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_FREQ))
52 #if DC_CTRL_PARROT_MYKONOS_SYNC_SEND
54 #include "pprzlink/messages.h"
61 static inline void dc_ctrl_parrot_mykonos_send_shot_position(
void)
110 #if DC_CTRL_PARROT_MYKONOS_LOG
129 int ret __attribute__((unused));
133 ret = system(
"media-ctl -l \'\"mt9f002 0-0010\":0->\"avicam.0\":0[1]\'");
134 ret = system(
"media-ctl -l \'\"avicam_dummy_dev.0\":0->\"avicam.0\":0[0]\'");
136 ret = system(
"prestart dxowrapperd");
137 ret = system(
"prestart pimp");
139 #if DC_CTRL_PARROT_MYKONOS_STREAM_AT_STARTUP
164 #if DC_CTRL_PARROT_MYKONOS_LOG
165 dc_ctrl_parrot_mykonos_log_shot_position();
168 #if DC_CTRL_PARROT_MYKONOS_SYNC_SEND
169 dc_ctrl_parrot_mykonos_send_shot_position();
211 int ret __attribute__((unused));
217 ret = system(
"pimpctl recording-start front");
225 ret = system(
"pimpctl recording-stop front");
232 ret = system(
"pimpctl take-picture front");
253 ret = system(
"pimpctl stream-start front 192.168.42.0 55004");
260 ret = system(
"pimpctl stream-stop front 192.168.42.0 55004");
268 ret = system(
"pimpctl take-picture front");
291 #ifdef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST
296 if (
VECT2_NORM2(d_pos) > (DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST * DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST)
303 #ifdef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST
#define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY
autoshoot timer delay based on periodic freq from modules.h
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
void dc_ctrl_parrot_mykonos_autoshoot(void)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Periodic telemetry system header (includes downlink utility and generated code).
enum dc_ctrl_parrot_mykonos_status status
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
vector in East North Up coordinates Units: meters
struct Dc_Ctrl_Parrot_Mykonos dc_ctrl_parrot_mykonos
Send report.
#define DC_CTRL_PARROT_MYKONOS_LOG_DELAY
delay in milli-seconds before logging after a shot in ms
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
void dc_ctrl_parrot_mykonos_periodic(void)
void dc_init(void)
initialize settings
Digital video/photo recorder control for Parrot Mykonos Platform, For others that is: control the cam...
int32_t hmsl
height above mean sea level (MSL) in mm
Standard Digital Camera Control Interface.
dc_ctrl_parrot_mykonos_status
Architecture independent timing functions.
uint32_t tow
GPS time of week in ms.
Device independent GPS code (interface)
void dc_send_command_common(uint8_t cmd)
Command sending function.
#define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_TIMER_OF_DELAY(_delay)
void dc_ctrl_parrot_mykonos_autoshoot_start(void)
void dc_send_command(uint8_t cmd)
Send Command To Camera.
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
#define DC_CTRL_PARROT_MYKONOS_TIMER_OF_DELAY(_delay)
Get timer from delay based on periodic freq from modules.h.
API to get/set the generic vehicle states.
void dc_periodic(void)
periodic function
#define DC_CTRL_PARROT_MYKONOS_RECORD_DELAY
NOTES: For now only the front cam is used, feel free to extend.
struct EnuCoor_f last_shot_pos
Common code for AP and FBW telemetry.
void dc_ctrl_parrot_mykonos_init(void)
void dc_ctrl_parrot_mykonos_command(enum dc_ctrl_parrot_mykonos_status cmd)
struct GpsState gps
global GPS state
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).