diff --git a/conf/modules/digital_cam.xml b/conf/modules/digital_cam.xml index 65a0b69359..f945e67f74 100644 --- a/conf/modules/digital_cam.xml +++ b/conf/modules/digital_cam.xml @@ -45,7 +45,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..1952ef3c95 100644 --- a/conf/modules/digital_cam_i2c.xml +++ b/conf/modules/digital_cam_i2c.xml @@ -9,7 +9,7 @@ - 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..4a66159e5f 100644 --- a/conf/modules/digital_cam_servo.xml +++ b/conf/modules/digital_cam_servo.xml @@ -12,7 +12,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_video.xml b/conf/modules/digital_cam_video.xml new file mode 100644 index 0000000000..1025869610 --- /dev/null +++ b/conf/modules/digital_cam_video.xml @@ -0,0 +1,54 @@ + + + + + Digital Camera Triggering of an embedded camera on a linux based autopilot. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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