diff --git a/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp b/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp index cdaf949d1f94d6ddfdcd8edc9d5db2e2f789ee20..9fd26cffd42b4cb959115368cf5d25b52856d2a6 100644 --- a/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp +++ b/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp @@ -174,7 +174,7 @@ int Serial_Port_WritingThread::main_loop(struct timeval *front_msg, struct timev drone1.command_directControl(-blc_control_motors.floats[0] ,blc_control_motors.floats[1] ,blc_control_motors.floats[4] - ,-blc_control_motors.floats[2]); + ,- 2 * blc_control_motors.floats[2]); //*/ // Control directly @@ -190,7 +190,7 @@ int Serial_Port_WritingThread::main_loop(struct timeval *front_msg, struct timev std::cout << "x = " << - blc_control_motors.floats[0] << ", y = " << blc_control_motors.floats[1] << ", z = " << blc_control_motors.floats[4] - << ", r = " << - blc_control_motors.floats[2] + << ", r = " << - 2 * blc_control_motors.floats[2] << std::endl; std::cout << "Drone is not armed, can't control" << std::endl; } diff --git a/Com_server/fly_monitor/src/Data_Drone.cpp b/Com_server/fly_monitor/src/Data_Drone.cpp index e896c0af68cefc6d47814b053ac2193dbdfed7dd..2c93207f0b6c4a23a27da0a1aaeb8956436e387d 100644 --- a/Com_server/fly_monitor/src/Data_Drone.cpp +++ b/Com_server/fly_monitor/src/Data_Drone.cpp @@ -997,12 +997,12 @@ int Drone::command_directControl(float x, float y, float z, float r) if (x > upper_limit) x = upper_limit; if (x < lower_limit) x = lower_limit; - if (y > upper_limit) y = upper_limit; - if (y < lower_limit) y = lower_limit; + if (y > 1.f) y = 1.f; + if (y < -1.f) y = -1.f; if (z > 1.f ) z = 1.f; if (z < -1.f) z = -1.f; - if (r > upper_limit) r = upper_limit; - if (r < lower_limit) r = lower_limit; + if (r > 1.f) r = 1.f; + if (r < -1.f) r = -1.f; xx=static_cast<int16_t>(x * 1000); yy=static_cast<int16_t>(y * 1000); diff --git a/Com_server/fly_monitor/src/TestDroneRemoteControl.cpp b/Com_server/fly_monitor/src/TestDroneRemoteControl.cpp index cc0fff6147e6434dbfd3c56bd1596a7c62790d0d..2c996b33c082c0bd7138a878d57842d237587e25 100644 --- a/Com_server/fly_monitor/src/TestDroneRemoteControl.cpp +++ b/Com_server/fly_monitor/src/TestDroneRemoteControl.cpp @@ -862,7 +862,7 @@ int main(int argc, char *argv[]) compassx.open("compassx.txt"); compassy.open("compassy.txt"); - writingThread = shared_ptr<Serial_Port_WritingThread>(new Serial_Port_WritingThread(50000, 1000)); + writingThread = shared_ptr<Serial_Port_WritingThread>(new Serial_Port_WritingThread(70000, 1000)); readingThread = shared_ptr<Serial_Port_ReadingThread>(new Serial_Port_ReadingThread(1000, 1000)); cout << "Welcome to pixhawk server" << endl;