fix bug.
This commit is contained in:
@@ -40,5 +40,5 @@ void Energy::judgeShootInGimbal() {
|
|||||||
} else
|
} else
|
||||||
shoot = 2;
|
shoot = 2;
|
||||||
|
|
||||||
// cout << "yaw: " << yaw_rotation << '\t' << "pitch: " << pitch_rotation << endl;
|
cout << "yaw: " << yaw_rotation << '\t' << "pitch: " << pitch_rotation << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ void Energy::sendTarget(Serial &serial, float x, float y, uint16_t z, uint16_t u
|
|||||||
time_t t = time(nullptr);
|
time_t t = time(nullptr);
|
||||||
if (last_time != t) {
|
if (last_time != t) {
|
||||||
last_time = t;
|
last_time = t;
|
||||||
cout << "fps:" << fps << ", (" << x << "," << y << "," << z << "," << u << ")" << endl;
|
cout << "fps:" << fps << ", (" << x << "," << y << "," << z << ")" << endl;
|
||||||
fps = 0;
|
fps = 0;
|
||||||
}
|
}
|
||||||
fps += 1;
|
fps += 1;
|
||||||
|
|||||||
4
main.cpp
4
main.cpp
@@ -120,8 +120,8 @@ int main(int argc, char *argv[]) {
|
|||||||
if (!from_camera) extract(gimbal_src, chassis_src);
|
if (!from_camera) extract(gimbal_src, chassis_src);
|
||||||
if (save_video) saveVideos(gimbal_src, chassis_src);//保存视频
|
if (save_video) saveVideos(gimbal_src, chassis_src);//保存视频
|
||||||
if (show_origin) showOrigin(gimbal_src, chassis_src);//显示原始图像
|
if (show_origin) showOrigin(gimbal_src, chassis_src);//显示原始图像
|
||||||
// energy.runBig(gimbal_src, chassis_src);
|
energy.runBig(gimbal_src, chassis_src);
|
||||||
energy.runBig(gimbal_src);
|
// energy.runBig(gimbal_src);
|
||||||
last_state = mcuData.state;//更新上一帧状态
|
last_state = mcuData.state;//更新上一帧状态
|
||||||
} else if (mcuData.state == SMALL_ENERGY_STATE) {
|
} else if (mcuData.state == SMALL_ENERGY_STATE) {
|
||||||
if (mcuData.state != SMALL_ENERGY_STATE) {
|
if (mcuData.state != SMALL_ENERGY_STATE) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#define ARMOR_CAMERA_GAIN (30)
|
#define ARMOR_CAMERA_GAIN (30)
|
||||||
#endif
|
#endif
|
||||||
#ifndef ENERGY_CAMERA_GAIN
|
#ifndef ENERGY_CAMERA_GAIN
|
||||||
#define ENERGY_CAMERA_GAIN (20)
|
#define ENERGY_CAMERA_GAIN (30)
|
||||||
#endif
|
#endif
|
||||||
#ifndef AIM_KP
|
#ifndef AIM_KP
|
||||||
#define AIM_KP (6)
|
#define AIM_KP (6)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void uartReceive(Serial *pSerial) {
|
|||||||
pSerial->ReadData((uint8_t *) buffer, sizeof(mcuData)+1);
|
pSerial->ReadData((uint8_t *) buffer, sizeof(mcuData)+1);
|
||||||
if (buffer[sizeof(mcuData)] == '\n') {
|
if (buffer[sizeof(mcuData)] == '\n') {
|
||||||
memcpy(&mcuData, buffer, sizeof(mcuData));
|
memcpy(&mcuData, buffer, sizeof(mcuData));
|
||||||
// LOGM("Get, state:%c, mark:%d!", mcuData.state, (int) mcuData.mark);
|
LOGM("Get, state:%c, mark:%d!", mcuData.state, (int) mcuData.mark);
|
||||||
// LOGM("Get yaw: %f, pitch: %f!", mcuData.curr_yaw, mcuData.curr_pitch);
|
// LOGM("Get yaw: %f, pitch: %f!", mcuData.curr_yaw, mcuData.curr_pitch);
|
||||||
// LOGM("Get delta x: %d, delta y: %d!", mcuData.delta_x, mcuData.delta_y);
|
// LOGM("Get delta x: %d, delta y: %d!", mcuData.delta_x, mcuData.delta_y);
|
||||||
// static int t = time(nullptr);
|
// static int t = time(nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user