You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sonar-3d/sonar-3d-15-api.md
+4-77Lines changed: 4 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ The **Water Linked Sonar 3D-15** provides real-time 3D views of underwater envir
5
5
6
6
The Sonar 3D-15 also exposes a HTTP API for configuration and inspection of system state.
7
7
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).
9
9
10
10
---
11
11
@@ -109,90 +109,17 @@ z = -radius * sin(pitch); // z is downward
109
109
110
110
---
111
111
112
-
### `.proto` File (Excerpt)
113
-
```protobuf
114
-
// Water Linked Sonar 3D-15 protocol
115
-
syntax = "proto3";
112
+
### Protobuf packet description
116
113
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/).
187
115
116
+
Refer to the full [protocol specification](https://protobuf.dev/) and the [wlsonar](https://github.com/waterlinked/wlsonar) Python library for an example implementation.
188
117
189
118
**Compatibility Notes**
190
119
- Additional message types/fields may be introduced.
191
120
- Decoders should ignore unrecognized messages.
192
121
- Major breaking changes will involve a new protocol identifier.
193
122
194
-
Refer to the full protocol specification and `.proto` file shown above for more information.
195
-
196
123
## HTTP API
197
124
198
125
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