Skip to content

Commit

Permalink
[video_thread] simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Sep 3, 2015
1 parent e6ef983 commit 16bbf7d
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 17 deletions.
12 changes: 7 additions & 5 deletions conf/airframes/BR/bebop_default.xml
Expand Up @@ -30,16 +30,18 @@
<!--load name="logger_file.xml">
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
</load-->
<load name="video_rtp_stream.xml">
<define name="VIEWVIDEO_FPS" value="60"/>
<define name="VIEWVIDEO_QUALITY_FACTOR" value="80"/>
<define name="VIEWVIDEO_DOWNSIZE_FACTOR" value="1"/>
<load name="video_thread.xml">
<define name="VIEWVIDEO_FPS" value="4"/>
<define name="VIEWVIDEO_DEVICE" value="/dev/video0"/>
<define name="VIEWVIDEO_SUBDEV" value="/dev/v4l-subdev0"/>
<define name="VIEWVIDEO_DEVICE_SIZE" value="320,240"/>
<define name="VIEWVIDEO_DEVICE_SIZE" value="640,480"/>
<define name="VIEWVIDEO_DEVICE_BUFFERS" value="60"/>
<define name="VIEWVIDEO_SHOT_PATH" value="/data/ftp/internal_000/images"/>
</load>
<load name="video_rtp_stream.xml">
<define name="VIEWVIDEO_QUALITY_FACTOR" value="80"/>
<define name="VIEWVIDEO_DOWNSIZE_FACTOR" value="1"/>
</load>
</modules>

<commands>
Expand Down
12 changes: 7 additions & 5 deletions conf/airframes/BR/bebop_indi.xml
Expand Up @@ -35,16 +35,18 @@
<!--load name="logger_file.xml">
<define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
</load-->
<load name="video_rtp_stream.xml">
<define name="VIEWVIDEO_FPS" value="60"/>
<define name="VIEWVIDEO_QUALITY_FACTOR" value="80"/>
<define name="VIEWVIDEO_DOWNSIZE_FACTOR" value="1"/>
<load name="video_thread.xml">
<define name="VIEWVIDEO_FPS" value="4"/>
<define name="VIEWVIDEO_DEVICE" value="/dev/video0"/>
<define name="VIEWVIDEO_SUBDEV" value="/dev/v4l-subdev0"/>
<define name="VIEWVIDEO_DEVICE_SIZE" value="320,240"/>
<define name="VIEWVIDEO_DEVICE_SIZE" value="640,480"/>
<define name="VIEWVIDEO_DEVICE_BUFFERS" value="60"/>
<define name="VIEWVIDEO_SHOT_PATH" value="/data/ftp/internal_000/images"/>
</load>
<load name="video_rtp_stream.xml">
<define name="VIEWVIDEO_QUALITY_FACTOR" value="80"/>
<define name="VIEWVIDEO_DOWNSIZE_FACTOR" value="1"/>
</load>
</modules>

<commands>
Expand Down
1 change: 1 addition & 0 deletions conf/airframes/ENAC/quadrotor/ard2_base_digit.xml
Expand Up @@ -36,6 +36,7 @@
<load name="agl_dist.xml">
<define name="USE_SONAR"/>
</load>
<load name="video_thread.xml"/>
<load name="video_rtp_stream.xml">
<configure name="VIEWVIDEO_USE_NC" value="TRUE"/>
</load>
Expand Down
1 change: 1 addition & 0 deletions conf/airframes/ENAC/quadrotor/ard2_base_vision.xml
Expand Up @@ -36,6 +36,7 @@
<load name="agl_dist.xml">
<define name="USE_SONAR"/>
</load>
<load name="video_thread.xml"/>
<load name="video_rtp_stream.xml">
<define name="VIDEO_SOCK_OUT_OFFSET" value="$(AC_ID)"/>
<define name="VIDEO_DOWNSIZE_FACTOR" value="2"/>
Expand Down
1 change: 1 addition & 0 deletions conf/airframes/examples/ardrone2.xml
Expand Up @@ -32,6 +32,7 @@
<load name="air_data.xml"/>
<load name="geo_mag.xml"/>
<!--load name="logger_file.xml"/-->
<!--load name="video_thread.xml"/-->
<!--load name="video_rtp_stream.xml"/-->
</modules>

Expand Down
2 changes: 1 addition & 1 deletion conf/modules/digital_cam_video.xml
Expand Up @@ -34,7 +34,7 @@
</dl_settings>
</settings>

<depends>video_rtp_stream</depends>
<depends>video_thread</depends>

<conflicts>digital_cam,digital_cam_servo,digital_cam_i2c,digital_cam_uart</conflicts>

Expand Down
2 changes: 2 additions & 0 deletions conf/modules/video_exif.xml
Expand Up @@ -10,6 +10,8 @@
</description>
</doc>

<depends>video_thread</depends>

<header>
<file name="lib/exif/exif_module.h"/>
</header>
Expand Down
5 changes: 2 additions & 3 deletions sw/airborne/modules/computer_vision/video_thread.c
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2012-2014 The Paparazzi Community
* 2015 Freek van Tienen <freek.v.tienen@gmail.com>
/*
* Copyright (C) 2015
*
* This file is part of Paparazzi.
*
Expand Down
43 changes: 43 additions & 0 deletions 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))) {}
3 changes: 0 additions & 3 deletions sw/airborne/modules/computer_vision/viewvideo_nps.c
Expand Up @@ -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
Expand Down

0 comments on commit 16bbf7d

Please sign in to comment.