Signal K
    Preparing search index...

    Interface AutopilotProvider

    interface AutopilotProvider {
        adjustTarget(value: number, deviceId: string): Promise<void>;
        courseCurrentPoint(deviceId: string): Promise<void>;
        courseNextPoint(deviceId: string): Promise<void>;
        disengage(deviceId: string): Promise<void>;
        dodge(value: null | number, deviceId: string): Promise<void>;
        engage(deviceId: string): Promise<void>;
        getData(deviceId: string): Promise<AutopilotInfo>;
        getMode(deviceId: string): Promise<null | string>;
        getState(deviceId: string): Promise<null | string>;
        getTarget(deviceId: string): Promise<null | number>;
        gybe(direction: TackGybeDirection, deviceId: string): Promise<void>;
        setMode(mode: string, deviceId: string): Promise<void>;
        setState(state: string, deviceId: string): Promise<void>;
        setTarget(value: number, deviceId: string): Promise<void>;
        tack(direction: TackGybeDirection, deviceId: string): Promise<void>;
    }
    Index

    Methods

    • Adjusts target for the autopilot device with the supplied identifier by the supplied value.

      Parameters

      • value: number

        value in radians to add to current target value.

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      PUT /signalk/v2/api/vessels/self/autopilots/mypilot1/target {value: 2}
      

      AutopilotProvider method invocation

      adjustTarget(2, 'mypilot1');
      

      if supplied target value is outside the valid range.

    • Instructs the autopilot device to steer for the currently set destination position.

      It is assumed that a destination has been set prior to invoking this action.

      The intended result of this action is that the autopilot device be engaged in the appropriate mode to steer to the active waypoint / position.

      Parameters

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/courseCurrentPoint
      

      AutopilotProvider method invocation

      courseCurrentPoint('mypilot1');
      

      on error.

    • Instructs the autopilot device to advance to the next waypoint on the route.

      Parameters

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/courseNextPoint
      

      AutopilotProvider method invocation

      courseNextPoint('mypilot1');
      

      on error.

    • disengage(deviceId): This method sets the state of the autopilot device with the supplied identifier to a state that is NOT actively steering the vessel.

      Parameters

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/disengage
      

      AutopilotProvider method invocation

      disengage('mypilot1');
      

      on error.

    • Instructs the autopilot device with the supplied identifier to enter / exit dodge mode and alter the current course by the supplied value (radians) direction.

      Parameters

      • value: null | number

        +/- value in radians 'port (-ive)' or 'starboard' to change direction. Setting the value to null indicates exit of dodge mode.

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      To address different pilot behaviour, the dodge function can be used in the following ways:

      1. Enter dodge mode at the current course

      // API request
      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/dodge

      // _AutopilotProvider method invocation
      dodge(0, 'mypilot1');

      2. Enter dodge mode and change course

      // API request
      PUT /signalk/v2/api/vessels/self/autopilots/mypilot1/dodge {"value": 5}

      // AutopilotProvider method invocation
      dodge(5, 'mypilot1');

      3. Cancel dodge mode

      // API request
      DELETE /signalk/v2/api/vessels/self/autopilots/mypilot1/dodge

      // AutopilotProvider method invocation
      dodge(null, 'mypilot1');

      on error.

    • Sets the state of the autopilot device with the supplied identifier to a state that is actively steering the vessel.

      Parameters

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/engage
      

      AutopilotProvider method invocation

      engage('mypilot1');
      

      on error.

    • This method returns an AutopilotInfo object containing the current data values and valid options for the supplied autopilot device identifier.

      Note

      It is the responsibility of the autopilot provider plugin to map the value of engaged to the current state.

      Additionally, the plugin can maintain a list of availableActions that can be taken in the current operational state.

      Parameters

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<AutopilotInfo>

      API request:

      GET /signalk/v2/api/vessels/self/autopilots/mypilot1
      

      AutopilotProvider method invocation:

      getData('mypilot1');

      // Returns:
      {
      options: {
      states: [
      {
      name: 'auto' // autopilot state name
      engaged: true // actively steering
      },
      {
      name: 'standby' // autopilot state name
      engaged: false // not actively steering
      }
      ]
      modes: ['compass', 'gps', 'wind'], // supported modes of operation
      actions: [
      {
      id: 'tack',
      name: 'Tack',
      available: true
      },
      {
      id: 'gybe',
      name: 'Gybe',
      available: false
      }
      ] // actions the autopilot supports
      },
      target: 0.326
      mode: 'compass'
      state: 'auto'
      engaged: true
      }
    • Returns the current state of the supplied autopilot device identifier. If the autopilot device is not connected or unreachable then off-line should be returned.

      Parameters

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<null | string>

      API request

      GET /signalk/v2/api/vessels/self/autopilots/mypilot1/state
      

      AutopilotProvider method invocation

      await getState('mypilot1'); // Returns: 'auto'
      
    • gybe(direction, deviceId): This method instructs the autopilot device with the supplied identifier to perform a gybe in the supplied direction.

      Parameters

      • direction: TackGybeDirection

        port or starboard

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/gybe/starboard
      

      AutopilotProvider method invocation

      gybe('starboard', 'mypilot1');
      

      on error.

    • Sets the autopilot device with the supplied identifier to the supplied mode value.

      Parameters

      • mode: string

        Must be a valid mode value.

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      PUT /signalk/v2/api/vessels/self/autopilots/mypilot1/mode {value: "gps"}
      

      AutopilotProvider method invocation

      setMode('gps', 'mypilot1');
      

      if supplied mode value is invalid.

    • Sets the autopilot device with the supplied identifier to the supplied state value.

      Parameters

      • state: string

        state value to set. Must be a valid state value.

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      PUT /signalk/v2/api/vessels/self/autopilots/mypilot1/state {value: "standby"}
      

      AutopilotProvider method invocation

      setState('standby', 'mypilot1');
      

      if supplied state value is invalid.

    • Sets target for the autopilot device with the supplied identifier to the supplied value.

      Parameters

      • value: number

        target value in radians.

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      PUT /signalk/v2/api/vessels/self/autopilots/mypilot1/target {value: 129}
      

      // AutopilotProvider method invocation

      setTarget(129, 'mypilot1');
      

      if supplied target value is outside the valid range.

    • Instructs the autopilot device with the supplied identifier to perform a tack in the supplied direction.

      Parameters

      • direction: TackGybeDirection

        port or starboard

      • deviceId: string

        identifier of the autopilot device to query.

      Returns Promise<void>

      API request

      POST /signalk/v2/api/vessels/self/autopilots/mypilot1/tack/port
      

      AutopilotProvider method invocation

      tack('port', 'mypilot1');
      

      on error.