jetpack-4.4.1 #4

Closed
dchvs wants to merge 4 commits from jetpack-4.4.1 into hotfix/fix-low-framerate
1 changed files with 29 additions and 0 deletions
Showing only changes of commit d431b4bc3b - Show all commits

View File

@ -0,0 +1,29 @@
#!/bin/bash
initial_gain=0
initial_exposure_time=0
while true; do sleep 0.5;
# Read center camera controls
echo `v4l2-ctl -d /dev/video1 --get-ctrl=gain --get-ctrl=exposure` > controls
awk '{print $2}' controls > get_control
actual_gain=`cat get_control`
awk '{print $4}' controls > get_control
actual_exposure_time=`cat get_control`
# Print controls
#echo -e "\n**Center Camera Controls**"
#cat controls
# Remove temp files
rm controls get_control
# Set R/L camera controls manually
if [ $actual_gain -ne $initial_gain ]; then
v4l2-ctl -d /dev/video0 --set-ctrl=gain=$actual_gain
fi
if [ $actual_exposure_time -ne $initial_exposure_time ]; then
v4l2-ctl -d /dev/video0 --set-ctrl=exposure=$actual_exposure_time
fi
# Define new initial value
initial_gain=$actual_gain
initial_exposure_time=$actual_exposure_time
done