ROS Hood Teleop Video Script
From wikidb
Contents
Master Script
#!/bin/bash DATE=$(date '+%Y%m%dT%H%M') LOGDIR=~/log LAUNCHDIR=~/catkin_ws_indigo/launch case "$1" in start) echo START roscore > $LOGDIR/roscore$DATE.log & sleep 5 pgrep -a roscore rosrun phidgets motor_control_hc > $LOGDIR/motors$DATE.log & sleep 5 pgrep -a motor_control roslaunch $LAUNCHDIR/usb_cam_server.launch > $LOGDIR/usb_cam$DATE.log & sleep 5 pgrep -a usb_cam rosrun web_video_server web_video_server > $LOGDIR/video_server$DATE.log & sleep 5 pgrep -a web_video_server ;; stop) echo STOP killall -SIGINT web_video_server killall -SIGINT usb_cam_node killall -SIGINT motor_control_hc killall -SIGINT roscore killall -SIGINT rosmaster ;; esac echo DONE
Web Cam Launch Script
In usb_cam_server.launch. See server script for launch command.
<launch> <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" > <param name="video_device" value="/dev/video0" /> <param name="image_width" value="320" /> <param name="image_height" value="240" /> <param name="pixel_format" value="mjpeg" /> <param name="camera_frame_id" value="usb_cam" /> <param name="io_method" value="mmap"/> </node> </launch>
Client Script
Runs on Adams and is the same as ROS Hood Teleop Script.
#!/bin/bash DATE=$(date '+%Y%m%dT%H%M') LOGDIR=~/log case "$1" in start) echo START roslaunch ~/catkin_ws/launch/teleop.launch > $LOGDIR/teleop$DATE.log & sleep 5 pgrep -a joy pgrep -a teleop ;; stop) echo STOP killall -SIGINT teleop_node killall -SIGINT joy_node ;; esac echo DONE
Capturing the Video in a browser
In web browser and click on image_raw
http://localhost:8080/
Configuration 1
- Client teleop on Adams
- Video capture in an Adams browser
This was unusable. There was substantial delay in the video display and real-time joystick control. This Asus 1000 EEE PC web tablet was introduced in 2008. It does no sufficient video throughput.
Configuration 1
- Client teleop on Adams
- Video capture in an iMac browser.
The video delay was substantially reduced. The Mac is a late 2009 with a 3.06 GHz Intel Core 2 Duo.
The real-time joystick control from the Asus web tablet had substantial delays. It made the robot nearly uncontrollable. TBD - Root cause. Is this a processor or network latency issue?