diff --git a/conf/modules/digital_cam.xml b/conf/modules/digital_cam.xml index 65a0b69359..19b5a5e880 100644 --- a/conf/modules/digital_cam.xml +++ b/conf/modules/digital_cam.xml @@ -2,7 +2,12 @@ - Digital camera control (trigger using GPIO) + + 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. + @@ -45,7 +50,7 @@ - digital_cam_i2c,digital_cam_servo,digital_cam_uart + digital_cam_i2c,digital_cam_servo,digital_cam_uart,digital_cam_video
diff --git a/conf/modules/digital_cam_i2c.xml b/conf/modules/digital_cam_i2c.xml index b9251f15c7..b076bb9ee6 100644 --- a/conf/modules/digital_cam_i2c.xml +++ b/conf/modules/digital_cam_i2c.xml @@ -3,13 +3,17 @@ - Trigger Digital Camera (I2C). - Using I2C connected remote microcontroller + Digital Photo Camera Triggering (using a I2C channel) + + This module controls triggering of an attached device via an I2C command. + Typically a remote microcontroller (atmega/arduino) will then use the triggering/zoom/power commands. + Using the PAYLOAD_COMMAND, all functions of the camera can be controlled. + It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft. - digital_cam,digital_cam_servo,digital_cam_uart + digital_cam,digital_cam_servo,digital_cam_uart,digital_cam_video
diff --git a/conf/modules/digital_cam_servo.xml b/conf/modules/digital_cam_servo.xml index 8e1a7173e0..2f743d5111 100644 --- a/conf/modules/digital_cam_servo.xml +++ b/conf/modules/digital_cam_servo.xml @@ -2,7 +2,12 @@ - Digital camera control (trigger using servo) + + Digital Photo Camera Triggering (using a servo) + + This module controls triggering of an attached external digital camera via a servo channel. + It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft. + @@ -12,7 +17,7 @@ - digital_cam,digital_cam_i2c,digital_cam_uart + digital_cam,digital_cam_i2c,digital_cam_uart,digital_cam_video
diff --git a/conf/modules/digital_cam_shoot_rc.xml b/conf/modules/digital_cam_shoot_rc.xml index 5a8a29f10f..44ad80bebb 100644 --- a/conf/modules/digital_cam_shoot_rc.xml +++ b/conf/modules/digital_cam_shoot_rc.xml @@ -11,7 +11,7 @@ - digital_cam|digital_cam_servo|digital_cam_uart|digital_cam_i2c + digital_cam|digital_cam_servo|digital_cam_uart|digital_cam_i2c|digital_cam_video
diff --git a/conf/modules/digital_cam_uart.xml b/conf/modules/digital_cam_uart.xml index a05de2d799..c6bcf26f77 100644 --- a/conf/modules/digital_cam_uart.xml +++ b/conf/modules/digital_cam_uart.xml @@ -2,8 +2,23 @@ - Digital Camera Triggering over UART link. - Send attitude and other relevant data to a computer based photocamera after a shootphoto command is given. And in return get certain value back from the computerbased photocamera to be able to intercat with the flightplan. + Digital Photo Camera Triggering (using a UART link) + + This module controls triggering of an attached external digital camera via UART commands. + It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft. + + This module fullfilss 4 functions: + 1) send shoot commands over UART + 2) Besides triggering the shooting of images, the module also sends attitude and other relevant data. + Typically an external linux camera or linux computer will receive the attitude and position data and add + it to the photos. + 3) The module will also parse the replies received over the UART. This contains status but can also + contain computer vision results to able to interact with the flightplan. + 4) Finally, the module will also relay over telemetry all data it receives from the attached computer + or camera using the PAYLOAD message. This can for instance be used to downlink thumbnails. + + The linux program used to parse the UART command is given in the subdirectory. + diff --git a/conf/modules/digital_cam_video.xml b/conf/modules/digital_cam_video.xml new file mode 100644 index 0000000000..803a66fa22 --- /dev/null +++ b/conf/modules/digital_cam_video.xml @@ -0,0 +1,57 @@ + + + + + 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + video_rtp_stream + + digital_cam,digital_cam_servo,digital_cam_i2c,digital_cam_uart + +
+ + +
+ + + + + + + + + + + +
+ diff --git a/sw/airborne/modules/digital_cam/video_cam_ctrl.c b/sw/airborne/modules/digital_cam/video_cam_ctrl.c new file mode 100644 index 0000000000..ace93028ba --- /dev/null +++ b/sw/airborne/modules/digital_cam/video_cam_ctrl.c @@ -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; + } +} diff --git a/sw/airborne/modules/digital_cam/video_cam_ctrl.h b/sw/airborne/modules/digital_cam/video_cam_ctrl.h new file mode 100644 index 0000000000..3957ff402a --- /dev/null +++ b/sw/airborne/modules/digital_cam/video_cam_ctrl.h @@ -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