Skip to content

Commit 1734682

Browse files
committed
Merge branch 'master' into hs/adis
2 parents fd94b22 + fed2b1e commit 1734682

File tree

9 files changed

+219
-74
lines changed

9 files changed

+219
-74
lines changed

.github/workflows/ci-typescript.yaml

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,87 +13,46 @@ jobs:
1313
- name: Checkout source
1414
uses: actions/checkout@v4
1515

16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v4
18+
with:
19+
version: 10
20+
run_install: false
21+
1622
- name: Setup Node.js
1723
uses: actions/setup-node@v4
1824
with:
1925
node-version: "latest"
26+
cache: "pnpm"
2027
registry-url: "https://registry.npmjs.org/"
2128
scope: "@blueyerobotics"
2229

23-
- name: Create tsconfig
24-
run: |
25-
cd protobuf_definitions
26-
echo '{
27-
"compilerOptions": {
28-
"target": "ES2020",
29-
"module": "CommonJS",
30-
"declaration": true,
31-
"outDir": "dist",
32-
"strict": true,
33-
"esModuleInterop": true
34-
},
35-
"include": ["./**/*.ts"]
36-
}' > tsconfig.json
37-
38-
- name: Create package
39-
run: |
40-
cd protobuf_definitions
41-
SHORT_SHA=${GITHUB_SHA::8}
42-
echo '{
43-
"name": "@blueyerobotics/protocol-definitions",
44-
"version": "3.2.0-'${SHORT_SHA}'",
45-
"license": "LGPL-3.0-only",
46-
"description": "TypeScript definitions for Blueye Robotics protocols",
47-
"repository": {
48-
"type": "git",
49-
"url": "https://github.com/BluEye-Robotics/ProtocolDefinitions.git"
50-
},
51-
"main": "dist/index.js",
52-
"types": "dist/index.d.ts",
53-
"files": ["dist"],
54-
"scripts": {
55-
"build": "tsc"
56-
},
57-
"dependencies": {
58-
"@bufbuild/protobuf": "^2.5.2"
59-
},
60-
"devDependencies": {
61-
"ts-proto": "^2.7.5",
62-
"typescript": "^5.8.3"
63-
}
64-
}' > package.json
65-
6630
- name: Install dependencies
6731
run: |
6832
sudo apt-get update
6933
sudo apt-get install -y protobuf-compiler
70-
cd protobuf_definitions
71-
npm install
34+
pnpm install
7235
7336
- name: Generate
7437
run: |
75-
cd protobuf_definitions
7638
mkdir -p ./out/ &&
77-
protoc *.proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./out \
39+
protoc protobuf_definitions/*.proto \
40+
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
41+
--proto_path=protobuf_definitions \
42+
--ts_proto_out=./out \
7843
--ts_proto_opt=outputIndex=true \
7944
--ts_proto_opt=globalThisPolyfill=true \
8045
--ts_proto_opt=useExactTypes=false
8146
8247
- name: Compile
83-
run: |
84-
cd protobuf_definitions
85-
npm run build
48+
run: pnpm run build
8649

8750
- name: Publish to npm
8851
run: |
89-
cp README.npm.md protobuf_definitions/README.md
90-
cd protobuf_definitions
91-
npm publish --access public --tag latest
52+
cp README.npm.md README.md
53+
VERSION=$(pnpm pkg get version | tr -d '"')
54+
SHORT_SHA=${GITHUB_SHA::8}
55+
pnpm version --no-git-tag-version "${VERSION}-${SHORT_SHA}"
56+
pnpm publish --no-git-checks --access public --tag latest
9257
env:
9358
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
94-
95-
- name: Check npm pack contents
96-
run: |
97-
cd protobuf_definitions
98-
npm pack
99-
tar -tzf *.tgz

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ out
3131
build
3232
build_imx
3333
build_*
34+
node_modules
3435

3536
# Rider directories
36-
.idea
37+
.idea

Blueye.Protocol.Protobuf.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Google.Protobuf" Version="3.32.0" />
17-
<PackageReference Include="Google.Protobuf.Tools" Version="3.32.0">
16+
<PackageReference Include="Google.Protobuf" Version="3.32.1" />
17+
<PackageReference Include="Google.Protobuf.Tools" Version="3.32.1">
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
<PrivateAssets>all</PrivateAssets>
2020
</PackageReference>

package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@blueyerobotics/protocol-definitions",
3+
"version": "3.2.0",
4+
"license": "LGPL-3.0-only",
5+
"description": "TypeScript definitions for Blueye Robotics protocols",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/BluEye-Robotics/ProtocolDefinitions.git"
9+
},
10+
"main": "dist/index.js",
11+
"types": "dist/index.d.ts",
12+
"files": [
13+
"dist"
14+
],
15+
"scripts": {
16+
"build": "tsc"
17+
},
18+
"dependencies": {
19+
"@bufbuild/protobuf": "^2.5.2"
20+
},
21+
"devDependencies": {
22+
"ts-proto": "^2.7.5",
23+
"typescript": "^5.8.3"
24+
}
25+
}

pnpm-lock.yaml

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf_definitions/control.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ message WatchdogCtrl {
4747
uint32 client_id = 2; // The ID of the client, received in the ConnectClientRep response.
4848
}
4949

50-
// Issue a command to start video recording.
50+
// Issue a command to start video or multibeam recording.
5151
message RecordCtrl {
5252
RecordOn record_on = 1; // Message specifying which cameras to record.
53+
StorageLocation storage_location = 2; // Storage location to use for the recordings.
5354
}
5455

5556
// Issue a command to take a picture.
5657
message TakePictureCtrl {
58+
StorageLocation storage_location = 1; // Storage location to use for the picture.
5759
}
5860

5961
// Issue a command to start compass calibration.

protobuf_definitions/message_formats.proto

Lines changed: 67 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,33 @@ message LogEntry {
4343
string message = 7; // Log message.
4444
}
4545

46+
message KernelLogEntry {
47+
// Kernel log level.
48+
enum KernelLogLevel {
49+
KERNEL_LOG_LEVEL_UNSPECIFIED = 0; // Unspecified log level.
50+
KERNEL_LOG_LEVEL_EMERG = 1; // Emergency log level.
51+
KERNEL_LOG_LEVEL_ALERT = 2; // Alert log level.
52+
KERNEL_LOG_LEVEL_CRIT = 3; // Critical log level.
53+
KERNEL_LOG_LEVEL_ERR = 4; // Error log level.
54+
KERNEL_LOG_LEVEL_WARNING = 5; // Warning log level.
55+
KERNEL_LOG_LEVEL_NOTICE = 6; // Notice log level.
56+
KERNEL_LOG_LEVEL_INFO = 7; // Informational log level.
57+
KERNEL_LOG_LEVEL_DEBUG = 8; // Debug log level.
58+
}
59+
60+
// Key-value pair used for structured logging.
61+
message KeyValuePair {
62+
string key = 1; // Key of the key-value pair.
63+
string value = 2; // Value of the key-value pair.
64+
}
65+
66+
KernelLogLevel level = 1; // Log level, info, warning, error, etc.
67+
uint32 seqnum = 2; // Sequence number of the log entry.
68+
google.protobuf.Timestamp timestamp = 3; // Timestamp of the log entry.
69+
repeated string messages = 4; // Log messages.
70+
repeated KeyValuePair fields = 5; // List of key-value pairs.
71+
}
72+
4673
// Motion input from client.
4774
//
4875
// Used to indicate the desired motion in each direction.
@@ -184,6 +211,7 @@ message RecordState {
184211
bool multibeam_is_recording = 5; // If the multibeam is recording.
185212
int32 multibeam_seconds = 6; // Multibeam record time (s).
186213
float multibeam_fps = 9; // Multibeam record fps.
214+
StorageLocation storage_location = 10; // Storage location used for recording.
187215
}
188216

189217
// Interval type for time-lapse photos.
@@ -592,13 +620,22 @@ message DiveTime {
592620
int32 value = 1; // Number of seconds the drone has been submerged.
593621
}
594622

595-
// Which cameras are supposed to be recording.
623+
// Which cameras or multibeam are supposed to be recording.
596624
message RecordOn {
597625
bool main = 1; // Record the main camera.
598626
bool guestport = 2; // Record external camera.
599627
bool multibeam = 3; // Record multibeam.
600628
}
601629

630+
// Storage location.
631+
//
632+
// Used to specify which storage location to use for recording photos and videos.
633+
enum StorageLocation {
634+
STORAGE_LOCATION_UNSPECIFIED = 0; // Unspecified.
635+
STORAGE_LOCATION_INTERNAL = 1; // Internal storage of the drone.
636+
STORAGE_LOCATION_REMOVABLE = 2; // Removable storage device.
637+
}
638+
602639
// Storage space.
603640
message StorageSpace {
604641
int64 total_space = 1; // Total bytes of storage space (B).
@@ -787,16 +824,17 @@ message ErrorFlags {
787824
// Available camera resolutions.
788825
enum Resolution {
789826
RESOLUTION_UNSPECIFIED = 0; // Resolution not specified.
790-
RESOLUTION_FULLHD_1080P = 1; // 1080p Full HD resolution.
791-
RESOLUTION_HD_720P = 2; // 720p HD resolution.
792-
RESOLUTION_UHD_4K = 3; // 4K Ultra HD resolution.
827+
RESOLUTION_VGA_480P = 4; // VGA (640x480).
828+
RESOLUTION_HD_720P = 2; // 720p HD (1280x720).
829+
RESOLUTION_FULLHD_1080P = 1; // 1080p Full HD (1920x1080).
830+
RESOLUTION_UHD_4K = 3; // 4K Ultra HD (3840x2160, Only supported on X3 Ultra).
793831
}
794832

795833
// Available camera frame rates.
796834
enum Framerate {
797835
FRAMERATE_UNSPECIFIED = 0; // Framerate not specified.
798836
FRAMERATE_FPS_30 = 1; // 30 frames per second.
799-
FRAMERATE_FPS_25 = 2; // 25 frames per second.
837+
FRAMERATE_FPS_25 = 2; // 25 frames per second. (Only supported on Pioneer/Pro/X1/X3)
800838
}
801839

802840
// Which camera to control.
@@ -806,20 +844,39 @@ enum Camera {
806844
CAMERA_GUESTPORT = 2; // Guest port camera.
807845
}
808846

847+
enum StreamingProtocol {
848+
STREAMING_PROTOCOL_UNSPECIFIED = 0; // Streaming protocol not specified.
849+
STREAMING_PROTOCOL_RTSP_H264 = 1; // RTSP streaming protocol using H264 codec.
850+
STREAMING_PROTOCOL_RTSP_MJPEG = 2; // RTSP streaming protocol using MJPEG codec. No recording when activated.
851+
}
852+
809853
// Camera parameters.
810854
message CameraParameters {
855+
reserved 19;
811856
int32 h264_bitrate = 1; // Bitrate of the h264 stream (bit/sec).
812857
int32 mjpg_bitrate = 2; // Bitrate of the MJPG stream used for still pictures (bit/sec).
813858

814859
int32 exposure = 3; // Shutter speed (1/10000 * s), -1 for automatic exposure.
815-
int32 white_balance = 4; // White balance temperature (2800..9300), -1 for automatic white balance.
816-
int32 hue = 5; // Hue (-40..40), 0 as default.
817-
818-
float gain = 9; // Iso gain (0..1).
860+
int32 white_balance = 4; // White balance temp (Pioneer/Pro/X1/X3: 2800..9300, Ultra: 2300..15000), -1 for auto.
861+
int32 hue = 5; // Hue (-40..40), 0 as default. Only available on Pioneer/Pro/X1/X3.
862+
float gain = 9; // Iso gain (0..1). Only available on Pioneer/Pro/X1/X3.
863+
864+
int32 brightness = 12; // Brightness (-10..10), 0 as default. Only available on Ultra
865+
int32 contrast = 13; // Contrast (-50..50), 0 as default. Only available on Ultra.
866+
int32 saturation = 14; // Saturation (0..50), 8 as default. Only available on Ultra.
867+
int32 gamma = 15; // Gamma (4..79), 22 as default. Only available on Ultra.
868+
int32 sharpness = 16; // Sharpness (-20..20), -20 as default. Only available on Ultra.
869+
int32 backlight_compensation = 17; // Backlight compensation (-150..150), 10 as default. Only available on Ultra.
870+
int32 denoise = 18; // Noise reduction (-20..20), -20 as default. Only available on Ultra.
871+
bool ehdr_enabled = 21; // Enable eHDR mode. Default true. Only available on Ultra.
872+
int32 ehdr_exposure_min_number = 22; // Minimum number of eHDR frames. (1..4), default 1. Only available on Ultra.
873+
// Maximum number of eHDR frames. (1..4), default 2. Only on Ultra. Setting larger than 2 can reduce the framerate.
874+
int32 ehdr_exposure_max_number = 23;
819875

820876
Resolution resolution = 6; // Stream, recording and image resolution (deprecated).
821877
Resolution stream_resolution = 10; // Stream resolution.
822878
Resolution recording_resolution = 11; // Recording and image resolution.
879+
StreamingProtocol streaming_protocol = 20; // Streaming protocol.
823880
Framerate framerate = 7; // Stream and recording framerate.
824881
Camera camera = 8; // Which camera the parameters belong to.
825882
}
@@ -1236,7 +1293,7 @@ message SurfaceUnitBatteryInfo {
12361293
CHARGE_STATUS_CHARGE_ERROR = 3;
12371294
}
12381295
ChargeStatus status = 1; // Battery charge status.
1239-
float level = 2; // Battery level (0..1).
1296+
float level = 2; // Battery level (0..1).
12401297
}
12411298

12421299
// Surface Unit version information.

0 commit comments

Comments
 (0)