Merge remote-tracking branch 'origin/master'

# Conflicts:
#	main.cpp
This commit is contained in:
sun
2019-07-15 15:45:08 +08:00
4 changed files with 22 additions and 4 deletions

View File

@@ -8,6 +8,21 @@
#warning "Without config.h" #warning "Without config.h"
#endif #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 #ifndef ARMOR_CAMERA_GAIN
#define ARMOR_CAMERA_GAIN (30) #define ARMOR_CAMERA_GAIN (30)
@@ -15,6 +30,7 @@
#ifndef ENERGY_CAMERA_GAIN #ifndef ENERGY_CAMERA_GAIN
#define ENERGY_CAMERA_GAIN (20) #define ENERGY_CAMERA_GAIN (20)
#endif #endif
//#define GIMBAL_FLIP_MODE (-1) //#define GIMBAL_FLIP_MODE (-1)
//#define CHASSIS_FLIP_MODE (-1) //#define CHASSIS_FLIP_MODE (-1)

View File

@@ -5,6 +5,7 @@
#include <camera/camera_wrapper.h> #include <camera/camera_wrapper.h>
#include <log.h> #include <log.h>
#include <options/options.h> #include <options/options.h>
#include <config/setconfig.h>
using namespace std; using namespace std;
@@ -75,10 +76,10 @@ bool CameraWrapper::init() {
LOGM("successfully loaded %s!", filepath); LOGM("successfully loaded %s!", filepath);
#elif defined(Linux) #elif defined(Linux)
CameraSetAeState(h_camera, false); CameraSetAeState(h_camera, false);
CameraSetExposureTime(h_camera, 10*1000); CameraSetExposureTime(h_camera, CAMERA_EXPOSURE*1000);
CameraSetAnalogGain(h_camera, 50); CameraSetAnalogGain(h_camera, ARMOR_CAMERA_GAIN);
if(mode == 0){ 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); CameraSetLutMode(h_camera, LUTMODE_PRESET);
} }
#endif #endif

View File

@@ -3,4 +3,5 @@
cd $(dirname $0)/../ cd $(dirname $0)/../
timeout 8 git pull timeout 8 git pull
cd cmake-build-debug cd cmake-build-debug
cmake ..
make -j4 make -j4

View File

@@ -2,5 +2,5 @@
echo "#!/bin/bash" > $2/startup-run echo "#!/bin/bash" > $2/startup-run
echo "$1/tools/auto-pull.sh" >> $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 chmod +x $2/startup-run