From 5218ba956b61980212273ed013f7565ceb267270 Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Mon, 20 Jan 2025 11:35:17 +0100 Subject: [PATCH 1/5] Use template for fixing protos.py --- blueye/protocol/protos.py | 1 + .../%name_%version/%sub/__init__.py.j2 | 60 +++++++++++++++++++ tasks.py | 26 ++------ 3 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 generators/templates/templates/%namespace/%name_%version/%sub/__init__.py.j2 diff --git a/blueye/protocol/protos.py b/blueye/protocol/protos.py index 8ba148a..0b12b73 100644 --- a/blueye/protocol/protos.py +++ b/blueye/protocol/protos.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + from .types.aquatroll import AquaTrollParameterBlock from .types.aquatroll import AquaTrollProbeMetadata from .types.aquatroll import AquaTrollSensorMetadata diff --git a/generators/templates/templates/%namespace/%name_%version/%sub/__init__.py.j2 b/generators/templates/templates/%namespace/%name_%version/%sub/__init__.py.j2 new file mode 100644 index 0000000..0825994 --- /dev/null +++ b/generators/templates/templates/%namespace/%name_%version/%sub/__init__.py.j2 @@ -0,0 +1,60 @@ +{% extends '_base.py.j2' %} + +{% block content %} +{# Import subpackages. -#} +{% for subpackage, _ in api.subpackages|dictsort %} +from . import {{ subpackage }} +{% endfor %} + +{# Import services for this package. -#} +{% for service in api.services.values()|sort(attribute='name') + if service.meta.address.subpackage == api.subpackage_view %} +from .services.{{ service.name|snake_case }} import {{ service.client_name }} +{% if 'grpc' in opts.transport %} +from .services.{{ service.name|snake_case }} import {{ service.async_client_name }} +{% endif %} +{% endfor %} + +{# Import messages and enums from each proto. + It is safe to import all of the messages into the same namespace here, + because protocol buffers itself enforces selector uniqueness within + a proto package. +-#} +{% for proto in api.protos.values()|sort(attribute='name') + if proto.meta.address.subpackage == api.subpackage_view %} +{% for message in proto.messages.values()|sort(attribute='name') %} +from .types.{{ proto.module_name }} import {{ message.name }} +{% endfor %} +{% for enum in proto.enums.values()|sort(attribute='name') %} +from .types.{{ proto.module_name }} import {{ enum.name }} +{% endfor %} +{% endfor %} + +{# Define __all__. + This requires the full set of imported names, so we iterate over + them again. +-#} +__all__ = ( + {% filter sort_lines -%} + {% for subpackage in api.subpackages -%} + '{{ subpackage }}', + {% endfor -%} + {% for service in api.services.values() + if service.meta.address.subpackage == api.subpackage_view -%} + '{{ service.client_name }}', + {% if 'grpc' in opts.transport %} + '{{ service.async_client_name }}', + {% endif %} + {% endfor -%} + {% for proto in api.protos.values() + if proto.meta.address.subpackage == api.subpackage_view -%} + {% for message in proto.messages.values()|sort(attribute='name') -%} + '{{ message.name }}', + {% endfor -%} + {% for enum in proto.enums.values() -%} + '{{ enum.name }}', + {% endfor -%} + {% endfor -%} + {% endfilter %} +) +{% endblock %} diff --git a/tasks.py b/tasks.py index 3e3b1b3..48171ec 100644 --- a/tasks.py +++ b/tasks.py @@ -49,34 +49,16 @@ def generate_proto(context): "docker run \ --mount type=bind,source=$(pwd)/ProtocolDefinitions/protobuf_definitions/,destination=/in/ \ --mount type=bind,source=$(pwd)/build/,destination=/out/ \ + --mount type=bind,source=$(pwd)/generators/templates/templates,destination=/templates/,readonly \ --rm \ --user $UID \ - blueyerobotics/gapic-generator-python:v1.21.0" # noqa F501 + blueyerobotics/gapic-generator-python:v1.21.0-fix-options \ + --python-gapic-templates /templates/ \ + --python-gapic-templates DEFAULT" # noqa F501 ) context.run("cp -r build/blueye/protocol/types blueye/protocol/") context.run("cp -r build/blueye/protocol/__init__.py blueye/protocol/protos.py") - # Remove package_version lines from protos.py to avoid circular import - protos_file_path = get_project_root_path() / "blueye/protocol/protos.py" - with open(protos_file_path, "r") as file: - lines = file.readlines() - - lines_to_remove = [ - "from blueye.protocol import gapic_version as package_version\n", - "__version__ = package_version.__version__\n", - ] - - with open(protos_file_path, "w") as file: - skip_empty_lines = False - for line in lines: - if line in lines_to_remove: - skip_empty_lines = True - continue - if skip_empty_lines and line.strip() == "": - continue - skip_empty_lines = False - file.write(line) - @task(pre=[generate_tcp, generate_udp]) def test(context): From b3f70da40c8e2bbaa62feef552dd3400c9419a67 Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Mon, 20 Jan 2025 13:30:49 +0100 Subject: [PATCH 2/5] Strip protolint comments before generating --- blueye/protocol/types/aquatroll.py | 6 ++-- tasks.py | 50 ++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/blueye/protocol/types/aquatroll.py b/blueye/protocol/types/aquatroll.py index fa2f73b..8ad986d 100644 --- a/blueye/protocol/types/aquatroll.py +++ b/blueye/protocol/types/aquatroll.py @@ -154,7 +154,7 @@ class AquaTrollQuality(proto.Enum): Values: AQUA_TROLL_QUALITY_NORMAL (0): - protolint:disable:this ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + No description available. AQUA_TROLL_QUALITY_USER_CAL_EXPIRED (1): No description available. AQUA_TROLL_QUALITY_FACTORY_CAL_EXPIRED (2): @@ -809,7 +809,7 @@ class AquaTrollSensorStatus(proto.Enum): Values: AQUA_TROLL_SENSOR_STATUS_SENSOR_HIGH_ALARM (0): - protolint:disable:this ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + No description available. AQUA_TROLL_SENSOR_STATUS_SENSOR_HIGH_WARNING (1): No description available. AQUA_TROLL_SENSOR_STATUS_SENSOR_LOW_WARNING (2): @@ -840,7 +840,7 @@ class AquaTrollDeviceStatus(proto.Enum): Values: AQUA_TROLL_DEVICE_STATUS_SENSOR_HIGH_ALARM (0): - protolint:disable:this ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + No description available. AQUA_TROLL_DEVICE_STATUS_SENSOR_HIGH_WARNING (1): No description available. AQUA_TROLL_DEVICE_STATUS_SENSOR_LOW_WARNING (2): diff --git a/tasks.py b/tasks.py index 48171ec..dafb44a 100644 --- a/tasks.py +++ b/tasks.py @@ -1,3 +1,4 @@ +import re from pathlib import Path import toml @@ -5,8 +6,30 @@ from packaging.utils import canonicalize_name +def strip_protolint_comments(file_path: Path): + """ + Strip protolint comments from the given .proto file. + + Args: + file_path (Path): The path to the .proto file. + """ + # Read the content of the file + with file_path.open("r") as file: + content = file.read() + + # Define the regex pattern to match protolint comments + pattern = r"protolint:disable:(next|this) [A-Z_]+" + + # Remove the protolint comments + modified_content = re.sub(pattern, "", content) + + # Write the modified content back to the file + with file_path.open("w") as file: + file.write(modified_content) + + def get_project_root_path() -> Path: - """Get the projet root path + """Get the project root path The tasks.py file (this file) always resides in the root of the project, therefore we can use it as a reference @@ -14,6 +37,18 @@ def get_project_root_path() -> Path: return Path(__file__).parent +def gather_proto_files(proto_dir: Path) -> list[Path]: + """Gather all .proto files in the given directory + + Args: + proto_dir (Path): The directory to search for .proto files + + Returns: + list[Path]: A list of paths to .proto files + """ + return list(proto_dir.rglob("*.proto")) + + @task def generate_tcp(context): """ @@ -44,10 +79,19 @@ def generate_proto(context): installed. """ with context.cd(get_project_root_path()): - context.run("rm -rf build && mkdir -p build") + context.run( + "rm -rf build && mkdir -p build && mkdir -p build/protobuf_definitions" + ) + context.run( + "cp -r ProtocolDefinitions/protobuf_definitions/* build/protobuf_definitions/" + ) + proto_dir = get_project_root_path() / "build" / "protobuf_definitions" + proto_files = gather_proto_files(proto_dir) + for file in proto_files: + strip_protolint_comments(file) context.run( "docker run \ - --mount type=bind,source=$(pwd)/ProtocolDefinitions/protobuf_definitions/,destination=/in/ \ + --mount type=bind,source=$(pwd)/build/protobuf_definitions/,destination=/in/ \ --mount type=bind,source=$(pwd)/build/,destination=/out/ \ --mount type=bind,source=$(pwd)/generators/templates/templates,destination=/templates/,readonly \ --rm \ From 353c346dbafab22b13c7c804ec60819515b2c67d Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Mon, 20 Jan 2025 13:35:24 +0100 Subject: [PATCH 3/5] Add enum template Replaces "Values:" with "Attributes:" to be compatible with the Google docstring style. --- blueye/protocol/types/aquatroll.py | 16 +++--- blueye/protocol/types/message_formats.py | 52 +++++++++---------- blueye/protocol/types/mission_planning.py | 12 ++--- .../%name_%version/%sub/types/_enum.py.j2 | 20 +++++++ 4 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 diff --git a/blueye/protocol/types/aquatroll.py b/blueye/protocol/types/aquatroll.py index 8ad986d..fea72f0 100644 --- a/blueye/protocol/types/aquatroll.py +++ b/blueye/protocol/types/aquatroll.py @@ -48,7 +48,7 @@ class Type(proto.Enum): r"""Type IDs - Values: + Attributes: TYPE_UNSPECIFIED (0): No description available. TYPE_SHORT (1): @@ -85,7 +85,7 @@ class Type(proto.Enum): class AquaTrollDevice(proto.Enum): r"""Aqua Troll Device IDs - Values: + Attributes: AQUA_TROLL_DEVICE_UNSPECIFIED (0): No description available. AQUA_TROLL_DEVICE_LEVEL_TROLL_500 (1): @@ -152,7 +152,7 @@ class AquaTrollDevice(proto.Enum): class AquaTrollQuality(proto.Enum): r"""Aqua Troll Quality IDs - Values: + Attributes: AQUA_TROLL_QUALITY_NORMAL (0): No description available. AQUA_TROLL_QUALITY_USER_CAL_EXPIRED (1): @@ -183,7 +183,7 @@ class AquaTrollQuality(proto.Enum): class AquaTrollParameter(proto.Enum): r"""Aqua Troll Parameter IDs - Values: + Attributes: AQUA_TROLL_PARAMETER_UNSPECIFIED (0): No description available. AQUA_TROLL_PARAMETER_TEMPERATURE (1): @@ -364,7 +364,7 @@ class AquaTrollParameter(proto.Enum): class AquaTrollUnit(proto.Enum): r"""Aqua Troll Unit IDs - Values: + Attributes: AQUA_TROLL_UNIT_UNSPECIFIED (0): No description available. AQUA_TROLL_UNIT_TEMP_CELSIUS (1): @@ -623,7 +623,7 @@ class AquaTrollUnit(proto.Enum): class AquaTrollSensor(proto.Enum): r"""Aqua Troll Sensor IDs - Values: + Attributes: AQUA_TROLL_SENSOR_UNSPECIFIED (0): No description available. AQUA_TROLL_SENSOR_TEMPERATURE (1): @@ -807,7 +807,7 @@ class AquaTrollSensor(proto.Enum): class AquaTrollSensorStatus(proto.Enum): r"""Aqua Troll Sensor Status IDs - Values: + Attributes: AQUA_TROLL_SENSOR_STATUS_SENSOR_HIGH_ALARM (0): No description available. AQUA_TROLL_SENSOR_STATUS_SENSOR_HIGH_WARNING (1): @@ -838,7 +838,7 @@ class AquaTrollSensorStatus(proto.Enum): class AquaTrollDeviceStatus(proto.Enum): r"""Aqua Troll Device Status IDs - Values: + Attributes: AQUA_TROLL_DEVICE_STATUS_SENSOR_HIGH_ALARM (0): No description available. AQUA_TROLL_DEVICE_STATUS_SENSOR_HIGH_WARNING (1): diff --git a/blueye/protocol/types/message_formats.py b/blueye/protocol/types/message_formats.py index bd004b5..3538b48 100644 --- a/blueye/protocol/types/message_formats.py +++ b/blueye/protocol/types/message_formats.py @@ -129,7 +129,7 @@ class IntervalType(proto.Enum): r"""Interval type for time-lapse photos. - Values: + Attributes: INTERVAL_TYPE_UNSPECIFIED (0): Unspecified INTERVAL_TYPE_TIME (1): @@ -145,7 +145,7 @@ class IntervalType(proto.Enum): class HeadingSource(proto.Enum): r"""Heading source used during reset of the position estimate. - Values: + Attributes: HEADING_SOURCE_UNSPECIFIED (0): Unspecified HEADING_SOURCE_DRONE_COMPASS (1): @@ -161,7 +161,7 @@ class HeadingSource(proto.Enum): class ResetCoordinateSource(proto.Enum): r""" - Values: + Attributes: RESET_COORDINATE_SOURCE_UNSPECIFIED (0): Unspecified, fallback to device GPS RESET_COORDINATE_SOURCE_DEVICE_GPS (1): @@ -179,7 +179,7 @@ class NotificationType(proto.Enum): r"""Notification is used for displaying info, warnings, and errors to the user. - Values: + Attributes: NOTIFICATION_TYPE_UNSPECIFIED (0): Unspecified NOTIFICATION_TYPE_POSITION_ESTIMATE_IS_INACCURATE (1): @@ -286,7 +286,7 @@ class NotificationType(proto.Enum): class NotificationLevel(proto.Enum): r"""List of available notification levels. - Values: + Attributes: NOTIFICATION_LEVEL_UNSPECIFIED (0): Unspecified NOTIFICATION_LEVEL_INFO (1): @@ -305,7 +305,7 @@ class NotificationLevel(proto.Enum): class Model(proto.Enum): r"""Drone models produced by Blueye - Values: + Attributes: MODEL_UNSPECIFIED (0): ModelName not specified MODEL_PIONEER (1): @@ -334,7 +334,7 @@ class Model(proto.Enum): class PressureSensorType(proto.Enum): r"""Depth sensors used by the drone. - Values: + Attributes: PRESSURE_SENSOR_TYPE_UNSPECIFIED (0): Depth sensor type not specified PRESSURE_SENSOR_TYPE_NOT_CONNECTED (1): @@ -358,7 +358,7 @@ class PressureSensorType(proto.Enum): class Resolution(proto.Enum): r"""Available camera resolutions. - Values: + Attributes: RESOLUTION_UNSPECIFIED (0): Resolution not specified RESOLUTION_FULLHD_1080P (1): @@ -374,7 +374,7 @@ class Resolution(proto.Enum): class Framerate(proto.Enum): r"""Available camera frame rates. - Values: + Attributes: FRAMERATE_UNSPECIFIED (0): Framerate not specified FRAMERATE_FPS_30 (1): @@ -390,7 +390,7 @@ class Framerate(proto.Enum): class Camera(proto.Enum): r"""Which camera to control. - Values: + Attributes: CAMERA_UNSPECIFIED (0): Camera not specified CAMERA_MAIN (1): @@ -406,7 +406,7 @@ class Camera(proto.Enum): class TemperatureUnit(proto.Enum): r"""Available temperature units. - Values: + Attributes: TEMPERATURE_UNIT_UNSPECIFIED (0): Temperature unit not specified TEMPERATURE_UNIT_CELSIUS (1): @@ -422,7 +422,7 @@ class TemperatureUnit(proto.Enum): class LogoType(proto.Enum): r"""Available logo types. - Values: + Attributes: LOGO_TYPE_UNSPECIFIED (0): Logo type not specified LOGO_TYPE_NONE (1): @@ -441,7 +441,7 @@ class LogoType(proto.Enum): class DepthUnit(proto.Enum): r"""Available depth units. - Values: + Attributes: DEPTH_UNIT_UNSPECIFIED (0): Depth unit not specified DEPTH_UNIT_METERS (1): @@ -457,7 +457,7 @@ class DepthUnit(proto.Enum): class ThicknessUnit(proto.Enum): r"""Available thickness units. - Values: + Attributes: THICKNESS_UNIT_UNSPECIFIED (0): Thickness unit not specified THICKNESS_UNIT_MILLIMETERS (1): @@ -473,7 +473,7 @@ class ThicknessUnit(proto.Enum): class FontSize(proto.Enum): r"""Available font sizes for overlay text elements. - Values: + Attributes: FONT_SIZE_UNSPECIFIED (0): Font size not specified FONT_SIZE_PX15 (1): @@ -501,7 +501,7 @@ class FontSize(proto.Enum): class GuestPortDeviceID(proto.Enum): r"""GuestPort device ID. - Values: + Attributes: GUEST_PORT_DEVICE_ID_UNSPECIFIED (0): Unspecified GUEST_PORT_DEVICE_ID_BLIND_PLUG (1): @@ -637,7 +637,7 @@ class GuestPortDeviceID(proto.Enum): class GuestPortNumber(proto.Enum): r"""GuestPort number. - Values: + Attributes: GUEST_PORT_NUMBER_UNSPECIFIED (0): Unspecified GUEST_PORT_NUMBER_PORT_1 (1): @@ -657,7 +657,7 @@ class NavigationSensorID(proto.Enum): r"""List of navigation sensors that can be used by the position observer - Values: + Attributes: NAVIGATION_SENSOR_ID_UNSPECIFIED (0): Unspecified NAVIGATION_SENSOR_ID_WATERLINKED_DVL_A50 (1): @@ -682,7 +682,7 @@ class NavigationSensorID(proto.Enum): class GuestPortDetachStatus(proto.Enum): r"""GuestPort detach status. - Values: + Attributes: GUEST_PORT_DETACH_STATUS_UNSPECIFIED (0): Unspecified (Default for non-detachable devices) @@ -700,7 +700,7 @@ class GuestPortError(proto.Enum): r"""GuestPort error. Only indicated errors on the guest port connector itself. - Values: + Attributes: GUEST_PORT_ERROR_UNSPECIFIED (0): Unspecified value GUEST_PORT_ERROR_NOT_CONNECTED (1): @@ -725,7 +725,7 @@ class GuestPortError(proto.Enum): class MultibeamFrequencyMode(proto.Enum): r""" - Values: + Attributes: MULTIBEAM_FREQUENCY_MODE_UNSPECIFIED (0): No description available. MULTIBEAM_FREQUENCY_MODE_AUTO (1): @@ -1307,7 +1307,7 @@ class PingerConfiguration(proto.Message): class MountingDirection(proto.Enum): r""" - Values: + Attributes: MOUNTING_DIRECTION_UNSPECIFIED (0): Mounting direction is unspecified MOUNTING_DIRECTION_FORWARDS (1): @@ -1581,7 +1581,7 @@ class BatteryStatus(proto.Message): class BatteryError(proto.Enum): r"""Battery error code from BQ40Z50 BMS data sheet. - Values: + Attributes: BATTERY_ERROR_UNSPECIFIED (0): No description available. BATTERY_ERROR_OK (1): @@ -2647,7 +2647,7 @@ class Status(proto.Enum): When calibration is started, the status will indicate the active (upfacing) axis. - Values: + Attributes: STATUS_UNSPECIFIED (0): Unspecified status STATUS_NOT_CALIBRATING (1): @@ -3964,7 +3964,7 @@ class MultibeamConfig(proto.Message): class PingRate(proto.Enum): r""" - Values: + Attributes: PING_RATE_UNSPECIFIED (0): No description available. PING_RATE_NORMAL (1): @@ -3991,7 +3991,7 @@ class PingRate(proto.Enum): class MaximumNumberOfBeams(proto.Enum): r""" - Values: + Attributes: MAXIMUM_NUMBER_OF_BEAMS_UNSPECIFIED (0): No description available. MAXIMUM_NUMBER_OF_BEAMS_MAX_128 (1): diff --git a/blueye/protocol/types/mission_planning.py b/blueye/protocol/types/mission_planning.py index f41382a..6dd0131 100644 --- a/blueye/protocol/types/mission_planning.py +++ b/blueye/protocol/types/mission_planning.py @@ -56,7 +56,7 @@ class DepthZeroReference(proto.Enum): r"""Depth zero reference from surface for depth, and seabed for altitude. - Values: + Attributes: DEPTH_ZERO_REFERENCE_UNSPECIFIED (0): No description available. DEPTH_ZERO_REFERENCE_SURFACE (1): @@ -72,7 +72,7 @@ class DepthZeroReference(proto.Enum): class ControlModeVertical(proto.Enum): r""" - Values: + Attributes: CONTROL_MODE_VERTICAL_UNSPECIFIED (0): Unspecified CONTROL_MODE_VERTICAL_MANUAL (1): @@ -91,7 +91,7 @@ class ControlModeVertical(proto.Enum): class ControlModeHorizontal(proto.Enum): r""" - Values: + Attributes: CONTROL_MODE_HORIZONTAL_UNSPECIFIED (0): Unspecified CONTROL_MODE_HORIZONTAL_MANUAL (1): @@ -110,7 +110,7 @@ class ControlModeHorizontal(proto.Enum): class CameraAction(proto.Enum): r"""List of available camera actions. - Values: + Attributes: CAMERA_ACTION_UNSPECIFIED (0): Unspecified command CAMERA_ACTION_TAKE_PHOTO (1): @@ -138,7 +138,7 @@ class CameraAction(proto.Enum): class InstructionType(proto.Enum): r"""List of available instruction types. - Values: + Attributes: INSTRUCTION_TYPE_UNSPECIFIED (0): Unspecified INSTRUCTION_TYPE_NONE (1): @@ -185,7 +185,7 @@ class InstructionType(proto.Enum): class MissionState(proto.Enum): r"""List of mission supervisor states. - Values: + Attributes: MISSION_STATE_UNSPECIFIED (0): Unspecified MISSION_STATE_INACTIVE (1): diff --git a/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 b/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 new file mode 100644 index 0000000..5381ce3 --- /dev/null +++ b/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 @@ -0,0 +1,20 @@ +class {{ enum.name }}({{ p }}.Enum): + r"""{{ enum.meta.doc|rst(indent=4) }} + + Attributes: + {% for enum_value in enum.values %} + {{ enum_value.name }} ({{ enum_value.number }}): + {% if enum_value.meta.doc|length > 0 %} + {{ enum_value.meta.doc|rst(width=72, indent=12, nl=False) }} + {% else %} + No description available. + {% endif %} + {%- endfor %} + """ + {% if enum.enum_pb.HasField("options") %} + _pb_options = {{ enum.options_dict }} + {% endif %} + {% for enum_value in enum.values %} + {{ enum_value.name }} = {{ enum_value.number }} + {% endfor %} +{{ '\n\n' }} From 2146b50dd73dfc2a35787551463898bfe06cad83 Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Mon, 20 Jan 2025 13:38:31 +0100 Subject: [PATCH 4/5] Document enum attributes directly Makes the enum docstrings show up when hovering in most editors. --- blueye/protocol/types/message_formats.py | 178 ++++++++++++++++++ blueye/protocol/types/mission_planning.py | 38 ++++ .../%name_%version/%sub/types/_enum.py.j2 | 3 + 3 files changed, 219 insertions(+) diff --git a/blueye/protocol/types/message_formats.py b/blueye/protocol/types/message_formats.py index 3538b48..a550b2e 100644 --- a/blueye/protocol/types/message_formats.py +++ b/blueye/protocol/types/message_formats.py @@ -138,8 +138,11 @@ class IntervalType(proto.Enum): Distance interval """ INTERVAL_TYPE_UNSPECIFIED = 0 + """Unspecified""" INTERVAL_TYPE_TIME = 1 + """Time interval""" INTERVAL_TYPE_DISTANCE = 2 + """Distance interval""" class HeadingSource(proto.Enum): @@ -154,8 +157,11 @@ class HeadingSource(proto.Enum): Used when the user sets the heading manually """ HEADING_SOURCE_UNSPECIFIED = 0 + """Unspecified""" HEADING_SOURCE_DRONE_COMPASS = 1 + """Uses the drone compass to set the heading""" HEADING_SOURCE_MANUAL_INPUT = 2 + """Used when the user sets the heading manually""" class ResetCoordinateSource(proto.Enum): @@ -171,8 +177,11 @@ class ResetCoordinateSource(proto.Enum): the reset point """ RESET_COORDINATE_SOURCE_UNSPECIFIED = 0 + """Unspecified, fallback to device GPS""" RESET_COORDINATE_SOURCE_DEVICE_GPS = 1 + """Uses the device GPS to set the reset point""" RESET_COORDINATE_SOURCE_MANUAL = 2 + """Uses a coordinate in decimal degrees to set the reset point""" class NotificationType(proto.Enum): @@ -249,38 +258,71 @@ class NotificationType(proto.Enum): DVL thermal protection mode detected """ NOTIFICATION_TYPE_UNSPECIFIED = 0 + """Unspecified""" NOTIFICATION_TYPE_POSITION_ESTIMATE_IS_INACCURATE = 1 + """Position estimate is inaccurate""" NOTIFICATION_TYPE_DRONE_POSITION_IS_UNKNOWN = 2 + """Drone position is unknown""" NOTIFICATION_TYPE_USER_POSITION_IS_UNKNOWN = 3 + """User position is unknown""" NOTIFICATION_TYPE_NO_MISSION_LOADED = 4 + """No mission is loaded""" NOTIFICATION_TYPE_MISSION_LOADED = 5 + """Mission is loaded""" NOTIFICATION_TYPE_FAILED_TO_LOAD_MISSION = 6 + """Failed to load mission""" NOTIFICATION_TYPE_MISSION_COMPLETE = 7 + """Mission is complete""" NOTIFICATION_TYPE_INSTRUCTION_COMPLETE = 8 + """Instruction is complete""" NOTIFICATION_TYPE_WAYPOINT_REACHED = 9 + """Waypoint reached""" NOTIFICATION_TYPE_DEPTH_TARGET_REACHED = 10 + """Depth set point is reached""" NOTIFICATION_TYPE_ALTITUDE_TARGET_REACHED = 11 + """Altitude set point is reached""" NOTIFICATION_TYPE_WAYPOINT_IS_TOO_FAR_AWAY = 12 + """The waypoint is too far away""" NOTIFICATION_TYPE_DEPTH_SET_POINT_IS_TOO_FAR_AWAY = 13 + """The depth set point is too far away""" NOTIFICATION_TYPE_TIME_TO_COMPLETE_IS_TOO_LONG = 14 + """The time to complete the mission is too long""" NOTIFICATION_TYPE_RETURNING_TO_HOME = 15 + """Returning to home""" NOTIFICATION_TYPE_GO_TO_SURFACE = 16 + """Go to surface""" NOTIFICATION_TYPE_GO_TO_SEABED = 17 + """Go to seabed with an altimeter""" NOTIFICATION_TYPE_GO_TO_WAYPOINT = 18 + """Go to waypoint""" NOTIFICATION_TYPE_GO_TO_DEPTH_SET_POINT = 19 + """Go to depth set point""" NOTIFICATION_TYPE_GO_TO_WAYPOINT_WITH_DEPTH_SET_POINT = 20 + """Go to waypoint with depth set point""" NOTIFICATION_TYPE_MISSION_STARTED = 21 + """Mission is started""" NOTIFICATION_TYPE_MISSION_PAUSED = 22 + """Mission is paused""" NOTIFICATION_TYPE_MISSION_RESUMED = 23 + """Mission is resumed""" NOTIFICATION_TYPE_MISSION_ABORTED = 24 + """Mission is aborted""" NOTIFICATION_TYPE_DRONE_IS_STUCK = 25 + """Drone is stuck during a mission""" NOTIFICATION_TYPE_WAIT_FOR = 26 + """Wait for instruction running""" NOTIFICATION_TYPE_CAMERA_ACTION = 27 + """Camera action initiated""" NOTIFICATION_TYPE_SET_TILT_MAIN_CAMERA = 28 + """Set tilt for main camera""" NOTIFICATION_TYPE_SET_TILT_MULTIBEAM = 29 + """Set tilt for multibeam""" NOTIFICATION_TYPE_INSTRUCTION_SKIPPED = 30 + """When an instruction is not available in the ROV""" NOTIFICATION_TYPE_DVL_HIGH_TEMPERATURE_DETECTED = 31 + """DVL high temperature detected""" NOTIFICATION_TYPE_DVL_THERMAL_PROTECTION_MODE_DETECTED = 32 + """DVL thermal protection mode detected""" class NotificationLevel(proto.Enum): @@ -297,9 +339,13 @@ class NotificationLevel(proto.Enum): Error """ NOTIFICATION_LEVEL_UNSPECIFIED = 0 + """Unspecified""" NOTIFICATION_LEVEL_INFO = 1 + """Info""" NOTIFICATION_LEVEL_WARNING = 2 + """Warning""" NOTIFICATION_LEVEL_ERROR = 3 + """Error""" class Model(proto.Enum): @@ -323,12 +369,19 @@ class Model(proto.Enum): Blueye ? """ MODEL_UNSPECIFIED = 0 + """ModelName not specified""" MODEL_PIONEER = 1 + """Blueye Pioneer, the first model""" MODEL_PRO = 2 + """Blueye Pro, features camera tilt""" MODEL_X1 = 4 + """Blueye X1, features camera tilt and one guest port""" MODEL_X3 = 3 + """Blueye X3, features support for peripherals""" MODEL_X3_ULTRA = 6 + """Blueye X3 Ultra""" MODEL_NEXT = 5 + """Blueye ?""" class PressureSensorType(proto.Enum): @@ -349,10 +402,17 @@ class PressureSensorType(proto.Enum): 02BA03 pressure sensor """ PRESSURE_SENSOR_TYPE_UNSPECIFIED = 0 + """Depth sensor type not specified""" PRESSURE_SENSOR_TYPE_NOT_CONNECTED = 1 + """No se""" PRESSURE_SENSOR_TYPE_MS5837_30BA26 = 2 + """Thh MS5837 30BA26 pressure sensor""" PRESSURE_SENSOR_TYPE_KELLER_PA7LD = 3 + """The extended depth sensor using the Keller PA7LD pressure + sensor""" PRESSURE_SENSOR_TYPE_MS5637_02BA03 = 4 + """The internal pressure sensor using the MS5637 02BA03 pressure + sensor""" class Resolution(proto.Enum): @@ -367,8 +427,11 @@ class Resolution(proto.Enum): 720p HD resolution """ RESOLUTION_UNSPECIFIED = 0 + """Resolution not specified""" RESOLUTION_FULLHD_1080P = 1 + """1080p Full HD resolution""" RESOLUTION_HD_720P = 2 + """720p HD resolution""" class Framerate(proto.Enum): @@ -383,8 +446,11 @@ class Framerate(proto.Enum): 25 frames per second """ FRAMERATE_UNSPECIFIED = 0 + """Framerate not specified""" FRAMERATE_FPS_30 = 1 + """30 frames per second""" FRAMERATE_FPS_25 = 2 + """25 frames per second""" class Camera(proto.Enum): @@ -399,8 +465,11 @@ class Camera(proto.Enum): Guestport camera """ CAMERA_UNSPECIFIED = 0 + """Camera not specified""" CAMERA_MAIN = 1 + """Main camera""" CAMERA_GUESTPORT = 2 + """Guestport camera""" class TemperatureUnit(proto.Enum): @@ -415,8 +484,11 @@ class TemperatureUnit(proto.Enum): Temperature should be displayed as Fahrenheit """ TEMPERATURE_UNIT_UNSPECIFIED = 0 + """Temperature unit not specified""" TEMPERATURE_UNIT_CELSIUS = 1 + """Temperature should be displayed as Celsius""" TEMPERATURE_UNIT_FAHRENHEIT = 2 + """Temperature should be displayed as Fahrenheit""" class LogoType(proto.Enum): @@ -433,9 +505,13 @@ class LogoType(proto.Enum): Add user defined logo """ LOGO_TYPE_UNSPECIFIED = 0 + """Logo type not specified""" LOGO_TYPE_NONE = 1 + """Do not add any logo""" LOGO_TYPE_DEFAULT = 2 + """Add default logo""" LOGO_TYPE_CUSTOM = 3 + """Add user defined logo""" class DepthUnit(proto.Enum): @@ -450,8 +526,11 @@ class DepthUnit(proto.Enum): Depth should be displayed as feet """ DEPTH_UNIT_UNSPECIFIED = 0 + """Depth unit not specified""" DEPTH_UNIT_METERS = 1 + """Depth should be displayed as meters""" DEPTH_UNIT_FEET = 2 + """Depth should be displayed as feet""" class ThicknessUnit(proto.Enum): @@ -466,8 +545,11 @@ class ThicknessUnit(proto.Enum): Thickness should be displayed as inches """ THICKNESS_UNIT_UNSPECIFIED = 0 + """Thickness unit not specified""" THICKNESS_UNIT_MILLIMETERS = 1 + """Thickness should be displayed as millimeters""" THICKNESS_UNIT_INCHES = 2 + """Thickness should be displayed as inches""" class FontSize(proto.Enum): @@ -490,12 +572,19 @@ class FontSize(proto.Enum): 40 px """ FONT_SIZE_UNSPECIFIED = 0 + """Font size not specified""" FONT_SIZE_PX15 = 1 + """15 px""" FONT_SIZE_PX20 = 2 + """20 px""" FONT_SIZE_PX25 = 3 + """25 px""" FONT_SIZE_PX30 = 4 + """30 px""" FONT_SIZE_PX35 = 5 + """35 px""" FONT_SIZE_PX40 = 6 + """40 px""" class GuestPortDeviceID(proto.Enum): @@ -590,48 +679,91 @@ class GuestPortDeviceID(proto.Enum): Blueprint Subsea Oculus M370s """ GUEST_PORT_DEVICE_ID_UNSPECIFIED = 0 + """Unspecified""" GUEST_PORT_DEVICE_ID_BLIND_PLUG = 1 + """Blueye blind plug""" GUEST_PORT_DEVICE_ID_TEST_STATION = 2 + """Blueye test station""" GUEST_PORT_DEVICE_ID_DEBUG_SERIAL = 3 + """Blueye debug serial""" GUEST_PORT_DEVICE_ID_BLUEYE_LIGHT = 4 + """Blueye Light""" GUEST_PORT_DEVICE_ID_BLUEYE_CAM = 5 + """Blueye Cam""" GUEST_PORT_DEVICE_ID_BLUE_ROBOTICS_LUMEN = 6 + """Blue Robotics Lumen""" GUEST_PORT_DEVICE_ID_BLUE_ROBOTICS_NEWTON = 7 + """Blue Robotics Newton""" GUEST_PORT_DEVICE_ID_BLUE_ROBOTICS_PING_SONAR = 8 + """Blue Robotics Ping Sonar""" GUEST_PORT_DEVICE_ID_BLUEPRINT_LAB_REACH_ALPHA = 9 + """Blueprint Lab Reach Alpha""" GUEST_PORT_DEVICE_ID_WATERLINKED_DVL_A50 = 10 + """Waterlinked DVL A50""" GUEST_PORT_DEVICE_ID_IMPACT_SUBSEA_ISS360 = 11 + """Impact Subsea ISS360 Sonar""" GUEST_PORT_DEVICE_ID_BLUEPRINT_SUBSEA_SEATRAC_X010 = 12 + """Blueprint Subsea Seatrac X110""" GUEST_PORT_DEVICE_ID_BLUEPRINT_SUBSEA_OCULUS_M750D = 13 + """Blueprint Subsea Oculus M750d""" GUEST_PORT_DEVICE_ID_CYGNUS_MINI_ROV_THICKNESS_GAUGE = 14 + """Cygnus Mini ROV Thickness Gauge""" GUEST_PORT_DEVICE_ID_BLUE_ROBOTICS_PING360_SONAR = 15 + """Blue Robotics Ping360 Scanning Imaging Sonar""" GUEST_PORT_DEVICE_ID_TRITECH_GEMINI_720IM = 16 + """Tritech Gemini 720im Multibeam Sonar""" GUEST_PORT_DEVICE_ID_BLUEYE_LIGHT_PAIR = 17 + """Blueye Light Pair""" GUEST_PORT_DEVICE_ID_TRITECH_GEMINI_MICRON = 18 + """Tritech Micron Gemini""" GUEST_PORT_DEVICE_ID_OCEAN_TOOLS_DIGICP = 19 + """Ocean Tools DigiCP""" GUEST_PORT_DEVICE_ID_TRITECH_GEMINI_720IK = 20 + """Tritech Gemini 720ik Multibeam Sonar""" GUEST_PORT_DEVICE_ID_NORTEK_NUCLEUS_1000 = 21 + """Nortek Nucleus 1000 DVL""" GUEST_PORT_DEVICE_ID_BLUEYE_GENERIC_SERVO = 22 + """Blueye Generic Servo""" GUEST_PORT_DEVICE_ID_BLUEYE_MULTIBEAM_SERVO = 23 + """Blueye Multibeam Skid Servo""" GUEST_PORT_DEVICE_ID_BLUE_ROBOTICS_DETACHABLE_NEWTON = 24 + """Detachable Blue Robotics Newton""" GUEST_PORT_DEVICE_ID_INSITU_AQUA_TROLL_500 = 25 + """In-Situ Aqua TROLL 500""" GUEST_PORT_DEVICE_ID_MEDUSA_RADIOMETRICS_MS100 = 26 + """Medusa Radiometrics Gamma Ray Sensor""" GUEST_PORT_DEVICE_ID_LASER_TOOLS_SEA_BEAM = 27 + """Laser Tools Sea Beam Underwater Laser""" GUEST_PORT_DEVICE_ID_SPOT_X_LASER_SCALERS = 28 + """Spot X Laser Scalers""" GUEST_PORT_DEVICE_ID_BLUEPRINT_SUBSEA_OCULUS_M1200D = 29 + """Blueprint Subsea Oculus M1200d""" GUEST_PORT_DEVICE_ID_BLUEPRINT_SUBSEA_OCULUS_M3000D = 30 + """Blueprint Subsea Oculus M3000d""" GUEST_PORT_DEVICE_ID_INSITU_AQUA_TROLL_100 = 31 + """In-Situ Aqua TROLL 100""" GUEST_PORT_DEVICE_ID_INSITU_RDO_PRO_X = 32 + """In-Situ RDO PRO-X""" GUEST_PORT_DEVICE_ID_INSITU_RDO_BLUE = 33 + """In-Situ RDO Blue""" GUEST_PORT_DEVICE_ID_BLUEYE_CAMERA_SERVO = 34 + """Blueye Camera Servo""" GUEST_PORT_DEVICE_ID_BLUEYE_MULTIBEAM_HEAD_SERVO = 35 + """Blueye Multibeam Head Servo""" GUEST_PORT_DEVICE_ID_CERULEAN_OMNISCAN_450FS = 36 + """Cerulean Omniscan 450 FS""" GUEST_PORT_DEVICE_ID_CERULEAN_OMNISCAN_450SS = 37 + """Cerulean Omniscan 450 SS""" GUEST_PORT_DEVICE_ID_BLUEYE_GNSS_DEVICE = 38 + """Blueye GNSS device""" GUEST_PORT_DEVICE_ID_WATERLINKED_DVL_A50_600 = 39 + """Waterlinked DVL A50 600m""" GUEST_PORT_DEVICE_ID_IMAGENEX_831L = 40 + """Imagenex 831L Pipe Profiling Sonar""" GUEST_PORT_DEVICE_ID_BLUEPRINT_SUBSEA_OCULUS_C550D = 41 + """Blueprint Subsea Oculus C550d""" GUEST_PORT_DEVICE_ID_BLUEPRINT_SUBSEA_OCULUS_M370S = 42 + """Blueprint Subsea Oculus M370s""" class GuestPortNumber(proto.Enum): @@ -648,9 +780,13 @@ class GuestPortNumber(proto.Enum): Guest port 3 """ GUEST_PORT_NUMBER_UNSPECIFIED = 0 + """Unspecified""" GUEST_PORT_NUMBER_PORT_1 = 1 + """Guest port 1""" GUEST_PORT_NUMBER_PORT_2 = 2 + """Guest port 2""" GUEST_PORT_NUMBER_PORT_3 = 3 + """Guest port 3""" class NavigationSensorID(proto.Enum): @@ -672,11 +808,17 @@ class NavigationSensorID(proto.Enum): Nortek DVL Nucleus 1000 """ NAVIGATION_SENSOR_ID_UNSPECIFIED = 0 + """Unspecified""" NAVIGATION_SENSOR_ID_WATERLINKED_DVL_A50 = 1 + """Water Linked DVL A50""" NAVIGATION_SENSOR_ID_WATERLINKED_UGPS_G2 = 2 + """Water Linked UGPS G2""" NAVIGATION_SENSOR_ID_NMEA = 3 + """NMEA stream from external positioning system""" NAVIGATION_SENSOR_ID_BLUEYE_GNSS = 4 + """Blueye GNSS device on the ROV""" NAVIGATION_SENSOR_ID_NORTEK_DVL_NUCLEUS = 5 + """Nortek DVL Nucleus 1000""" class GuestPortDetachStatus(proto.Enum): @@ -692,8 +834,11 @@ class GuestPortDetachStatus(proto.Enum): Detachable device detached """ GUEST_PORT_DETACH_STATUS_UNSPECIFIED = 0 + """Unspecified (Default for non-detachable devices)""" GUEST_PORT_DETACH_STATUS_ATTACHED = 1 + """Detachable device attached""" GUEST_PORT_DETACH_STATUS_DETACHED = 2 + """Detachable device detached""" class GuestPortError(proto.Enum): @@ -715,11 +860,17 @@ class GuestPortError(proto.Enum): Protobuf message cannot be parsed """ GUEST_PORT_ERROR_UNSPECIFIED = 0 + """Unspecified value""" GUEST_PORT_ERROR_NOT_CONNECTED = 1 + """Device not connected""" GUEST_PORT_ERROR_READ_ERROR = 2 + """EEPROM read error""" GUEST_PORT_ERROR_NOT_FLASHED = 3 + """Connector not flashed""" GUEST_PORT_ERROR_CRC_ERROR = 4 + """Wrong CRC for protobuf message""" GUEST_PORT_ERROR_PARSE_ERROR = 5 + """Protobuf message cannot be parsed""" class MultibeamFrequencyMode(proto.Enum): @@ -739,8 +890,11 @@ class MultibeamFrequencyMode(proto.Enum): """ MULTIBEAM_FREQUENCY_MODE_UNSPECIFIED = 0 MULTIBEAM_FREQUENCY_MODE_AUTO = 1 + """Auto switching mode (if available)""" MULTIBEAM_FREQUENCY_MODE_LOW_FREQUENCY = 2 + """Low frequency mode (wide aperture, navigation)""" MULTIBEAM_FREQUENCY_MODE_HIGH_FREQUENCY = 3 + """High frequency mode (narrow aperture, target identification)""" class BinlogRecord(proto.Message): @@ -1317,8 +1471,11 @@ class MountingDirection(proto.Enum): perspective """ MOUNTING_DIRECTION_UNSPECIFIED = 0 + """Mounting direction is unspecified""" MOUNTING_DIRECTION_FORWARDS = 1 + """Pointing forwards from the drones perspective""" MOUNTING_DIRECTION_DOWNWARDS = 2 + """Pointing downwards from the drones perspective""" mounting_direction: MountingDirection = proto.Field( proto.ENUM, @@ -2678,15 +2835,26 @@ class Status(proto.Enum): interferance """ STATUS_UNSPECIFIED = 0 + """Unspecified status""" STATUS_NOT_CALIBRATING = 1 + """Compass is not currently calibrating""" STATUS_CALIBRATING_NO_AXIS = 2 + """Compass is calibrating but active calibration axis cannot be + determined""" STATUS_CALIBRATING_X_POSITIVE = 3 + """Compass is calibrating and the positive X axis is active""" STATUS_CALIBRATING_X_NEGATIVE = 4 + """Compass is calibrating and the negative X axis is active""" STATUS_CALIBRATING_Y_POSITIVE = 5 + """Compass is calibrating and the positive Y axis is active""" STATUS_CALIBRATING_Y_NEGATIVE = 6 + """Compass is calibrating and the negative Y axis is active""" STATUS_CALIBRATING_Z_POSITIVE = 7 + """Compass is calibrating and the positive Z axis is active""" STATUS_CALIBRATING_Z_NEGATIVE = 8 + """Compass is calibrating and the negative Z axis is active""" STATUS_CALIBRATING_THRUSTER = 9 + """Compass is calibrating for thruster interferance""" status: Status = proto.Field( proto.ENUM, @@ -3982,11 +4150,17 @@ class PingRate(proto.Enum): """ PING_RATE_UNSPECIFIED = 0 PING_RATE_NORMAL = 1 + """10Hz max ping rate""" PING_RATE_HIGH = 2 + """15Hz max ping rate""" PING_RATE_HIGHEST = 3 + """40Hz max ping rate""" PING_RATE_LOW = 4 + """5Hz max ping rate""" PING_RATE_LOWEST = 5 + """2Hz max ping rate""" PING_RATE_STANDBY = 6 + """Disable ping""" class MaximumNumberOfBeams(proto.Enum): r""" @@ -4005,9 +4179,13 @@ class MaximumNumberOfBeams(proto.Enum): """ MAXIMUM_NUMBER_OF_BEAMS_UNSPECIFIED = 0 MAXIMUM_NUMBER_OF_BEAMS_MAX_128 = 1 + """128 beams""" MAXIMUM_NUMBER_OF_BEAMS_MAX_256 = 2 + """256 beams""" MAXIMUM_NUMBER_OF_BEAMS_MAX_512 = 3 + """512 beams""" MAXIMUM_NUMBER_OF_BEAMS_MAX_1024 = 4 + """1024 beams""" frequency_mode: 'MultibeamFrequencyMode' = proto.Field( proto.ENUM, diff --git a/blueye/protocol/types/mission_planning.py b/blueye/protocol/types/mission_planning.py index 6dd0131..e8e17e6 100644 --- a/blueye/protocol/types/mission_planning.py +++ b/blueye/protocol/types/mission_planning.py @@ -83,9 +83,13 @@ class ControlModeVertical(proto.Enum): Auto altitude control mode """ CONTROL_MODE_VERTICAL_UNSPECIFIED = 0 + """Unspecified""" CONTROL_MODE_VERTICAL_MANUAL = 1 + """Manual control mode""" CONTROL_MODE_VERTICAL_AUTO_DEPTH = 2 + """Auto depth control mode""" CONTROL_MODE_VERTICAL_AUTO_ALTITUDE = 3 + """Auto altitude control mode""" class ControlModeHorizontal(proto.Enum): @@ -102,9 +106,13 @@ class ControlModeHorizontal(proto.Enum): Station keeping control mode """ CONTROL_MODE_HORIZONTAL_UNSPECIFIED = 0 + """Unspecified""" CONTROL_MODE_HORIZONTAL_MANUAL = 1 + """Manual control mode""" CONTROL_MODE_HORIZONTAL_AUTO_HEADING = 2 + """Auto heading control mode""" CONTROL_MODE_HORIZONTAL_STATION_KEEPING = 3 + """Station keeping control mode""" class CameraAction(proto.Enum): @@ -127,12 +135,19 @@ class CameraAction(proto.Enum): Stop recording """ CAMERA_ACTION_UNSPECIFIED = 0 + """Unspecified command""" CAMERA_ACTION_TAKE_PHOTO = 1 + """Take one photo""" CAMERA_ACTION_TAKE_PHOTOS_TIME = 2 + """Take a photo every x second""" CAMERA_ACTION_TAKE_PHOTOS_DISTANCE = 3 + """Take a photo every x meter""" CAMERA_ACTION_STOP_TAKING_PHOTOS = 4 + """Stop taking photos""" CAMERA_ACTION_START_RECORDING = 5 + """Start recording""" CAMERA_ACTION_STOP_RECORDING = 6 + """Stop recording""" class InstructionType(proto.Enum): @@ -168,18 +183,32 @@ class InstructionType(proto.Enum): Returning to home """ INSTRUCTION_TYPE_UNSPECIFIED = 0 + """Unspecified""" INSTRUCTION_TYPE_NONE = 1 + """None""" INSTRUCTION_TYPE_GO_TO_WAYPOINT = 2 + """Go to waypoint""" INSTRUCTION_TYPE_GO_TO_WAYPOINT_WITH_DEPTH_SET_POINT = 3 + """Go to waypoint with depth set point""" INSTRUCTION_TYPE_GO_TO_DEPTH_SET_POINT = 4 + """Go to depth set point""" INSTRUCTION_TYPE_SET_CAMERA_ACTION = 5 + """Command used to take photo repeatedly or start, stop + recording""" INSTRUCTION_TYPE_SET_CONTROL_MODE = 6 + """Sets a new control mode""" INSTRUCTION_TYPE_SET_TILT_MAIN_CAMERA = 7 + """Sets a new angle for the tilt servo""" INSTRUCTION_TYPE_SET_TILT_SERVO = 8 + """Sets a new angle for the tilt servo""" INSTRUCTION_TYPE_WAIT_FOR_SEC = 9 + """Waiting for requested time in seconds""" INSTRUCTION_TYPE_GO_TO_SURFACE = 10 + """Go to the surface""" INSTRUCTION_TYPE_GO_TO_SEABED = 11 + """Go to the seabed""" INSTRUCTION_TYPE_GO_TO_HOME = 12 + """Returning to home""" class MissionState(proto.Enum): @@ -206,14 +235,23 @@ class MissionState(proto.Enum): Mission has failed to start """ MISSION_STATE_UNSPECIFIED = 0 + """Unspecified""" MISSION_STATE_INACTIVE = 1 + """Mission supervisor is inactive""" MISSION_STATE_READY = 2 + """Ready to start mission""" MISSION_STATE_RUNNING = 3 + """Mission is running""" MISSION_STATE_PAUSED = 4 + """Mission is paused""" MISSION_STATE_COMPLETED = 5 + """Mission is completed""" MISSION_STATE_ABORTED = 6 + """Mission is aborted by the mission supervisor""" MISSION_STATE_FAILED_TO_LOAD_MISSION = 7 + """Mission has failed to load""" MISSION_STATE_FAILED_TO_START_MISSION = 8 + """Mission has failed to start""" class Mission(proto.Message): diff --git a/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 b/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 index 5381ce3..9f3008d 100644 --- a/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 +++ b/generators/templates/templates/%namespace/%name_%version/%sub/types/_enum.py.j2 @@ -16,5 +16,8 @@ class {{ enum.name }}({{ p }}.Enum): {% endif %} {% for enum_value in enum.values %} {{ enum_value.name }} = {{ enum_value.number }} + {% if enum_value.meta.doc|length > 0 %} + """{{ enum_value.meta.doc|rst(width=72, indent=4, nl=False) }}""" + {% endif %} {% endfor %} {{ '\n\n' }} From e0c792b0de8354daf4424faaf3181fa01188b2bd Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Mon, 20 Jan 2025 15:26:42 +0100 Subject: [PATCH 5/5] Bump version to 2.7.1 --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 492c69b..812dc72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "blueye.protocol" description = "Python protocol definition for the Blueye drones" -version = "2.7.0" +version = "2.7.1" authors = ["Sindre Hansen ", "Johannes Schrimpf ", "Aksel Lenes ", diff --git a/setup.py b/setup.py index a2cbc34..e0d4953 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup_kwargs = { 'name': 'blueye.protocol', - 'version': '2.7.0', + 'version': '2.7.1', 'description': 'Python protocol definition for the Blueye drones', 'long_description': '# blueye.protocol\n[![Tests](https://github.com/BluEye-Robotics/blueye.protocol/workflows/Tests/badge.svg)](https://github.com/BluEye-Robotics/blueye.protocol/actions)\n\n**Deprecation notice**\n\nBlunux 3.0 introduces a new protocol based on [Protobuf](https://developers.google.com/protocol-buffers/) messages passed over a [ZeroMQ](https://zeromq.org/) layer. Starting with Blunux 3.1 the old TCP/UDP based protocol will no longer be supported/compatible.\n\n\n## About\nThis repository contains a python library that defines how to communicate with the underwater drones made by [Blueye Robotics](https://blueyerobotics.com).\n\nThe protocol itself is defined in another repository, [ProtocolDefinitions](https://github.com/BluEye-Robotics/ProtocolDefinitions), as is stored as a submodule in this repository. The python code in this repository is (mostly) generated from those definitions.\n\nThe `blueye.protocol` package\'s primary use case is in the [`blueye.sdk`](https://github.com/BluEye-Robotics/blueye.sdk). The SDK implements the necessary "plumbing" to utilize the protocol defined here in `blueye.protocol`, and will make interacting with the Blueye drones much easier. If you wish to interact with the drones in your own project we recommend using the `blueye.sdk` package, not `blueye.protocol` directly.\n\nThis package requires Python 3.10 or newer.\n\n## Installation\n```shell\npip install blueye.protocol\n```\n\n## Development\n\n### Dependency/Package management\nWe use Poetry for dependency/package management, see the [Poetry docs](https://python-poetry.org/docs/) for installation instructions.\n\n\n### Code generators\n**Important**: This repository includes generated code. If the protocol definitions are changed the generated files need to be updated and committed. The generators are run with:\n\n`invoke generate-udp`\n\n`invoke generate-tcp`\n\n`invoke generate-proto`\n\n\n### Tests\nThe tests are located in the `tests` folder, and written using the `pytest` library.\n\nThe tests can be run using invoke (to ensure that the protocol files are updated)\n\n``` shell\ninvoke test\n```\nor directly using pytest (if you don\'t want to generate the definitions)\n\n``` shell\npytest\n```\n\n### `setup.py`\nSince bitbake doesn\'t have support for pyproject.toml files yet, we need to include a\n`setup.py` file to specify the dependencies needed. There\'s an invoke task for\ngenerating the file that can be run with\n``` shell\ninvoke generate-setup-py\n```\n\nIf you are running MacOS, you need to install gnu-tar\n``` shell\nbrew install gnu-tar\n```\n\nand then run the follwing line before the invoke command:\n``` shell\nPATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"\n```\n\n**Be sure to run this script and commit the `setup.py` file when the dependencies have\nchanged.**\n', 'author': 'Sindre Hansen',