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
126 int ret __attribute__((unused));
130 ret = system(
"media-ctl -l \'\"mt9f002 0-0010\":0->\"avicam.0\":0[1]\'");
131 ret = system(
"media-ctl -l \'\"avicam_dummy_dev.0\":0->\"avicam.0\":0[0]\'");
133 ret = system(
"prestart dxowrapperd");
134 ret = system(
"prestart pimp");
136 #if DC_CTRL_PARROT_MYKONOS_STREAM_AT_STARTUP
161 #if DC_CTRL_PARROT_MYKONOS_LOG
162 dc_ctrl_parrot_mykonos_log_shot_position();
165 #if DC_CTRL_PARROT_MYKONOS_SYNC_SEND
166 dc_ctrl_parrot_mykonos_send_shot_position();
208 int ret __attribute__((unused));
214 ret = system(
"pimpctl recording-start front");
222 ret = system(
"pimpctl recording-stop front");
229 ret = system(
"pimpctl take-picture front");
250 ret = system(
"pimpctl stream-start front 192.168.42.0 55004");
257 ret = system(
"pimpctl stream-stop front 192.168.42.0 55004");
265 ret = system(
"pimpctl take-picture front");
288 #ifdef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST
293 if (
VECT2_NORM2(d_pos) > (DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST * DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST)
300 #ifdef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST
void dc_send_command(uint8_t cmd)
Send Command To Camera.
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
void dc_periodic(void)
periodic function
void dc_send_command_common(uint8_t cmd)
Command sending function.
Standard Digital Camera Control Interface.
void dc_ctrl_parrot_mykonos_autoshoot_start(void)
#define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY
autoshoot timer delay based on periodic freq from modules.h
#define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_TIMER_OF_DELAY(_delay)
void dc_ctrl_parrot_mykonos_autoshoot(void)
void dc_ctrl_parrot_mykonos_init(void)
#define DC_CTRL_PARROT_MYKONOS_RECORD_DELAY
NOTES: For now only the front cam is used, feel free to extend.
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
#define DC_CTRL_PARROT_MYKONOS_TIMER_OF_DELAY(_delay)
Get timer from delay based on periodic freq from modules.h.
void dc_ctrl_parrot_mykonos_command(enum dc_ctrl_parrot_mykonos_status cmd)
void dc_ctrl_parrot_mykonos_periodic(void)
Digital video/photo recorder control for Parrot Mykonos Platform, For others that is: control the cam...
enum dc_ctrl_parrot_mykonos_status status
struct EnuCoor_f last_shot_pos
dc_ctrl_parrot_mykonos_status
@ DC_CTRL_PARROT_MYKONOS_SHOOT
@ DC_CTRL_PARROT_MYKONOS_STREAM_START
@ DC_CTRL_PARROT_MYKONOS_RECORD_STOP
@ DC_CTRL_PARROT_MYKONOS_RECORD_START
@ DC_CTRL_PARROT_MYKONOS_STREAM_STOP
@ DC_CTRL_PARROT_MYKONOS_NONE
@ DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_START
@ DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_STOP
Common code for AP and FBW telemetry.
struct GpsState gps
global GPS state
Device independent GPS code (interface)
uint32_t tow
GPS time of week in ms.
int32_t hmsl
height above mean sea level (MSL) in mm
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
vector in East North Up coordinates Units: meters
API to get/set the generic vehicle states.
Architecture independent timing functions.
Periodic telemetry system header (includes downlink utility and generated code).
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.