From 16bbf7df016db5282cd5a6a2a32f2e9447e667d2 Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Thu, 3 Sep 2015 13:22:07 +0200 Subject: [PATCH] [video_thread] simulation --- conf/airframes/BR/bebop_default.xml | 12 +++--- conf/airframes/BR/bebop_indi.xml | 12 +++--- .../ENAC/quadrotor/ard2_base_digit.xml | 1 + .../ENAC/quadrotor/ard2_base_vision.xml | 1 + conf/airframes/examples/ardrone2.xml | 1 + conf/modules/digital_cam_video.xml | 2 +- conf/modules/video_exif.xml | 2 + .../modules/computer_vision/video_thread.c | 5 +-- .../computer_vision/video_thread_nps.c | 43 +++++++++++++++++++ .../modules/computer_vision/viewvideo_nps.c | 3 -- 10 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 sw/airborne/modules/computer_vision/video_thread_nps.c diff --git a/conf/airframes/BR/bebop_default.xml b/conf/airframes/BR/bebop_default.xml index f260940a64d..bfec37fcd26 100644 --- a/conf/airframes/BR/bebop_default.xml +++ b/conf/airframes/BR/bebop_default.xml @@ -30,16 +30,18 @@ - - - - + + - + + + + + diff --git a/conf/airframes/BR/bebop_indi.xml b/conf/airframes/BR/bebop_indi.xml index 3d862a90fe5..cbbfa04ba34 100644 --- a/conf/airframes/BR/bebop_indi.xml +++ b/conf/airframes/BR/bebop_indi.xml @@ -35,16 +35,18 @@ - - - - + + - + + + + + diff --git a/conf/airframes/ENAC/quadrotor/ard2_base_digit.xml b/conf/airframes/ENAC/quadrotor/ard2_base_digit.xml index e8d4b5c50d4..80de02ddac9 100644 --- a/conf/airframes/ENAC/quadrotor/ard2_base_digit.xml +++ b/conf/airframes/ENAC/quadrotor/ard2_base_digit.xml @@ -36,6 +36,7 @@ + diff --git a/conf/airframes/ENAC/quadrotor/ard2_base_vision.xml b/conf/airframes/ENAC/quadrotor/ard2_base_vision.xml index acf6d6cc479..77e4f376586 100644 --- a/conf/airframes/ENAC/quadrotor/ard2_base_vision.xml +++ b/conf/airframes/ENAC/quadrotor/ard2_base_vision.xml @@ -36,6 +36,7 @@ + diff --git a/conf/airframes/examples/ardrone2.xml b/conf/airframes/examples/ardrone2.xml index d2db81d76b1..f901ed2b18b 100644 --- a/conf/airframes/examples/ardrone2.xml +++ b/conf/airframes/examples/ardrone2.xml @@ -32,6 +32,7 @@ + diff --git a/conf/modules/digital_cam_video.xml b/conf/modules/digital_cam_video.xml index 803a66fa223..0d20ec88e6f 100644 --- a/conf/modules/digital_cam_video.xml +++ b/conf/modules/digital_cam_video.xml @@ -34,7 +34,7 @@ - video_rtp_stream + video_thread digital_cam,digital_cam_servo,digital_cam_i2c,digital_cam_uart diff --git a/conf/modules/video_exif.xml b/conf/modules/video_exif.xml index ad8c2bdcb61..5820b32cca0 100644 --- a/conf/modules/video_exif.xml +++ b/conf/modules/video_exif.xml @@ -10,6 +10,8 @@ + video_thread +
diff --git a/sw/airborne/modules/computer_vision/video_thread.c b/sw/airborne/modules/computer_vision/video_thread.c index 19d7faaaf77..994a2d9118b 100644 --- a/sw/airborne/modules/computer_vision/video_thread.c +++ b/sw/airborne/modules/computer_vision/video_thread.c @@ -1,6 +1,5 @@ -/* - * Copyright (C) 2012-2014 The Paparazzi Community - * 2015 Freek van Tienen + /* + * Copyright (C) 2015 * * This file is part of Paparazzi. * diff --git a/sw/airborne/modules/computer_vision/video_thread_nps.c b/sw/airborne/modules/computer_vision/video_thread_nps.c new file mode 100644 index 00000000000..3462266429b --- /dev/null +++ b/sw/airborne/modules/computer_vision/video_thread_nps.c @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2015 + * + * 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. + */ + +/** + * Dummy C implementation for simulation + * The V4L2 could also work in simulation, but must be adapted a bit. + */ + +// Own header +#include "video_thread.h" + +// Initialize the video_thread structure with the defaults +struct video_thread_t video_thread = { + .is_running = FALSE, + .fps = 30, + .take_shot = FALSE, + .shot_number = 0 +}; + +// All dummy functions +void video_thread_init(void) {} +void video_thread_periodic(void) {} +void video_thread_start(void) {} +void video_thread_stop(void) {} +void video_thread_take_shot(bool_t take __attribute__((unused))) {} diff --git a/sw/airborne/modules/computer_vision/viewvideo_nps.c b/sw/airborne/modules/computer_vision/viewvideo_nps.c index f2f91a3ea33..ad6acaa3daa 100644 --- a/sw/airborne/modules/computer_vision/viewvideo_nps.c +++ b/sw/airborne/modules/computer_vision/viewvideo_nps.c @@ -32,9 +32,6 @@ struct viewvideo_t viewvideo = { .is_streaming = FALSE, .downsize_factor = 1, .quality_factor = 99, - .fps = 30, - .take_shot = FALSE, - .shot_number = 0 }; // All dummy functions