FlightController.getSimulator().setStateCallback
CompletedmFlightController.setRollPitchControlMode(RollPitchControlMode.VELOCITY);
mFlightController.setYawControlMode(YawControlMode.ANGULAR_VELOCITY);
mFlightController.setVerticalControlMode(VerticalControlMode.VELOCITY);
mFlightController.setRollPitchCoordinateSystem(FlightCoordinateSystem.BODY);
下面这个为什么获取不到数据
mFlightController.getSimulator().setStateCallback(new SimulatorState.Callback() {
@Override
public void onUpdate(final SimulatorState stateData) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
String yaw = String.format("%.2f", stateData.getYaw());
String pitch = String.format("%.2f", stateData.getPitch());
String roll = String.format("%.2f", stateData.getRoll());
String positionX = String.format("%.2f", stateData.getPositionX());
String positionY = String.format("%.2f", stateData.getPositionY());
String positionZ = String.format("%.2f", stateData.getPositionZ());
LogUtils.e("yaw==="+yaw+" "+pitch+" "+ roll+" "+ positionX+" "+ positionY+" "+positionZ);
}
});
}
});
-
mFlightController.getSimulator()
.start(InitializationData.createInstance(new LocationCoordinate2D(39, 114), 10, 10),
new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if (djiError != null) {
ToastUtils.showShort(djiError.getDescription());
} else {
ToastUtils.showShort("Start Simulator Success");
}
}
});
开启模拟器是显示Param Illegal(255)
Please sign in to leave a comment.
Comments
3 comments