DJI Mobile SDK Documentation

      class SimulatorState

      @EXClassNullAway
      class SimulatorState
      Package:dji.common.flightcontroller.simulator
      SDK Key:FlightControllerKey.SIMULATOR_STATE
      Description:

      Aircraft simulator state data.

      Class Members:
      interface
      interface Callback
      interface Callback
      Package:dji.common.flightcontroller.simulator
      SDK Key:FlightControllerKey.SIMULATOR_STATE
      Description:

      Simulator's callback interface. When the SDK receives the SimulatorState, the override method will be called.

      Interface Methods:
      method
      method onUpdate
      void onUpdate(@NonNull SimulatorState state)
      Package:dji.common.flightcontroller.simulator
      SDK Key:FlightControllerKey.SIMULATOR_STATE
      Description:

      Updates the simulator's current state.

      Input Parameters:
      @NonNull SimulatorState stateAn instance of SimulatorState.
      Simulated Aircraft State
      method
      method areMotorsOn
      boolean areMotorsOn()
      Package:dji.common.flightcontroller.simulator
      Description:

      TRUE if motors are on in the simulator.

      Return:
      booleanA boolean value.
      method
      method isFlying
      boolean isFlying()
      Package:dji.common.flightcontroller.simulator
      Description:

      TRUE if aircraft is flying in the simulator.

      Return:
      booleanA boolean value.
      method getLocation
      LocationCoordinate2D getLocation()
      Package:dji.common.flightcontroller.simulator
      Description:

      Simulated aircraft location.

      Return:
      LocationCoordinate2DLocation object.
      method getPositionX
      float getPositionX()
      Package:dji.common.flightcontroller.simulator
      Description:

      Gets East-West distance from initial simulator location, where East is positive, and North-East-Down coordinate system is used.

      Return:
      floatA float value.
      method getPositionY
      float getPositionY()
      Package:dji.common.flightcontroller.simulator
      Description:

      Gets North-South distance from initial simulator location, where North is positive, and North-East-Down coordinate system is used.

      Return:
      floatA float value.
      method getPositionZ
      float getPositionZ()
      Package:dji.common.flightcontroller.simulator
      Description:

      Gets vertical distance from initial simulator location. The value should be negative if the height of aircraft is higher than initial home point's height.

      Return:
      floatA float value.
      method
      method getPitch
      float getPitch()
      Package:dji.common.flightcontroller.simulator
      Description:

      Simulated aircraft pitch with range [-30, 30] degrees.

      Return:
      floatA float value.
      method
      method getRoll
      float getRoll()
      Package:dji.common.flightcontroller.simulator
      Description:

      Simulated aircraft roll with range [-30, 30] degrees.

      Return:
      floatA float value.
      method
      method getYaw
      float getYaw()
      Package:dji.common.flightcontroller.simulator
      Description:

      Simulated aircraft yaw with range [-180, 180] degrees.

      Return:
      floatA float value.