Skip to content

Commit 257e5eb

Browse files
Update ProtocolDefinitions
1 parent a7b9250 commit 257e5eb

File tree

5 files changed

+96
-1
lines changed

5 files changed

+96
-1
lines changed

protocol/blueye/protocol/protos.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
from .types.message_formats import StationKeepingState
144144
from .types.message_formats import StoragePartition
145145
from .types.message_formats import StorageSpace
146+
from .types.message_formats import SurfaceUnitBatteryInfo
147+
from .types.message_formats import SurfaceUnitVersionInfo
146148
from .types.message_formats import SystemTime
147149
from .types.message_formats import ThicknessGauge
148150
from .types.message_formats import TiltAngle
@@ -286,6 +288,7 @@
286288
from .types.telemetry import ReferenceAutoPilotTel
287289
from .types.telemetry import ReferenceTel
288290
from .types.telemetry import RemovableStorageTel
291+
from .types.telemetry import SurfaceUnitTel
289292
from .types.telemetry import ThicknessGaugeTel
290293
from .types.telemetry import TiltAngleTel
291294
from .types.telemetry import TiltStabilizationTel
@@ -539,6 +542,9 @@
539542
'StationKeepingState',
540543
'StoragePartition',
541544
'StorageSpace',
545+
'SurfaceUnitBatteryInfo',
546+
'SurfaceUnitTel',
547+
'SurfaceUnitVersionInfo',
542548
'SyncTimeRep',
543549
'SyncTimeReq',
544550
'SystemTime',

protocol/blueye/protocol/types/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
StationKeepingState,
148148
StoragePartition,
149149
StorageSpace,
150+
SurfaceUnitBatteryInfo,
151+
SurfaceUnitVersionInfo,
150152
SystemTime,
151153
ThicknessGauge,
152154
TiltAngle,
@@ -296,6 +298,7 @@
296298
ReferenceAutoPilotTel,
297299
ReferenceTel,
298300
RemovableStorageTel,
301+
SurfaceUnitTel,
299302
ThicknessGaugeTel,
300303
TiltAngleTel,
301304
TiltStabilizationTel,
@@ -434,6 +437,8 @@
434437
'StationKeepingState',
435438
'StoragePartition',
436439
'StorageSpace',
440+
'SurfaceUnitBatteryInfo',
441+
'SurfaceUnitVersionInfo',
437442
'SystemTime',
438443
'ThicknessGauge',
439444
'TiltAngle',
@@ -577,6 +582,7 @@
577582
'ReferenceAutoPilotTel',
578583
'ReferenceTel',
579584
'RemovableStorageTel',
585+
'SurfaceUnitTel',
580586
'ThicknessGaugeTel',
581587
'TiltAngleTel',
582588
'TiltStabilizationTel',

protocol/blueye/protocol/types/message_formats.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
'MutltibeamRecordingIndex',
131131
'PersistentStorageSettings',
132132
'CPUInfo',
133+
'SurfaceUnitBatteryInfo',
134+
'SurfaceUnitVersionInfo',
133135
},
134136
)
135137

@@ -4878,4 +4880,62 @@ class CPUInfo(proto.Message):
48784880
)
48794881

48804882

4883+
class SurfaceUnitBatteryInfo(proto.Message):
4884+
r"""Surface Unit battery information.
4885+
4886+
This message is published by the Surface Unit, and re-published
4887+
by the drone over the communication protocol.
4888+
4889+
Attributes:
4890+
status (blueye.protocol.types.SurfaceUnitBatteryInfo.ChargeStatus):
4891+
Battery charge status.
4892+
level (float):
4893+
Battery level (0..1).
4894+
"""
4895+
class ChargeStatus(proto.Enum):
4896+
r"""
4897+
4898+
Attributes:
4899+
CHARGE_STATUS_UNSPECIFIED (0):
4900+
No description available.
4901+
CHARGE_STATUS_DISCHARGE (1):
4902+
No description available.
4903+
CHARGE_STATUS_CHARGE (2):
4904+
No description available.
4905+
CHARGE_STATUS_CHARGE_ERROR (3):
4906+
No description available.
4907+
"""
4908+
CHARGE_STATUS_UNSPECIFIED = 0
4909+
CHARGE_STATUS_DISCHARGE = 1
4910+
CHARGE_STATUS_CHARGE = 2
4911+
CHARGE_STATUS_CHARGE_ERROR = 3
4912+
4913+
status: ChargeStatus = proto.Field(
4914+
proto.ENUM,
4915+
number=1,
4916+
enum=ChargeStatus,
4917+
)
4918+
level: float = proto.Field(
4919+
proto.FLOAT,
4920+
number=2,
4921+
)
4922+
4923+
4924+
class SurfaceUnitVersionInfo(proto.Message):
4925+
r"""Surface Unit version information.
4926+
4927+
This message is published by the Surface Unit, and re-published
4928+
by the drone over the communication protocol.
4929+
4930+
Attributes:
4931+
version (str):
4932+
Surface Unit firmware version (x.y.z).
4933+
"""
4934+
4935+
version: str = proto.Field(
4936+
proto.STRING,
4937+
number=1,
4938+
)
4939+
4940+
48814941
__all__ = tuple(sorted(__protobuf__.manifest))

protocol/blueye/protocol/types/telemetry.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
'MultibeamConfigTel',
8383
'MultibeamDiscoveryTel',
8484
'CPUInfoTel',
85+
'SurfaceUnitTel',
8586
},
8687
)
8788

@@ -946,4 +947,26 @@ class CPUInfoTel(proto.Message):
946947
)
947948

948949

950+
class SurfaceUnitTel(proto.Message):
951+
r"""Surface Unit telemetry message.
952+
953+
Attributes:
954+
battery_info (blueye.protocol.types.SurfaceUnitBatteryInfo):
955+
Battery information.
956+
version_info (blueye.protocol.types.SurfaceUnitVersionInfo):
957+
Version information.
958+
"""
959+
960+
battery_info: message_formats.SurfaceUnitBatteryInfo = proto.Field(
961+
proto.MESSAGE,
962+
number=1,
963+
message=message_formats.SurfaceUnitBatteryInfo,
964+
)
965+
version_info: message_formats.SurfaceUnitVersionInfo = proto.Field(
966+
proto.MESSAGE,
967+
number=2,
968+
message=message_formats.SurfaceUnitVersionInfo,
969+
)
970+
971+
949972
__all__ = tuple(sorted(__protobuf__.manifest))

0 commit comments

Comments
 (0)