Add launching FPV camera to the launch-file

This commit is contained in:
Oleg Kalachev
2017-11-15 19:02:29 +03:00
parent 5c470bd870
commit b26cf3d3ec
3 changed files with 21 additions and 0 deletions

View File

@@ -6,6 +6,8 @@
<arg name="web_video_server" default="true"/>
<arg name="rosbridge" default="true"/>
<arg name="camera" default="false"/>
<arg name="fpv_camera" default="true"/>
<arg name="fpv_camera_device" default="/dev/v4l/by-id/usb-HD_Camera_Manufacturer_USB_2.0_Camera-video-index0"/>
<!-- mavros -->
<include file="$(find clever)/launch/mavros.launch">
@@ -29,4 +31,9 @@
<!-- rosbridge -->
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" if="$(arg rosbridge)"/>
<!-- FPV video streaming -->
<include file="$(find clever)/launch/fpv_camera.launch" if="$(arg fpv_camera)">
<arg name="device" value="$(arg fpv_camera_device)"/>
</include>
</launch>

View File

@@ -0,0 +1,6 @@
<launch>
<arg name="device"/>
<arg name="port" default="9999"/>
<node name="fpv_camera" pkg="clever" type="fpv_camera" args="$(arg device) $(arg port)" output="screen"/>
</launch>

8
clever/src/fpv_camera Normal file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Usage
# fpv_camera <video_device> <http port>
echo "Starting FPV camera $1 on :$2"
cd /home/pi/mjpg-streamer/mjpg-streamer-experimental
./mjpg_streamer -i "./input_uvc.so -d $1 -r 1024x720 -f 30" -o "./output_http.so -w ./www -p $2"