From 7db8aa93bd81cd397fd5a4dea937432a4e27865e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 14:44:24 +0000 Subject: [PATCH] Update ProtocolDefinitions --- ProtocolDefinitions | 2 +- blueye/protocol/protos.py | 20 ++ blueye/protocol/types/__init__.py | 240 ++++++++++++----------- blueye/protocol/types/control.py | 35 ++++ blueye/protocol/types/message_formats.py | 194 ++++++++++++++++++ blueye/protocol/types/telemetry.py | 42 ++++ 6 files changed, 422 insertions(+), 111 deletions(-) diff --git a/ProtocolDefinitions b/ProtocolDefinitions index 33445cf..aa09cf2 160000 --- a/ProtocolDefinitions +++ b/ProtocolDefinitions @@ -1 +1 @@ -Subproject commit 33445cf1b2dc0ac7b1199a9921a9601ecf5492ee +Subproject commit aa09cf2a368301c918bcc223a1e211e84ceed04a diff --git a/blueye/protocol/protos.py b/blueye/protocol/protos.py index 3707625..fe983e1 100644 --- a/blueye/protocol/protos.py +++ b/blueye/protocol/protos.py @@ -32,6 +32,7 @@ from .types.aquatroll import SetAquaTrollParameterUnit from .types.aquatroll import Type from .types.control import ActivateGuestPortsCtrl +from .types.control import ActivateMultibeamCtrl from .types.control import AutoAltitudeCtrl from .types.control import AutoDepthCtrl from .types.control import AutoHeadingCtrl @@ -41,6 +42,7 @@ from .types.control import CancelCalibrationCtrl from .types.control import ClearMissionCtrl from .types.control import DeactivateGuestPortsCtrl +from .types.control import DeactivateMultibeamCtrl from .types.control import FinishCalibrationCtrl from .types.control import GenericServoCtrl from .types.control import GripperCtrl @@ -59,6 +61,7 @@ from .types.control import RunMissionCtrl from .types.control import SetAquaTrollConnectionStatusCtrl from .types.control import SetAquaTrollParameterUnitCtrl +from .types.control import SetMultibeamConfigCtrl from .types.control import StartCalibrationCtrl from .types.control import StationKeepingCtrl from .types.control import SystemTimeCtrl @@ -122,6 +125,10 @@ from .types.message_formats import MedusaSpectrometerData from .types.message_formats import Model from .types.message_formats import MotionInput +from .types.message_formats import MultibeamConfig +from .types.message_formats import MultibeamDiscovery +from .types.message_formats import MultibeamFrequencyMode +from .types.message_formats import MultibeamPing from .types.message_formats import MultibeamServo from .types.message_formats import NStreamers from .types.message_formats import NavigationSensorID @@ -242,6 +249,9 @@ from .types.telemetry import LightsTel from .types.telemetry import MedusaSpectrometerDataTel from .types.telemetry import MissionStatusTel +from .types.telemetry import MultibeamConfigTel +from .types.telemetry import MultibeamDiscoveryTel +from .types.telemetry import MultibeamPingTel from .types.telemetry import MultibeamServoTel from .types.telemetry import NStreamersTel from .types.telemetry import NotificationTel @@ -260,6 +270,7 @@ __all__ = ( 'ActivateGuestPortsCtrl', + 'ActivateMultibeamCtrl', 'Altitude', 'AltitudeTel', 'AquaTrollDevice', @@ -331,6 +342,7 @@ 'CpProbeTel', 'DataStorageSpaceTel', 'DeactivateGuestPortsCtrl', + 'DeactivateMultibeamCtrl', 'Depth', 'DepthSetPoint', 'DepthSetPointCommand', @@ -408,6 +420,13 @@ 'Model', 'MotionInput', 'MotionInputCtrl', + 'MultibeamConfig', + 'MultibeamConfigTel', + 'MultibeamDiscovery', + 'MultibeamDiscoveryTel', + 'MultibeamFrequencyMode', + 'MultibeamPing', + 'MultibeamPingTel', 'MultibeamServo', 'MultibeamServoCtrl', 'MultibeamServoTel', @@ -456,6 +475,7 @@ 'SetInstructionUpdateReq', 'SetMissionRep', 'SetMissionReq', + 'SetMultibeamConfigCtrl', 'SetOverlayParametersRep', 'SetOverlayParametersReq', 'SetPubFrequencyRep', diff --git a/blueye/protocol/types/__init__.py b/blueye/protocol/types/__init__.py index 680c38c..5f257d9 100644 --- a/blueye/protocol/types/__init__.py +++ b/blueye/protocol/types/__init__.py @@ -81,6 +81,9 @@ Vector3, Imu, MedusaSpectrometerData, + MultibeamPing, + MultibeamConfig, + MultibeamDiscovery, IntervalType, HeadingSource, ResetCoordinateSource, @@ -101,6 +104,67 @@ NavigationSensorID, GuestPortDetachStatus, GuestPortError, + MultibeamFrequencyMode, +) +from .aquatroll import ( + AquaTrollParameterBlock, + AquaTrollSensorMetadata, + AquaTrollSensorMetadataArray, + AquaTrollProbeMetadata, + AquaTrollSensorParameters, + AquaTrollSensorParametersArray, + SetAquaTrollParameterUnit, + SetAquaTrollConnectionStatus, + Type, + AquaTrollDevice, + AquaTrollQuality, + AquaTrollParameter, + AquaTrollUnit, + AquaTrollSensor, + AquaTrollSensorStatus, + AquaTrollDeviceStatus, +) +from .control import ( + MotionInputCtrl, + TiltVelocityCtrl, + LightsCtrl, + GuestportLightsCtrl, + LaserCtrl, + PilotGPSPositionCtrl, + WatchdogCtrl, + RecordCtrl, + TakePictureCtrl, + StartCalibrationCtrl, + CancelCalibrationCtrl, + FinishCalibrationCtrl, + AutoHeadingCtrl, + AutoDepthCtrl, + AutoAltitudeCtrl, + StationKeepingCtrl, + WeatherVaningCtrl, + AutoPilotSurgeYawCtrl, + AutoPilotHeaveCtrl, + RunMissionCtrl, + PauseMissionCtrl, + ClearMissionCtrl, + ResetPositionCtrl, + ResetOdometerCtrl, + CalibrateDvlGyroCtrl, + TiltStabilizationCtrl, + WaterDensityCtrl, + PingerConfigurationCtrl, + SystemTimeCtrl, + GripperCtrl, + GenericServoCtrl, + MultibeamServoCtrl, + DeactivateGuestPortsCtrl, + ActivateGuestPortsCtrl, + RestartGuestPortsCtrl, + SetAquaTrollParameterUnitCtrl, + SetAquaTrollConnectionStatusCtrl, + SetMultibeamConfigCtrl, + ActivateMultibeamCtrl, + DeactivateMultibeamCtrl, ) from .mission_planning import ( Mission, @@ -127,24 +191,6 @@ InstructionType, MissionState, ) -from .aquatroll import ( - AquaTrollParameterBlock, - AquaTrollSensorMetadata, - AquaTrollSensorMetadataArray, - AquaTrollProbeMetadata, - AquaTrollSensorParameters, - AquaTrollSensorParametersArray, - SetAquaTrollParameterUnit, - SetAquaTrollConnectionStatus, - Type, - AquaTrollDevice, - AquaTrollQuality, - AquaTrollParameter, - AquaTrollUnit, - AquaTrollSensor, - AquaTrollSensorStatus, - AquaTrollDeviceStatus, -) from .telemetry import ( AttitudeTel, AltitudeTel, @@ -196,45 +242,9 @@ Imu1Tel, Imu2Tel, MedusaSpectrometerDataTel, -) -from .control import ( - MotionInputCtrl, - TiltVelocityCtrl, - LightsCtrl, - GuestportLightsCtrl, - LaserCtrl, - PilotGPSPositionCtrl, - WatchdogCtrl, - RecordCtrl, - TakePictureCtrl, - StartCalibrationCtrl, - CancelCalibrationCtrl, - FinishCalibrationCtrl, - AutoHeadingCtrl, - AutoDepthCtrl, - AutoAltitudeCtrl, - StationKeepingCtrl, - WeatherVaningCtrl, - AutoPilotSurgeYawCtrl, - AutoPilotHeaveCtrl, - RunMissionCtrl, - PauseMissionCtrl, - ClearMissionCtrl, - ResetPositionCtrl, - ResetOdometerCtrl, - CalibrateDvlGyroCtrl, - TiltStabilizationCtrl, - WaterDensityCtrl, - PingerConfigurationCtrl, - SystemTimeCtrl, - GripperCtrl, - GenericServoCtrl, - MultibeamServoCtrl, - DeactivateGuestPortsCtrl, - ActivateGuestPortsCtrl, - RestartGuestPortsCtrl, - SetAquaTrollParameterUnitCtrl, - SetAquaTrollConnectionStatusCtrl, + MultibeamPingTel, + MultibeamConfigTel, + MultibeamDiscoveryTel, ) from .req_rep import ( SetOverlayParametersReq, @@ -335,6 +345,9 @@ 'Vector3', 'Imu', 'MedusaSpectrometerData', + 'MultibeamPing', + 'MultibeamConfig', + 'MultibeamDiscovery', 'IntervalType', 'HeadingSource', 'ResetCoordinateSource', @@ -355,6 +368,63 @@ 'NavigationSensorID', 'GuestPortDetachStatus', 'GuestPortError', + 'MultibeamFrequencyMode', + 'AquaTrollParameterBlock', + 'AquaTrollSensorMetadata', + 'AquaTrollSensorMetadataArray', + 'AquaTrollProbeMetadata', + 'AquaTrollSensorParameters', + 'AquaTrollSensorParametersArray', + 'SetAquaTrollParameterUnit', + 'SetAquaTrollConnectionStatus', + 'Type', + 'AquaTrollDevice', + 'AquaTrollQuality', + 'AquaTrollParameter', + 'AquaTrollUnit', + 'AquaTrollSensor', + 'AquaTrollSensorStatus', + 'AquaTrollDeviceStatus', + 'MotionInputCtrl', + 'TiltVelocityCtrl', + 'LightsCtrl', + 'GuestportLightsCtrl', + 'LaserCtrl', + 'PilotGPSPositionCtrl', + 'WatchdogCtrl', + 'RecordCtrl', + 'TakePictureCtrl', + 'StartCalibrationCtrl', + 'CancelCalibrationCtrl', + 'FinishCalibrationCtrl', + 'AutoHeadingCtrl', + 'AutoDepthCtrl', + 'AutoAltitudeCtrl', + 'StationKeepingCtrl', + 'WeatherVaningCtrl', + 'AutoPilotSurgeYawCtrl', + 'AutoPilotHeaveCtrl', + 'RunMissionCtrl', + 'PauseMissionCtrl', + 'ClearMissionCtrl', + 'ResetPositionCtrl', + 'ResetOdometerCtrl', + 'CalibrateDvlGyroCtrl', + 'TiltStabilizationCtrl', + 'WaterDensityCtrl', + 'PingerConfigurationCtrl', + 'SystemTimeCtrl', + 'GripperCtrl', + 'GenericServoCtrl', + 'MultibeamServoCtrl', + 'DeactivateGuestPortsCtrl', + 'ActivateGuestPortsCtrl', + 'RestartGuestPortsCtrl', + 'SetAquaTrollParameterUnitCtrl', + 'SetAquaTrollConnectionStatusCtrl', + 'SetMultibeamConfigCtrl', + 'ActivateMultibeamCtrl', + 'DeactivateMultibeamCtrl', 'Mission', 'Instruction', 'DepthSetPoint', @@ -378,22 +448,6 @@ 'CameraAction', 'InstructionType', 'MissionState', - 'AquaTrollParameterBlock', - 'AquaTrollSensorMetadata', - 'AquaTrollSensorMetadataArray', - 'AquaTrollProbeMetadata', - 'AquaTrollSensorParameters', - 'AquaTrollSensorParametersArray', - 'SetAquaTrollParameterUnit', - 'SetAquaTrollConnectionStatus', - 'Type', - 'AquaTrollDevice', - 'AquaTrollQuality', - 'AquaTrollParameter', - 'AquaTrollUnit', - 'AquaTrollSensor', - 'AquaTrollSensorStatus', - 'AquaTrollDeviceStatus', 'AttitudeTel', 'AltitudeTel', 'ForwardDistanceTel', @@ -444,43 +498,9 @@ 'Imu1Tel', 'Imu2Tel', 'MedusaSpectrometerDataTel', - 'MotionInputCtrl', - 'TiltVelocityCtrl', - 'LightsCtrl', - 'GuestportLightsCtrl', - 'LaserCtrl', - 'PilotGPSPositionCtrl', - 'WatchdogCtrl', - 'RecordCtrl', - 'TakePictureCtrl', - 'StartCalibrationCtrl', - 'CancelCalibrationCtrl', - 'FinishCalibrationCtrl', - 'AutoHeadingCtrl', - 'AutoDepthCtrl', - 'AutoAltitudeCtrl', - 'StationKeepingCtrl', - 'WeatherVaningCtrl', - 'AutoPilotSurgeYawCtrl', - 'AutoPilotHeaveCtrl', - 'RunMissionCtrl', - 'PauseMissionCtrl', - 'ClearMissionCtrl', - 'ResetPositionCtrl', - 'ResetOdometerCtrl', - 'CalibrateDvlGyroCtrl', - 'TiltStabilizationCtrl', - 'WaterDensityCtrl', - 'PingerConfigurationCtrl', - 'SystemTimeCtrl', - 'GripperCtrl', - 'GenericServoCtrl', - 'MultibeamServoCtrl', - 'DeactivateGuestPortsCtrl', - 'ActivateGuestPortsCtrl', - 'RestartGuestPortsCtrl', - 'SetAquaTrollParameterUnitCtrl', - 'SetAquaTrollConnectionStatusCtrl', + 'MultibeamPingTel', + 'MultibeamConfigTel', + 'MultibeamDiscoveryTel', 'SetOverlayParametersReq', 'SetOverlayParametersRep', 'GetOverlayParametersReq', diff --git a/blueye/protocol/types/control.py b/blueye/protocol/types/control.py index 8d7e363..ac996a9 100644 --- a/blueye/protocol/types/control.py +++ b/blueye/protocol/types/control.py @@ -62,6 +62,9 @@ 'RestartGuestPortsCtrl', 'SetAquaTrollParameterUnitCtrl', 'SetAquaTrollConnectionStatusCtrl', + 'SetMultibeamConfigCtrl', + 'ActivateMultibeamCtrl', + 'DeactivateMultibeamCtrl', }, ) @@ -468,4 +471,36 @@ class SetAquaTrollConnectionStatusCtrl(proto.Message): ) +class SetMultibeamConfigCtrl(proto.Message): + r"""Update multibeam settings + + Attributes: + config (blueye.protocol.types.MultibeamConfig): + Message with the multibeam ping configuration + to set. + """ + + config = proto.Field(proto.MESSAGE, number=1, + message=message_formats.MultibeamConfig, + ) + + +class ActivateMultibeamCtrl(proto.Message): + r"""Activate multibeam + + Attributes: + config (blueye.protocol.types.MultibeamConfig): + Message with the multibeam ping configuration + to set on connect + """ + + config = proto.Field(proto.MESSAGE, number=1, + message=message_formats.MultibeamConfig, + ) + + +class DeactivateMultibeamCtrl(proto.Message): + r"""Deactivate multibeam""" + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/blueye/protocol/types/message_formats.py b/blueye/protocol/types/message_formats.py index c074d80..4d3ac5c 100644 --- a/blueye/protocol/types/message_formats.py +++ b/blueye/protocol/types/message_formats.py @@ -45,6 +45,7 @@ 'NavigationSensorID', 'GuestPortDetachStatus', 'GuestPortError', + 'MultibeamFrequencyMode', 'BinlogRecord', 'MotionInput', 'Lights', @@ -110,6 +111,9 @@ 'Vector3', 'Imu', 'MedusaSpectrometerData', + 'MultibeamPing', + 'MultibeamConfig', + 'MultibeamDiscovery', }, ) @@ -340,6 +344,14 @@ class GuestPortError(proto.Enum): GUEST_PORT_ERROR_PARSE_ERROR = 5 +class MultibeamFrequencyMode(proto.Enum): + r"""""" + MULTIBEAM_FREQUENCY_MODE_UNSPECIFIED = 0 + MULTIBEAM_FREQUENCY_MODE_AUTO = 1 + MULTIBEAM_FREQUENCY_MODE_LOW_FREQUENCY = 2 + MULTIBEAM_FREQUENCY_MODE_HIGH_FREQUENCY = 3 + + class BinlogRecord(proto.Message): r"""Wrapper message for each entry in the drone telemetry logfile. @@ -697,6 +709,10 @@ class RecordState(proto.Message): If the guestport camera is recording guestport_seconds (int): Guestport record time (s) + multibeam_is_recording (bool): + If the multibeam is recording + multibeam_seconds (int): + Multibeam record time (s) """ main_is_recording = proto.Field(proto.BOOL, number=1) @@ -707,6 +723,10 @@ class RecordState(proto.Message): guestport_seconds = proto.Field(proto.INT32, number=4) + multibeam_is_recording = proto.Field(proto.BOOL, number=5) + + multibeam_seconds = proto.Field(proto.INT32, number=6) + class TimeLapseState(proto.Message): r"""Time-lapse state published if time-lapse mission is running. @@ -1587,12 +1607,16 @@ class RecordOn(proto.Message): Record the main camera guestport (bool): Record external camera + multibeam (bool): + Record multibeam """ main = proto.Field(proto.BOOL, number=1) guestport = proto.Field(proto.BOOL, number=2) + multibeam = proto.Field(proto.BOOL, number=3) + class StorageSpace(proto.Message): r"""Storage space. @@ -2440,4 +2464,174 @@ class MedusaSpectrometerData(proto.Message): cosmics = proto.Field(proto.UINT32, number=5) +class MultibeamPing(proto.Message): + r"""Multibeam sonar ping + Contains all the information for rendering a multibeam sonar + frame + + Attributes: + range_ (float): + Maximum range value (m) + gain (float): + Percentage of gain (0 to 1) + frequency (float): + Ping acoustic frequency (Hz) + speed_of_sound_used (float): + Speed of sound used by the sonar for range + calculations (m/s) + frequency_mode (blueye.protocol.types.MultibeamFrequencyMode): + Frequency mode used by the sonar for this + frame + number_of_ranges (int): + Height of the ping image data. + number_of_beams (int): + Width of the ping image data. + step (int): + Size in bytes of each row in the ping data + image. + bearings (Sequence[float]): + Bearing angle of each column of the sonar + data (in 100th of a degree, multiply by 0.01 to + get a value in degrees). The sonar image is not + sampled uniformly in the bearing direction. + ping_data (bytes): + Ping data (row major, 2D, grayscale image) + device_id (blueye.protocol.types.GuestPortDeviceID): + Device ID of the sonar + """ + + range_ = proto.Field(proto.DOUBLE, number=1) + + gain = proto.Field(proto.DOUBLE, number=2) + + frequency = proto.Field(proto.DOUBLE, number=3) + + speed_of_sound_used = proto.Field(proto.DOUBLE, number=4) + + frequency_mode = proto.Field(proto.ENUM, number=5, + enum='MultibeamFrequencyMode', + ) + + number_of_ranges = proto.Field(proto.UINT32, number=6) + + number_of_beams = proto.Field(proto.UINT32, number=7) + + step = proto.Field(proto.UINT32, number=8) + + bearings = proto.RepeatedField(proto.FLOAT, number=9) + + ping_data = proto.Field(proto.BYTES, number=10) + + device_id = proto.Field(proto.ENUM, number=11, + enum='GuestPortDeviceID', + ) + + +class MultibeamConfig(proto.Message): + r"""Configuration message for sonar devices + + Attributes: + frequency_mode (blueye.protocol.types.MultibeamFrequencyMode): + Frequency mode used by the sonar if supported + ping_rate (blueye.protocol.types.MultibeamConfig.PingRate): + Sets the maximum ping rate. + gamma_correction (float): + Gamma correction (0..1.0) + gain_assist (bool): + Enable gain assist + maximum_number_of_beams (blueye.protocol.types.MultibeamConfig.MaximumNumberOfBeams): + Maximum number of beams. Used to throttle + bandwidth. + range_ (float): + The range demand (m) + gain (float): + The gain demand (0..1) + salinity (float): + Set water salinity (ppt). Defaults to zero in + fresh water + device_id (blueye.protocol.types.GuestPortDeviceID): + Device ID of the sonar + """ + class PingRate(proto.Enum): + r"""""" + PING_RATE_UNSPECIFIED = 0 + PING_RATE_NORMAL = 1 + PING_RATE_HIGH = 2 + PING_RATE_HIGHEST = 3 + PING_RATE_LOW = 4 + PING_RATE_LOWEST = 5 + PING_RATE_STANDBY = 6 + + class MaximumNumberOfBeams(proto.Enum): + r"""""" + MAXIMUM_NUMBER_OF_BEAMS_UNSPECIFIED = 0 + MAXIMUM_NUMBER_OF_BEAMS_MAX_128 = 1 + MAXIMUM_NUMBER_OF_BEAMS_MAX_256 = 2 + MAXIMUM_NUMBER_OF_BEAMS_MAX_512 = 3 + MAXIMUM_NUMBER_OF_BEAMS_MAX_1024 = 4 + + frequency_mode = proto.Field(proto.ENUM, number=1, + enum='MultibeamFrequencyMode', + ) + + ping_rate = proto.Field(proto.ENUM, number=2, + enum=PingRate, + ) + + gamma_correction = proto.Field(proto.DOUBLE, number=3) + + gain_assist = proto.Field(proto.BOOL, number=4) + + maximum_number_of_beams = proto.Field(proto.ENUM, number=5, + enum=MaximumNumberOfBeams, + ) + + range_ = proto.Field(proto.DOUBLE, number=6) + + gain = proto.Field(proto.DOUBLE, number=7) + + salinity = proto.Field(proto.DOUBLE, number=8) + + device_id = proto.Field(proto.ENUM, number=9, + enum='GuestPortDeviceID', + ) + + +class MultibeamDiscovery(proto.Message): + r"""Discovery message for sonar devices + + Attributes: + enabled (bool): + If the sonar driver is enabled + ip (str): + IP address of the sonar + mask (str): + Subnet mask of the sonar + serial_number (str): + Serial number of the sonar + fw_version (str): + Firmware version of the sonar + connected_ip (str): + IP address of the connected device + device_id (blueye.protocol.types.GuestPortDeviceID): + Device ID of the sonar + """ + + enabled = proto.Field(proto.BOOL, number=1) + + ip = proto.Field(proto.STRING, number=2) + + mask = proto.Field(proto.STRING, number=3) + + serial_number = proto.Field(proto.STRING, number=4) + + fw_version = proto.Field(proto.STRING, number=5) + + connected_ip = proto.Field(proto.STRING, number=6) + + device_id = proto.Field(proto.ENUM, number=7, + enum='GuestPortDeviceID', + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/blueye/protocol/types/telemetry.py b/blueye/protocol/types/telemetry.py index a04bc9f..6d81e08 100644 --- a/blueye/protocol/types/telemetry.py +++ b/blueye/protocol/types/telemetry.py @@ -76,6 +76,9 @@ 'Imu1Tel', 'Imu2Tel', 'MedusaSpectrometerDataTel', + 'MultibeamPingTel', + 'MultibeamConfigTel', + 'MultibeamDiscoveryTel', }, ) @@ -749,4 +752,43 @@ class MedusaSpectrometerDataTel(proto.Message): ) +class MultibeamPingTel(proto.Message): + r"""Multibeam sonar ping data + + Attributes: + ping (blueye.protocol.types.MultibeamPing): + Ping data from a multibeam sonar + """ + + ping = proto.Field(proto.MESSAGE, number=1, + message=message_formats.MultibeamPing, + ) + + +class MultibeamConfigTel(proto.Message): + r"""Multibeam sonar config + + Attributes: + config (blueye.protocol.types.MultibeamConfig): + Config data from a multibeam sonar + """ + + config = proto.Field(proto.MESSAGE, number=1, + message=message_formats.MultibeamConfig, + ) + + +class MultibeamDiscoveryTel(proto.Message): + r"""Multibeam sonar status message + + Attributes: + discovery (blueye.protocol.types.MultibeamDiscovery): + Discovery data from a multibeam sonar + """ + + discovery = proto.Field(proto.MESSAGE, number=1, + message=message_formats.MultibeamDiscovery, + ) + + __all__ = tuple(sorted(__protobuf__.manifest))