diff --git a/core/frontend/src/types/autopilot.ts b/core/frontend/src/types/autopilot.ts index 031494af34..5ed516d66b 100644 --- a/core/frontend/src/types/autopilot.ts +++ b/core/frontend/src/types/autopilot.ts @@ -93,6 +93,7 @@ export enum EndpointType { tcpout = 'tcpout', serial = 'serial', zenoh = 'zenoh', + zenohraw = 'zenohraw', } export function vehicleTypeFromString(vehicle_type: string): Vehicle { @@ -111,6 +112,7 @@ export function userFriendlyEndpointType(type: EndpointType): string { case EndpointType.tcpout: return 'TCP Client' case EndpointType.serial: return 'Serial' case EndpointType.zenoh: return 'Zenoh' + case EndpointType.zenohraw: return 'Zenoh Raw' default: return 'Undefined type' } } diff --git a/core/services/ardupilot_manager/autopilot_manager.py b/core/services/ardupilot_manager/autopilot_manager.py index b64682ce7a..3cdd715c1a 100644 --- a/core/services/ardupilot_manager/autopilot_manager.py +++ b/core/services/ardupilot_manager/autopilot_manager.py @@ -99,6 +99,15 @@ def __init__(self) -> None: persistent=True, protected=True, ), + Endpoint( + name="ZenohRaw", + owner=self.settings.app_name, + connection_type=EndpointType.ZenohRaw, + place="0.0.0.0", + argument=7117, + persistent=True, + protected=True, + ), Endpoint( name="Internal Link", owner=self.settings.app_name, diff --git a/core/services/ardupilot_manager/mavlink_proxy/Endpoint.py b/core/services/ardupilot_manager/mavlink_proxy/Endpoint.py index fac8486a35..dc8d5a3345 100644 --- a/core/services/ardupilot_manager/mavlink_proxy/Endpoint.py +++ b/core/services/ardupilot_manager/mavlink_proxy/Endpoint.py @@ -15,6 +15,7 @@ class EndpointType(str, Enum): TCPClient = "tcpout" Serial = "serial" Zenoh = "zenoh" + ZenohRaw = "zenohraw" @dataclass @@ -43,6 +44,7 @@ def is_mavlink_endpoint(cls: Type["Endpoint"], values: Any) -> Any: EndpointType.TCPServer, EndpointType.TCPClient, EndpointType.Zenoh, + EndpointType.ZenohRaw, ]: if not (validators.domain(place) or validators.ipv4(place) or validators.ipv6(place)): raise ValueError(f"Invalid network address: {place}") diff --git a/core/services/ardupilot_manager/mavlink_proxy/MAVLinkServer.py b/core/services/ardupilot_manager/mavlink_proxy/MAVLinkServer.py index ac26e93452..1aebd2d55e 100644 --- a/core/services/ardupilot_manager/mavlink_proxy/MAVLinkServer.py +++ b/core/services/ardupilot_manager/mavlink_proxy/MAVLinkServer.py @@ -27,19 +27,26 @@ def _get_version(self) -> Optional[str]: def assemble_command(self, master_endpoint: Endpoint) -> str: # Convert endpoint format to mavlink-router format def convert_endpoint(endpoint: Endpoint) -> str: + endpoint_str = None + if endpoint.connection_type == EndpointType.Serial: - return f"serial:{endpoint.place}:{endpoint.argument}" + endpoint_str = f"serial:{endpoint.place}:{endpoint.argument}" if endpoint.connection_type == EndpointType.TCPServer: - return f"tcps:{endpoint.place}:{endpoint.argument}" + endpoint_str = f"tcps:{endpoint.place}:{endpoint.argument}" if endpoint.connection_type == EndpointType.TCPClient: - return f"tcpc:{endpoint.place}:{endpoint.argument}" + endpoint_str = f"tcpc:{endpoint.place}:{endpoint.argument}" if endpoint.connection_type == EndpointType.UDPServer: - return f"udps:{endpoint.place}:{endpoint.argument}" + endpoint_str = f"udps:{endpoint.place}:{endpoint.argument}" if endpoint.connection_type == EndpointType.UDPClient: - return f"udpc:{endpoint.place}:{endpoint.argument}" + endpoint_str = f"udpc:{endpoint.place}:{endpoint.argument}" if endpoint.connection_type == EndpointType.Zenoh: - return f"zenoh:{endpoint.place}:{endpoint.argument}" - raise ValueError(f"Endpoint of type {endpoint.connection_type} not supported on MAVLink-Server.") + endpoint_str = f"zenoh:{endpoint.place}:{endpoint.argument}" + if endpoint.connection_type == EndpointType.ZenohRaw: + endpoint_str = f"zenohraw:{endpoint.place}:{endpoint.argument}" + + if endpoint_str is None: + raise ValueError(f"Endpoint of type {endpoint.connection_type} not supported on MAVLink-Server.") + return endpoint_str filtered_endpoints = Endpoint.filter_enabled(self.endpoints()) endpoints = " ".join([convert_endpoint(endpoint) for endpoint in [master_endpoint, *filtered_endpoints]]) @@ -70,6 +77,7 @@ def _validate_endpoint(endpoint: Endpoint) -> None: EndpointType.TCPClient, EndpointType.Serial, EndpointType.Zenoh, + EndpointType.ZenohRaw, ] if endpoint.connection_type not in valid_connection_types: raise ValueError(f"Connection_type '{endpoint.connection_type}' not supported by {MAVLinkServer.name()}.") diff --git a/core/tools/mavlink_server/bootstrap.sh b/core/tools/mavlink_server/bootstrap.sh index 5dc2ecfae4..f29be93038 100755 --- a/core/tools/mavlink_server/bootstrap.sh +++ b/core/tools/mavlink_server/bootstrap.sh @@ -3,7 +3,7 @@ # Immediately exit on errors set -e -VERSION="0.7.4" +VERSION="0.9.0" PROJECT_NAME="mavlink-server" REPOSITORY_ORG="bluerobotics" REPOSITORY_NAME="$PROJECT_NAME"