diff --git a/Com_server/fly_monitor/src/Data_Drone.cpp b/Com_server/fly_monitor/src/Data_Drone.cpp index 2c93207f0b6c4a23a27da0a1aaeb8956436e387d..2d914ad31e3844d529c4715a1ff60adf414d4d21 100644 --- a/Com_server/fly_monitor/src/Data_Drone.cpp +++ b/Com_server/fly_monitor/src/Data_Drone.cpp @@ -986,8 +986,8 @@ int Drone::command_kill(int terminate) int Drone::command_directControl(float x, float y, float z, float r) { int16_t xx,yy,zz,rr; - float upper_limit = 0.5; - float lower_limit = -0.5; + float upper_limit = 0.75; + float lower_limit = -0.75; // Range limitation if (x > 1.f || x < -1.f || y > 1.f || y < -1.f || z > 1.f || z < 0.f || r > 1.f || r < -1.f) @@ -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 > 1.f) y = 1.f; - if (y < -1.f) y = -1.f; + if (y > upper_limit) y = upper_limit; + if (y < lower_limit) y = lower_limit; if (z > 1.f ) z = 1.f; if (z < -1.f) z = -1.f; - if (r > 1.f) r = 1.f; - if (r < -1.f) r = -1.f; + if (r > upper_limit) r = upper_limit; + if (r < lower_limit) r = lower_limit; 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 5c41aad17b6297575edda4d283c276406d160efb..abd97a89165db19bf19f061ccebe422dead636f9 100644 --- a/Com_server/fly_monitor/src/TestDroneRemoteControl.cpp +++ b/Com_server/fly_monitor/src/TestDroneRemoteControl.cpp @@ -600,6 +600,7 @@ int command_loop() // x, y, z, r = pitch, roll, throttle, yaw cout << "\nSet mode to position control" << endl; + drone1.enable_altitude_control = 1; drone1.flight_mode = FlightMode::Posctl; } else if(buffer_command=="tone")