RFC: depth transducer offsets: one sign convention, transducer position, server-derived depths

Open
#688 3 comments 1 reaction 0 assignees View on GitHub

@dirkwa is already working on this.

Since Oct 13, 2026.

  • #689 by @dirkwa — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
10/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active

Research direction

This is a design RFC, not a bug to fix, so start by reading the Part 1 sign-convention table and the GNSS body-frame offsets the issue refers to in the specification repo. The open decisions are the sign convention for transducerToKeel, the new sensors.<id>.fromWaterline and sensorType values, and the .derived rules. Done means maintainers have agreed these points in the thread, not that a change has been written. Discuss the proposal there before proposing any wording.

Written by the indexing model from the issue text.

Description

Summary

A depth transducer measures depth below itself. People navigate by depth below the keel or below the surface. Getting from one to the other needs the transducer's position relative to the waterline and the keel. Signal K has paths for all of these values, but:

  1. The spec does not say which sign transducerToKeel has, and implementations disagree.
  2. A transducer carries only one offset, so the bus delivers at most two of the three depths, and which two depends on how the transducer was set up.
  3. There is nowhere to say where a transducer sits, or which $source it is, the way sensors.<id> now does for GNSS antennas.

Proposed:

  • Part 1 (clarification): transducerToKeel and surfaceToTransducer are non-negative distances. Converters translate the signed NMEA offset.
  • Part 2 (additive): a depth transducer is a sensors.<id> entry with sensorType: "depth" (antennas use "gnss"). It uses the existing fromBow/fromCenter, plus a new sensors.<id>.fromWaterline (+ve down).
  • Part 3 (server behaviour): a server may derive belowSurface and belowKeel per transducer and publish them under <$source>.derived, next to the untouched raw source.

No new depth paths are needed.

Part 1: sign of transducerToKeel

NMEA 0183 DPT and NMEA 2000 PGN 128267 carry one signed offset. canboat describes it as "Distance between transducer and surface (positive) or keel (negative)". Implementations map it onto the two Signal K paths differently:

Implementation transducerToKeel for a keel 1.0 m below the transducer How it is used
nmea0183-signalk (src/hooks/DPT.ts) +1.0 publishes -offset
n2k-signalk (pgns/128267.js) -1.0 passes the offset through; SignalK/n2k-signalk#362 changes it to +1.0
signalk-derived-data (depthBelowKeel2) expects + belowKeel = belowTransducer - transducerToKeel
signalk-to-nmea0183 (DPT.ts) either writes -Math.abs(transducerToKeel)
@sailingnaturali/signalk-depth-offsets expects - belowKeel = belowTransducer + transducerToKeel, documented as the canonical convention

The same transducer gives +1 over NMEA 0183 and -1 over NMEA 2000, and any consumer is wrong for one of the two.

Proposal: both paths are non-negative distances, which matches the existing wording ("depth from the transducer to the bottom of the keel"), nmea0183-signalk and derived-data. A positive NMEA offset becomes surfaceToTransducer, a negative one becomes transducerToKeel as its absolute value. This is breaking for n2k-signalk's current output and for consumers that assume the negative value, such as signalk-depth-offsets (cc @clarkbw). Consumers can stay compatible with both during the transition by reading the magnitude.

Part 2: where a transducer sits

sensors.<id>.fromWaterline: vertical distance from the design waterline, +ve down. It completes the body frame the spec documents for GNSS offsets (x forward, y starboard, z down), so a transducer is positive and an antenna negative. sensors.<id>.sensorType gets documented values gnss and depth. Several transducers can be described, each linked to its data by sensors.<id>.$source; a value on environment.depth.* from that source was measured at that position.

Part 3: server-derived depths

A server may publish belowSurface and belowKeel per transducer under <$source>.derived, with the raw value's timestamp, next to the untouched raw source, in the same way as <id>.ccrp for GNSS. Consumers choose with source priorities, which keeps raw and calibrated data apart by source.

  • The transducer's depth below the waterline comes, in order, from the surfaceToTransducer it sends, from the draft minus the transducerToKeel it sends, or from the configured fromWaterline.
  • A path the transducer sends itself is not derived.
  • With a missing or stale input the server publishes nothing rather than assume an offset of 0, and a derived value goes null or times out with its input.

Real case: an Airmar DST810 with a keel offset of -1.000 m, 0.70 m below the waterline, draft 1.7 m. The bus carries belowTransducer 13.08 and belowKeel 12.08 and no surface reference. A Furuno display on the same bus applied the transducer's -1.0 and its own +0.7 and showed 12.8 m, while the depth below the surface was 13.78 m. With derivation the server adds belowSurface 13.78.

Implementation

  • Spec change: dirkwa/specification feat-depth-sensor-geometry (PR to follow, linked here)
  • n2k-signalk sign: SignalK/n2k-signalk#362
  • Server derivation from device offsets: SignalK/signalk-server PR (link)
  • Next: depth sensor configuration in the server (/signalk/v2/api/vessels/self/sensors/depth, next to /gnss) for fromWaterline, for transducers that send no offset

Related

  • SignalK/signalk-server#2729: offsets as data paths, raw vs calibrated by source
  • SignalK/specification#76: derived values in environment.depth
Dominant language
JavaScript
Stars
105
Forks
72
Avg merge
11h 49m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SignalK/specification

All issues in SignalK/specification

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.