diff --git a/others/include/config/setconfig.h b/others/include/config/setconfig.h index ad02e32..86412d7 100644 --- a/others/include/config/setconfig.h +++ b/others/include/config/setconfig.h @@ -8,6 +8,21 @@ #warning "Without config.h" #endif +#ifndef CAMERA_EXPOSURE + #define CAMERA_EXPOSURE (10) +#endif + +#ifndef CAMERA_BLUE_GAIN + #define CAMERA_BLUE_GAIN (100) +#endif + +#ifndef CAMERA_GREEN_GAIN + #define CAMERA_GREEN_GAIN (100) +#endif + +#ifndef CAMERA_RED_GAIN + #define CAMERA_RED_GAIN (100) +#endif #ifndef ARMOR_CAMERA_GAIN #define ARMOR_CAMERA_GAIN (30) @@ -15,6 +30,7 @@ #ifndef ENERGY_CAMERA_GAIN #define ENERGY_CAMERA_GAIN (20) #endif + //#define GIMBAL_FLIP_MODE (-1) //#define CHASSIS_FLIP_MODE (-1) diff --git a/others/src/camera/camera_wrapper.cpp b/others/src/camera/camera_wrapper.cpp index cfad14e..901e6a6 100644 --- a/others/src/camera/camera_wrapper.cpp +++ b/others/src/camera/camera_wrapper.cpp @@ -5,6 +5,7 @@ #include #include #include +#include using namespace std; @@ -75,10 +76,10 @@ bool CameraWrapper::init() { LOGM("successfully loaded %s!", filepath); #elif defined(Linux) CameraSetAeState(h_camera, false); - CameraSetExposureTime(h_camera, 10*1000); - CameraSetAnalogGain(h_camera, 50); + CameraSetExposureTime(h_camera, CAMERA_EXPOSURE*1000); + CameraSetAnalogGain(h_camera, ARMOR_CAMERA_GAIN); if(mode == 0){ - CameraSetGain(h_camera, 100, 135, 119); + CameraSetGain(h_camera, CAMERA_BLUE_GAIN, CAMERA_GREEN_GAIN, CAMERA_RED_GAIN); CameraSetLutMode(h_camera, LUTMODE_PRESET); } #endif diff --git a/tools/auto-pull.sh b/tools/auto-pull.sh index 75effba..0a951b2 100755 --- a/tools/auto-pull.sh +++ b/tools/auto-pull.sh @@ -3,4 +3,5 @@ cd $(dirname $0)/../ timeout 8 git pull cd cmake-build-debug +cmake .. make -j4 diff --git a/tools/create-startup.sh b/tools/create-startup.sh index c81e515..2681763 100755 --- a/tools/create-startup.sh +++ b/tools/create-startup.sh @@ -2,5 +2,5 @@ echo "#!/bin/bash" > $2/startup-run echo "$1/tools/auto-pull.sh" >> $2/startup-run -echo "gnome-terminal -- bash -c \"echo sjturm | sudo -S $1/tools/monitor.sh \\\"$2/run --run-with-camera --save-video --wait-uart\\\"\"" >> $2/startup-run +echo "gnome-terminal -- bash -c \"echo sjturm | sudo -S $1/tools/monitor.sh \\\"$2/run --run-with-camera --save-video --wait-uart --save-labelled-boxes --show-armor-box\\\"\"" >> $2/startup-run chmod +x $2/startup-run