-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dc] add pprzlink digital cam module and factorize modules (#3111)
- new digital_cam_pprzlink module - factorize module with digital_cam_common - rename digital_cam to digital_cam_gpio - add test nodes to modules
- Loading branch information
1 parent
63fd583
commit 6948aef
Showing
24 changed files
with
317 additions
and
178 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
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 |
---|---|---|
@@ -1,74 +1,20 @@ | ||
<!DOCTYPE module SYSTEM "./module.dtd"> | ||
|
||
<module name="digital_cam"> | ||
<module name="digital_cam" dir="digital_cam"> | ||
<doc> | ||
<description> | ||
Digital Photo Camera Triggering (using a GPIO pin) | ||
|
||
This module controls triggering of an attached external digital camera via one or more GPIO pins for on/off/shoot/zoom. | ||
It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft. | ||
Deprecated, use digital_cam_gpio module instead | ||
</description> | ||
<define name="DC_SHOOT_ON_BUTTON_RELEASE" description="if defined, call dc_send_shot_postion on button release instead of on push"/> | ||
<define name="DC_SHUTTER_GPIO" value="GPIOC,GPIO12" description="mandatory, gpio to control shutter"/> | ||
<define name="DC_ZOOM_IN_GPIO" value="GPIOC,GPIO2" description="optional, gpio to activate zoom in"/> | ||
<define name="DC_ZOOM_OUT_GPIO" value="GPIOC,GPIO5" description="optional, gpio to activate zoom out"/> | ||
<define name="DC_POWER_GPIO" value="GPIOB,GPIO1" description="optional, gpio to turn power on"/> | ||
<define name="DC_POWER_OFF_GPIO" value="GPIOC,GPIO1" description="optional, gpio to turn power off"/> | ||
<define name="DC_PUSH" value="gpio_set|gpio_clear" description="specifies whether to set or clear gpio to push the shutter (default: gpio_set)"/> | ||
<define name="DC_RELEASE" value="gpio_clear|gpio_set" description="specifies whether to set or clear gpio to release the shutter (default: gpio_clear)"/> | ||
<define name="DC_SHUTTER_DELAY" value="0.5" description="how long to push shutter in seconds"/> | ||
<define name="DC_POWER_OFF_DELAY" value="0.75" description="how long to send power off in seconds"/> | ||
|
||
<define name="DC_AUTOSHOOT_PERIOD" value="1.0" description="time period for DC_AUTOSHOOT_PERIODIC in seconds"/> | ||
<define name="DC_AUTOSHOOT_DISTANCE_INTERVAL" value="50" description="distance interval for DC_AUTOSHOOT_DISTANCE in meters"/> | ||
<define name="DC_AUTOSHOOT_SURVEY_INTERVAL" value="50" description="distance interval for DC_AUTOSHOOT_SURVEY in meters"/> | ||
<define name="DC_SHOT_SYNC_SEND" value="TRUE|FALSE" description="send DC_SHOT message when photo was taken (default: TRUE)"/> | ||
<define name="DC_SHOT_EXTRA_DL" value="TRUE|FALSE" description="send DC_SHOT message other extra datalink like companion CPU (default: FALSE, requires DC_SHOT_SYNC_SEND)"/> | ||
</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"/> | ||
<strip_button name="Power" icon="off.png" value="111" group="maindc"/> | ||
<strip_button name="ZoomIn" icon="zoom.png" value="116" group="dczoom"/> | ||
<strip_button name="ZoomOut" icon="zoom.png" value="119" group="dczoom"/> | ||
</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="dcstart.png" value="1" group="dcauto"/> | ||
<strip_button name="Stop Autoshoot" icon="dcstart.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> | ||
|
||
<dep> | ||
<conflicts>digital_cam_i2c,digital_cam_servo,digital_cam_uart,digital_cam_video</conflicts> | ||
<provides>digital_cam</provides> | ||
<depends>digital_cam_gpio</depends> | ||
</dep> | ||
|
||
<header> | ||
<file name="gpio_cam_ctrl.h"/> | ||
<file name="dc.h"/> | ||
</header> | ||
|
||
<init fun="gpio_cam_ctrl_init()"/> | ||
|
||
<periodic fun="gpio_cam_ctrl_periodic()" freq="10" autorun="TRUE"/> | ||
|
||
<makefile target="ap|sim|nps"> | ||
<define name="DIGITAL_CAM" /> | ||
<file name="gpio_cam_ctrl.c"/> | ||
<file name="dc.c"/> | ||
<makefile> | ||
<raw> | ||
$(warning Warning: digital_cam is deprecated. Use digital_cam_gpio instead.) | ||
</raw> | ||
</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,61 @@ | ||
<!DOCTYPE module SYSTEM "./module.dtd"> | ||
|
||
<module name="digital_cam_common" dir="digital_cam"> | ||
<doc> | ||
<description> | ||
Digital Photo Camera Triggering, common interface | ||
|
||
This module controls triggering of an attached external digital camera. | ||
It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft. | ||
The specific way to trigger the camera is implemented in specific modules. | ||
</description> | ||
<section name="DIGITAL_CAM" prefix="DC_"> | ||
<define name="AUTOSHOOT_PERIOD" value="1.0" description="time period for DC_AUTOSHOOT_PERIODIC in seconds"/> | ||
<define name="AUTOSHOOT_DISTANCE_INTERVAL" value="50" description="distance interval for DC_AUTOSHOOT_DISTANCE in meters"/> | ||
<define name="AUTOSHOOT_SURVEY_INTERVAL" value="50" description="distance interval for DC_AUTOSHOOT_SURVEY in meters"/> | ||
<define name="SHOT_SYNC_SEND" value="TRUE|FALSE" description="send DC_SHOT message when photo was taken (default: TRUE)"/> | ||
<define name="SHOT_EXTRA_DL" value="TRUE|FALSE" description="send DC_SHOT message other extra datalink like companion CPU (default: FALSE, requires DC_SHOT_SYNC_SEND)"/> | ||
</section> | ||
</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"/> | ||
<strip_button name="Power" icon="off.png" value="111" group="maindc"/> | ||
<strip_button name="ZoomIn" icon="zoom.png" value="116" group="dczoom"/> | ||
<strip_button name="ZoomOut" icon="zoom.png" value="119" group="dczoom"/> | ||
</dl_setting> | ||
|
||
<dl_setting max="3" min="0" step="1" var="dc_autoshoot" values="STOP|PERIODIC|DISTANCE|EXT_TRIG|SURVEY|CIRCLE"> | ||
<strip_button name="Start Autoshoot" icon="dcstart.png" value="1" group="dcauto"/> | ||
<strip_button name="Stop Autoshoot" icon="dcstart.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> | ||
<dep> | ||
<provides>digital_cam</provides> | ||
</dep> | ||
<header> | ||
<file name="dc.h"/> | ||
</header> | ||
<init fun="dc_init()"/> | ||
<makefile> | ||
<define name="DIGITAL_CAM" /> | ||
<file name="dc.c"/> | ||
<test firmware="rotorcraft"> | ||
<define name="DOWNLINK_TRANSPORT" value="pprz_tp"/> | ||
<define name="DOWNLINK_DEVICE" value="uart0"/> | ||
<define name="USE_UART0"/> | ||
</test> | ||
</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,39 @@ | ||
<!DOCTYPE module SYSTEM "./module.dtd"> | ||
|
||
<module name="digital_cam_gpio" dir="digital_cam"> | ||
<doc> | ||
<description> | ||
Digital Photo Camera Triggering (using a GPIO pin) | ||
|
||
This module controls triggering of an attached external digital camera via one or more GPIO pins for on/off/shoot/zoom. | ||
</description> | ||
<section name="DIGITAL_CAM" prefix="DC_"> | ||
<define name="SHOOT_ON_BUTTON_RELEASE" description="if defined, call dc_send_shot_postion on button release instead of on push"/> | ||
<define name="SHUTTER_GPIO" value="GPIOC,GPIO12" description="mandatory, gpio to control shutter"/> | ||
<define name="ZOOM_IN_GPIO" value="GPIOC,GPIO2" description="optional, gpio to activate zoom in"/> | ||
<define name="ZOOM_OUT_GPIO" value="GPIOC,GPIO5" description="optional, gpio to activate zoom out"/> | ||
<define name="POWER_GPIO" value="GPIOB,GPIO1" description="optional, gpio to turn power on"/> | ||
<define name="POWER_OFF_GPIO" value="GPIOC,GPIO1" description="optional, gpio to turn power off"/> | ||
<define name="PUSH" value="gpio_set|gpio_clear" description="specifies whether to set or clear gpio to push the shutter (default: gpio_set)"/> | ||
<define name="RELEASE" value="gpio_clear|gpio_set" description="specifies whether to set or clear gpio to release the shutter (default: gpio_clear)"/> | ||
<define name="SHUTTER_DELAY" value="0.5" description="how long to push shutter in seconds"/> | ||
<define name="POWER_OFF_DELAY" value="0.75" description="how long to send power off in seconds"/> | ||
</section> | ||
</doc> | ||
<dep> | ||
<depends>digital_cam_common</depends> | ||
<conflicts>digital_cam_i2c,digital_cam_servo,digital_cam_uart,digital_cam_video,digital_cam_pprzlink</conflicts> | ||
</dep> | ||
<header> | ||
<file name="gpio_cam_ctrl.h"/> | ||
</header> | ||
<init fun="gpio_cam_ctrl_init()"/> | ||
<periodic fun="gpio_cam_ctrl_periodic()" freq="10" autorun="TRUE"/> | ||
<makefile> | ||
<file name="gpio_cam_ctrl.c"/> | ||
<test arch="chibios"> | ||
<define name="DC_SHUTTER_GPIO" value="GPIOC,GPIO12"/> | ||
<define name="GPIO_CAM_CTRL_PERIODIC_FREQ" value="10."/> | ||
</test> | ||
</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
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,42 @@ | ||
<!DOCTYPE module SYSTEM "./module.dtd"> | ||
|
||
<module name="digital_cam_pprzlink" dir="digital_cam"> | ||
<doc> | ||
<description> | ||
Digital Photo Camera Triggering using PPRZLINK messages | ||
|
||
Sends DC_SHOT and PAYLOAD_COMMAND messages over serial link. | ||
Flags DC_SHOT_SYNC_SEND and DC_SHOT_EXTRA_DL are set to TRUE. | ||
|
||
An example application can be found at: https://github.com/enacuavlab/ueye_pprzlink | ||
This project controls a ueye camera with a NanoPI (or equivalent) | ||
connected to the autopilot. It is possible to trigger the camera | ||
with DC_SHOT messages (images are georeference with GPS coordinates | ||
in Exif), but also to change the exposure and get the feedback | ||
from the camera (useful to check the result when autoexpo is requested). | ||
</description> | ||
</doc> | ||
<dep> | ||
<depends>digital_cam_common,extra_dl</depends> | ||
<conflicts>digital_cam_gpio,digital_cam_i2c,digital_cam_servo,digital_cam_uart,digital_cam_video</conflicts> | ||
</dep> | ||
<header> | ||
<file name="pprzlink_cam_ctrl.h"/> | ||
</header> | ||
<init fun="pprzlink_cam_ctrl_init()"/> | ||
<periodic fun="pprzlink_cam_ctrl_periodic()" freq="10" autorun="TRUE"/> | ||
<datalink message="PAYLOAD_COMMAND" fun="dc_expo_cb(buf)"/> | ||
<makefile target="ap|sim|nps"> | ||
<define name="DIGITAL_CAM"/> | ||
<define name="DC_SHOT_SYNC_SEND"/> | ||
<define name="DC_SHOT_EXTRA_DL"/> | ||
<file name="pprzlink_cam_ctrl.c"/> | ||
<test> | ||
<define name="DOWNLINK_TRANSPORT" value="pprz_tp"/> | ||
<define name="DOWNLINK_DEVICE" value="uart0"/> | ||
<define name="USE_UART0"/> | ||
<define name="EXTRA_DOWNLINK_DEVICE" value="uart1"/> | ||
<define name="USE_UART1"/> | ||
</test> | ||
</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
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
Oops, something went wrong.