mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-01 04:46:51 +08:00
[module] digital_cam_video
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
</dl_settings>
|
</dl_settings>
|
||||||
</settings>
|
</settings>
|
||||||
|
|
||||||
<conflicts>digital_cam_i2c,digital_cam_servo,digital_cam_uart</conflicts>
|
<conflicts>digital_cam_i2c,digital_cam_servo,digital_cam_uart,digital_cam_video</conflicts>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<file name="gpio_cam_ctrl.h"/>
|
<file name="gpio_cam_ctrl.h"/>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<define name="DC_SHOOT_ON_BUTTON_RELEASE" />
|
<define name="DC_SHOOT_ON_BUTTON_RELEASE" />
|
||||||
<define name="DC_SHOT_SYNC_SEND" value="TRUE|FALSE" description="send DC_SHOT message when photo was taken (default: TRUE)"/>
|
<define name="DC_SHOT_SYNC_SEND" value="TRUE|FALSE" description="send DC_SHOT message when photo was taken (default: TRUE)"/>
|
||||||
</doc>
|
</doc>
|
||||||
<conflicts>digital_cam,digital_cam_servo,digital_cam_uart</conflicts>
|
<conflicts>digital_cam,digital_cam_servo,digital_cam_uart,digital_cam_video</conflicts>
|
||||||
<header>
|
<header>
|
||||||
<file name="atmega_i2c_cam_ctrl.h"/>
|
<file name="atmega_i2c_cam_ctrl.h"/>
|
||||||
<file name="dc.h"/>
|
<file name="dc.h"/>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<define name="DC_AUTOSHOOT_DISTANCE_INTERVAL" value="50" description="grid in meters"/>
|
<define name="DC_AUTOSHOOT_DISTANCE_INTERVAL" value="50" description="grid in meters"/>
|
||||||
</doc>
|
</doc>
|
||||||
|
|
||||||
<conflicts>digital_cam,digital_cam_i2c,digital_cam_uart</conflicts>
|
<conflicts>digital_cam,digital_cam_i2c,digital_cam_uart,digital_cam_video</conflicts>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<file name="servo_cam_ctrl.h"/>
|
<file name="servo_cam_ctrl.h"/>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</description>
|
</description>
|
||||||
<define name="DC_RADIO_SHOOT" value="RADIO_xxx" description="specifies the channel to be used to trigger the camera by radio transmiter"/>
|
<define name="DC_RADIO_SHOOT" value="RADIO_xxx" description="specifies the channel to be used to trigger the camera by radio transmiter"/>
|
||||||
</doc>
|
</doc>
|
||||||
<depends>digital_cam|digital_cam_servo|digital_cam_uart|digital_cam_i2c</depends>
|
<depends>digital_cam|digital_cam_servo|digital_cam_uart|digital_cam_i2c|digital_cam_video</depends>
|
||||||
<header>
|
<header>
|
||||||
<file name="dc_shoot_rc.h"/>
|
<file name="dc_shoot_rc.h"/>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<!DOCTYPE module SYSTEM "module.dtd">
|
||||||
|
<module name="video_cam_ctrl" dir="digital_cam">
|
||||||
|
<doc>
|
||||||
|
<description>
|
||||||
|
Digital Camera Triggering of an embedded camera on a linux based autopilot.
|
||||||
|
</description>
|
||||||
|
<define name="DC_AUTOSHOOT_PERIOD" value="0.5" description="time period for DC_AUTOSHOOT_PERIODIC in seconds"/>
|
||||||
|
<define name="DC_AUTOSHOOT_DISTANCE_INTERVAL" value="50" description="grid in meters"/>
|
||||||
|
<define name="DC_SHOT_SYNC_SEND" value="TRUE|FALSE" description="send DC_SHOT message when photo was taken (default: TRUE)"/>
|
||||||
|
</doc>
|
||||||
|
<settings>
|
||||||
|
<dl_settings name="control">
|
||||||
|
<dl_settings name="dc">
|
||||||
|
|
||||||
|
<dl_setting max="255" min="0" step="1" module="digital_cam/dc" var="0" handler="send_command" shortname="Shutter">
|
||||||
|
<strip_button name="Photo" icon="digital-camera.png" value="32" group="maindc"/>
|
||||||
|
</dl_setting>
|
||||||
|
|
||||||
|
<dl_setting max="3" min="0" step="1" var="dc_autoshoot" values="STOP|PERIODIC|DISTANCE|EXT_TRIG">
|
||||||
|
<strip_button name="Start Autoshoot" icon="on.png" value="1" group="dcauto"/>
|
||||||
|
<strip_button name="Stop Autoshoot" icon="off.png" value="0" group="dcauto"/>
|
||||||
|
</dl_setting>
|
||||||
|
|
||||||
|
<dl_setting max="60" min="0.1" step="0.5" var="dc_autoshoot_period" shortname="Periodic" param="DC_AUTOSHOOT_PERIOD" unit="sec"/>
|
||||||
|
<dl_setting max="255" min="0" step="1" var="dc_distance_interval" shortname="dist" param="DC_AUTOSHOOT_DISTANCE_INTERVAL" unit="meter"/>
|
||||||
|
|
||||||
|
<dl_setting max="250" min="0" step="5" module="digital_cam/dc" var="dc_survey_interval" handler="Survey" shortname="Survey-Interval"/>
|
||||||
|
<dl_setting max="90" min="5" step="5" module="digital_cam/dc" var="dc_circle_interval" handler="Circle" shortname="Circle-Interval"/>
|
||||||
|
<dl_setting max="1" min="0" step="1" var="dc_cam_tracing" shortname="Cam-Tracing"/>
|
||||||
|
</dl_settings>
|
||||||
|
</dl_settings>
|
||||||
|
</settings>
|
||||||
|
|
||||||
|
<depends>video_rtp_stream</depends>
|
||||||
|
|
||||||
|
<conflicts>digital_cam,digital_cam_servo,digital_cam_i2c,digital_cam_uart</conflicts>
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<file name="video_cam_ctrl.h"/>
|
||||||
|
<file name="dc.h"/>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<init fun="digital_cam_video_init()"/>
|
||||||
|
|
||||||
|
<periodic fun="digital_cam_video_periodic()" freq="10" autorun="TRUE"/>
|
||||||
|
|
||||||
|
<makefile target="ap|sim|nps">
|
||||||
|
<define name="DIGITAL_CAM" />
|
||||||
|
<file name="video_cam_ctrl.c"/>
|
||||||
|
<file name="dc.c"/>
|
||||||
|
</makefile>
|
||||||
|
|
||||||
|
</module>
|
||||||
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C)
|
||||||
|
*
|
||||||
|
* This file is part of paparazzi.
|
||||||
|
*
|
||||||
|
* paparazzi is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* paparazzi is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with paparazzi; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file modules/digital_cam/video_cam_ctrl.c
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "video_cam_ctrl.h"
|
||||||
|
#include "generated/airframe.h"
|
||||||
|
|
||||||
|
// Include Standard Camera Control Interface
|
||||||
|
#include "modules/digital_cam/dc.h"
|
||||||
|
|
||||||
|
|
||||||
|
void digital_cam_video_init(void)
|
||||||
|
{
|
||||||
|
// Call common DC init
|
||||||
|
dc_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void digital_cam_video_periodic(void)
|
||||||
|
{
|
||||||
|
// Common DC Periodic task
|
||||||
|
dc_periodic();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef SITL
|
||||||
|
#include "viewvideo.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Command The Camera */
|
||||||
|
void dc_send_command(uint8_t cmd)
|
||||||
|
{
|
||||||
|
switch (cmd) {
|
||||||
|
case DC_SHOOT:
|
||||||
|
#ifndef SITL
|
||||||
|
viewvideo_take_shot(TRUE);
|
||||||
|
#endif
|
||||||
|
dc_send_shot_position();
|
||||||
|
break;
|
||||||
|
case DC_TALLER:
|
||||||
|
break;
|
||||||
|
case DC_WIDER:
|
||||||
|
break;
|
||||||
|
case DC_ON:
|
||||||
|
break;
|
||||||
|
case DC_OFF:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C)
|
||||||
|
*
|
||||||
|
* This file is part of paparazzi.
|
||||||
|
*
|
||||||
|
* paparazzi is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* paparazzi is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with paparazzi; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file modules/digital_cam/video_cam_ctrl.h
|
||||||
|
* @brief Digital Camera Control: controls triggering of an embedded digital camera on a linux based autopilot
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DIGITAL_CAM_VIDEO_H
|
||||||
|
#define DIGITAL_CAM_VIDEO_H
|
||||||
|
|
||||||
|
#include "modules/digital_cam/dc.h"
|
||||||
|
|
||||||
|
extern void digital_cam_video_init(void);
|
||||||
|
|
||||||
|
extern void digital_cam_video_periodic(void);
|
||||||
|
|
||||||
|
#endif // GPIO_CAM_CTRL_H
|
||||||
Reference in New Issue
Block a user