use of com.jiushuo.uavRct.entity.mqtt.GimbalControlRequest in project uav_mobile_app by jiushuokj.
the class MyMqttService method gimbalControl.
private void gimbalControl(final MqttMessage message) {
Log.i(TAG, "gimbalControl: ");
GimbalControlRequest request = JSON.parseObject(new String(message.getPayload()), GimbalControlRequest.class);
Rotation rotation = new Rotation.Builder().mode(RotationMode.values()[request.getMode().ordinal()]).pitch(request.getPitch()).roll(request.getRoll()).yaw(request.getYaw()).time(request.getTime()).build();
for (Gimbal gimbal : aircraft.getGimbals()) {
Log.i(TAG, "gimbalControl: gimbals--->" + gimbal);
}
aircraft.getGimbals().get(0).rotate(rotation, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
makeDefaultResponse(djiError, message);
}
});
}
Aggregations