Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | cd /root/ |
| 6 | |
| 7 | sleep 1 |
| 8 | |
| 9 | echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
| 10 | |
| 11 | sleep 1 |
| 12 | |
| 13 | |
| 14 | # Comp Bot |
| 15 | # while [ ! -e /dev/v4l/by-id/usb-046d_0825_A17C8DE0-video-index0 ] ; do echo no camera1 && sleep 1 ; done |
| 16 | # while [ ! -e /dev/v4l/by-id/usb-046d_0825_B914CDE0-video-index0 ] ; do echo no camera2 && sleep 1 ; done |
| 17 | # Practice Bot |
| 18 | # while [ ! -e /dev/v4l/by-id/usb-046d_0825_9224CDE0-video-index0 ] ; do echo no camera1 && sleep 1 ; done |
| 19 | # while [ ! -e /dev/v4l/by-id/usb-046d_0825_B07B8DE0-video-index0 ] ; do echo no camera2 && sleep 1 ; done |
| 20 | |
| 21 | # v4l2-ctl --set-ctrl="exposure_auto=1" -d /dev/video0 |
| 22 | # sleep 0.5 |
| 23 | # v4l2-ctl --set-ctrl="exposure_auto=1" -d /dev/video1 |
| 24 | # sleep 2 |
| 25 | # echo All done disabling auto-exposure |
| 26 | # v4l2-ctl --set-ctrl="exposure_absolute=20" -d /dev/video0 |
| 27 | # sleep 0.5 |
| 28 | # v4l2-ctl --set-ctrl="exposure_absolute=20" -d /dev/video1 |
| 29 | # sleep 1 |
| 30 | # echo All done setting exposure |
| 31 | |
| 32 | # echo "Starting target sender now." |
Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 33 | |
Austin Schuh | 8d5fff4 | 2018-05-30 20:44:12 -0700 | [diff] [blame^] | 34 | for CAMERA in /dev/video0 /dev/video1 |
| 35 | do |
| 36 | echo $CAMERA |
Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 37 | |
Austin Schuh | 8d5fff4 | 2018-05-30 20:44:12 -0700 | [diff] [blame^] | 38 | v4l2-ctl --set-ctrl="exposure_auto=1" -d $CAMERA |
| 39 | sleep 0.5 |
| 40 | v4l2-ctl --set-ctrl="exposure_absolute=100" -d $CAMERA |
| 41 | sleep 0.5 |
Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 42 | |
Austin Schuh | 8d5fff4 | 2018-05-30 20:44:12 -0700 | [diff] [blame^] | 43 | PATH="./;$PATH" |
Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 44 | |
Austin Schuh | 8d5fff4 | 2018-05-30 20:44:12 -0700 | [diff] [blame^] | 45 | /root/camera_primer $CAMERA |
| 46 | done |
Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 47 | |
| 48 | # Run a script to reset the exposure a few times and exit. |
| 49 | /root/exposure_2018.sh & |
| 50 | |
Austin Schuh | 8d5fff4 | 2018-05-30 20:44:12 -0700 | [diff] [blame^] | 51 | exec /root/image_streamer --single_camera=false |
Parker Schuh | c1975fc | 2018-04-07 15:27:07 -0700 | [diff] [blame] | 52 | #exec ./target_sender Practice |
| 53 | #exec ./target_sender Comp |
| 54 | #exec ./target_sender Spare |