Skip to content

Commit 7d67ffb

Browse files
authored
Update repo link, link to protobuf file
1 parent c4ff2f7 commit 7d67ffb

File tree

1 file changed

+4
-77
lines changed

1 file changed

+4
-77
lines changed

docs/sonar-3d/sonar-3d-15-api.md

Lines changed: 4 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The **Water Linked Sonar 3D-15** provides real-time 3D views of underwater envir
55

66
The Sonar 3D-15 also exposes a HTTP API for configuration and inspection of system state.
77

8-
A Python example implementation of the Sonar API is available on [github](https://github.com/waterlinked/Sonar-3D-15-api-example).
8+
A Python example implementation of the Sonar API is available on [github](https://github.com/waterlinked/wlsonar).
99

1010
---
1111

@@ -109,90 +109,17 @@ z = -radius * sin(pitch); // z is downward
109109
110110
---
111111
112-
### `.proto` File (Excerpt)
113-
```protobuf
114-
// Water Linked Sonar 3D-15 protocol
115-
syntax = "proto3";
112+
### Protobuf packet description
116113
117-
package waterlinked.sonar.protocol;
118-
import "google/protobuf/timestamp.proto";
119-
import "google/protobuf/any.proto";
120-
121-
// Packet is the top-level message that is sent over the wire.
122-
message Packet {
123-
google.protobuf.Any msg = 1; // Use .type_url to deserialize .value
124-
// into one of the messages defined in this proto file
125-
}
126-
127-
message Header {
128-
google.protobuf.Timestamp timestamp = 1;
129-
// Sequence id is a monotonically increasing number that identifies
130-
// each shot of the sonar. It can be used to detect missing shots or
131-
// to relate messages of different types to each other. The value
132-
// wraps around to 0 after reaching the maximum value.
133-
134-
uint32 sequence_id = 2;
135-
}
136-
137-
enum BitmapImageType {
138-
// Bitmap image showing for each x,y pixel the strength of the
139-
// strongest reflection
140-
SIGNAL_STRENGTH_IMAGE = 0;
141-
// Bitmap image showing a shaded representation of the depth in the
142-
// range image. The light source is behind and above the observer.
143-
// (This is experimental and may be removed in the future)
144-
SHADED_IMAGE = 1;
145-
}
146-
147-
// BitmapImageGreyscale8 can be shown to user without further processing.
148-
// Uncompressed, 8-bit color depth, greyscale.
149-
150-
message BitmapImageGreyscale8 {
151-
Header header = 1;
152-
float speed_of_sound = 2; // Configured speed of sound in water in m/s
153-
float range = 3; // Configured range in meters
154-
uint32 frequency = 4; // Configured imaging frequency in Hz
155-
BitmapImageType type = 5; // Identifier for what is shown in the image
156-
uint32 width = 6;
157-
uint32 height = 7;
158-
float fov_horizontal = 8;
159-
float fov_vertical = 9;
160-
// image pixel data is organized in rows of pixels.Each row is
161-
// 'width' wide, and there are 'height' rows. Each pixel is an 8-bit
162-
// value that represents the intensity of the pixel, from 0 to 255
163-
bytes image_pixel_data = 10;
164-
}
165-
166-
// RangeImage measures the distance to the strongest reflection
167-
// for each pixel.
168-
message RangeImage {
169-
Header header = 1;
170-
float speed_of_sound = 2; // Configured speed of sound in water in m/s
171-
float range = 3; // Configured range in meters
172-
uint32 frequency = 4; // Configured imaging frequency in Hz.
173-
uint32 width = 5;
174-
uint32 height = 6;
175-
float fov_horizontal = 7; // In degrees
176-
float fov_vertical = 8; // In degrees
177-
float image_pixel_scale = 9;
178-
179-
// image_pixel_data is organized in rows of pixels. Each row is
180-
// 'width' wide, and there are 'height' rows.
181-
// Each pixel is a 16-bit value that must be multiplied by
182-
// image_pixel_scale to obtain the distance in meters from the sonar
183-
// to the strongest reflection in that direction.
184-
repeated uint32 image_pixel_data = 10;
185-
}
186-
```
114+
The Sonar 3D-15 protobuf messages that are transmitted by the sonar is documented in a [.proto](https://github.com/waterlinked/wlsonar/blob/main/src/wlsonar/range_image_protocol/_proto/WaterLinkedSonarIntegrationProtocol.proto) file. The `.proto` file is used to generate code for decoding the messages in any of the [supported programming languages](https://protobuf.dev/reference/).
187115
116+
Refer to the full [protocol specification](https://protobuf.dev/) and the [wlsonar](https://github.com/waterlinked/wlsonar) Python library for an example implementation.
188117
189118
**Compatibility Notes**
190119
- Additional message types/fields may be introduced.
191120
- Decoders should ignore unrecognized messages.
192121
- Major breaking changes will involve a new protocol identifier.
193122
194-
Refer to the full protocol specification and `.proto` file shown above for more information.
195-
196123
## HTTP API
197124
198125
The Sonar 3D-15 exposes a HTTP API for configuration and inspection of system state. The HTTP API is exposed on port 80 and uses paths rooted at `/api/v1/integration/`. JSON is used for request and response bodies. The HTTP API is documented with a [swagger.json](./sonar-3d-15-api-swagger/swagger.json) file. This file can be opened in a compatible viewer such as [this one](https://petstore.swagger.io/?url=https://docs.waterlinked.com/sonar-3d/sonar-3d-15-api-swagger/swagger.json). Example code using the HTTP API exists on [github](https://github.com/waterlinked/Sonar-3D-15-api-example).

0 commit comments

Comments
 (0)