djiuser_rUPo8vECVlTQ
lvl.2
Slovakia
Offline
|
Hello,
I am using sendVirtualStickDataTask programmatically based on DJI Sample SDK application for Android.
My settings are:
flightController.setVerticalControlMode(VerticalControlMode.POSITION);
flightController.setYawControlMode(YawControlMode.ANGULAR_VELOCITY);
flightController.setRollPitchControlMode(RollPitchControlMode.ANGLE);
flightController.setRollPitchCoordinateSystem(FlightCoordinateSystem.BODY);
and I create new DataTask like this:
throttle = 0f;
yaw = 0f;
pitch = 0f;
roll = -0.1f;
if (null == sendVirtualStickDataTimer) {
sendVirtualStickDataTask = new SendVirtualStickDataTask();
sendVirtualStickDataTimer = new Timer();
sendVirtualStickDataTimer.schedule(sendVirtualStickDataTask, 0, 200);
}
But everytime I move my drone (DJI Spark) with this code, it seems like it goes random way. Sometimes it flies to the left as it should, but as soon as I move or rotate the drone, then it will fly to any other side, even to the right, backwards or forwards or combination of roll and pitch, which is not supposed to happen if everything else is set up to zero. I am very confused as I am a beginner with this.
Do you have any ideas or do you know what can cause the problems? Thank you very much.
|
|