Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1323 from paparazzi/digital_cam_video
[module] digital_cam_video
- Loading branch information
Showing
8 changed files
with
202 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE module SYSTEM "module.dtd"> | ||
<module name="video_cam_ctrl" dir="digital_cam"> | ||
<doc> | ||
<description> | ||
Digital Photo Camera Triggering (using embedded video) | ||
|
||
This module controls triggering of an embedded digital camera on a linux based autopilot. This particular version triggers the video_rtp_stream.xml module to store jpeg images. | ||
It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft. | ||
</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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |