startTakeoffWithCompletion not returning an error
已完成I have props off. Calling startTakeoffWithCompletion completion is called but error is nil even though I expect some kind of error given that the drone did not go up per documentation
Starts aircraft takeoff. Takeoff is considered complete when the aircraft is hovering 1.2 meters (4 feet) above the ground. Completion block is called when aircraft crosses 0.5 meters (1.6 feet). If the motors are already on, this command cannot be executed.
-
I think you are missing a point. The drone is ON. I am was testing how startTakeoffWithCompletion would work and what error would be returned if drone does not take off. I call startTakeoffWithCompletion to attempt to fly obviously I know it will not fly because propellers are off. I can hear motors start when startTakeoffWithCompletion is called and right away completion block is called, but error is NIL.
[GTDroneController.shared.myFC startTakeoffWithCompletion:^(NSError * _Nullable error) {
if (error) { //expect an error nil is returned
-
Actually, the aircraft cannot detect whether the propeller blades are installed. In fact, startTakeoffWithCompletion controls the rotation of the motor. As for whether the aircraft will ascend to a certain height, startTakeoffWithCompletion cannot determine that. It can only obtain the result of whether the command was successfully sent and whether the motor is currently operational. -
this is not what documentation says:
"Starts aircraft takeoff. Takeoff is considered complete when the aircraft is hovering 1.2 meters (4 feet) above the ground. Completion block is called when aircraft crosses 0.5 meters (1.6 feet). If the motors are already on, this command cannot be executed." -
The document describes the effects that will be achieved when the aircraft enters the takeoff state. In reality, I removed the propellers from the aircraft and when I called the takeoff interface, the motor did start and the FlightMode changed to takeoff mode. However, at this point, the aircraft immediately stops the takeoff action and the FlightMode changes to GPS or other normal modes. Do you need to obtain the state of the aircraft without the propellers installed? -
No, in reality I need to know when it actually took off/flying. I am guessing I can only rely on state change I am guessing the only other accurate way is to wait for call back on setCurrentState? The problem is that at times for whatever reason it may not take off and now I need to rely on some kind of timing check to determine that after calling takeOff it did not actually take of after X seconds for whatever reason.
-
If you need to know the current status of the aircraft, flightState.FlightMode is the best way. Even if the aircraft does not have propellers for takeoff, in reality, FlightMode has entered the takeoff state, but the aircraft immediately stops the takeoff action due to the protection mechanism. -
Ok thanks, thats what I was doing before and switched back to doing. IMHO documentation needs to be updated since it seems to be inaccurate. "Completion block is called when aircraft crosses 0.5 meters (1.6 feet). If the motors are already on, this command cannot be executed." This is simply not so.
请先登录再写评论。
评论
9 条评论