energy change

This commit is contained in:
sun
2019-07-24 22:49:14 +08:00
parent 11f7c8b469
commit 23f12425d6
2 changed files with 6 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ public:
void setSmallEnergyInit();//设置小能量机关初始化 void setSmallEnergyInit();//设置小能量机关初始化
void sendEnergy();//发送能量机关数据 void sendEnergy();//发送能量机关数据
void sendTarget(Serial& serial, float x, float y, float z);//发送数据 void sendTarget(Serial& serial, float x, float y, float z);//发送数据
void sendTarget(Serial& serial, float x, float y, float z, uint16_t u);//发送数据 void sendTarget(Serial& serial, float x, float y, uint16_t z, uint16_t u);//发送数据
private: private:

View File

@@ -28,11 +28,11 @@ void Energy::sendEnergy() {
} }
if (change_target) { if (change_target) {
sendTarget(serial, yaw_rotation, pitch_rotation, 5); sendTarget(serial, yaw_rotation, pitch_rotation, 5, 0);
} else if (is_guessing) { } else if (is_guessing) {
sendTarget(serial, yaw_rotation, pitch_rotation, 6); sendTarget(serial, yaw_rotation, pitch_rotation, 6, 0);
} else { } else {
sendTarget(serial, yaw_rotation, pitch_rotation, shoot); sendTarget(serial, yaw_rotation, pitch_rotation, shoot, 0);
} }
} }
@@ -77,7 +77,7 @@ void Energy::sendTarget(Serial &serial, float x, float y, float z) {
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// 此函数用于发送数据给主控板 // 此函数用于发送数据给主控板
// --------------------------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------------------------
void Energy::sendTarget(Serial &serial, float x, float y, float z, uint16_t u) { void Energy::sendTarget(Serial &serial, float x, float y, uint16_t z, uint16_t u) {
short x_tmp, y_tmp, z_tmp; short x_tmp, y_tmp, z_tmp;
uint8_t buff[10]; uint8_t buff[10];
@@ -87,7 +87,7 @@ void Energy::sendTarget(Serial &serial, float x, float y, float 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 << ")" << endl; cout << "fps:" << fps << ", (" << x << "," << y << "," << z << "," << u << ")" << endl;
fps = 0; fps = 0;
} }
fps += 1; fps += 1;