Skip to content

Commit

Permalink
Remove GetLatestMapInfo from SLAM (w/ proto updates) (#529)
Browse files Browse the repository at this point in the history
Co-authored-by: viambot <[email protected]>
  • Loading branch information
jeremyrhyde and viambot authored Jan 22, 2024
1 parent d78274d commit 74dd928
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 142 deletions.
5 changes: 0 additions & 5 deletions examples/server/v1/services.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from datetime import datetime
from numpy.typing import NDArray
from typing import Dict, List, Optional, Tuple
from tests.mocks.services import MockMLModel, MockSLAM
Expand Down Expand Up @@ -27,7 +26,6 @@ def __init__(self, name: str):
self.point_cloud_chunks = MockSLAM.POINT_CLOUD_PCD_CHUNKS
self.cloud_slam = MockSLAM.CLOUD_SLAM
self.mapping_mode = MockSLAM.MAPPING_MODE
self.time = MockSLAM.LAST_UPDATE
super().__init__(name)

async def get_internal_state(self, **kwargs) -> List[bytes]:
Expand All @@ -39,8 +37,5 @@ async def get_point_cloud_map(self, **kwargs) -> List[bytes]:
async def get_position(self, **kwargs) -> Pose:
return self.position

async def get_latest_map_info(self, **kwargs) -> datetime:
return self.time

async def get_properties(self, **kwargs) -> Tuple[bool, MappingMode.ValueType]:
return (self.cloud_slam, self.mapping_mode)
2 changes: 1 addition & 1 deletion src/viam/gen/service/navigation/v1/navigation_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _MapTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTy
MAP_TYPE_GPS: _MapType.ValueType

class MapType(_MapType, metaclass=_MapTypeEnumTypeWrapper):
"""MapType represents the various types of map the navigation service can ingest."""
"""MapType represents the various types of maps the navigation service can ingest."""
MAP_TYPE_UNSPECIFIED: MapType.ValueType
MAP_TYPE_NONE: MapType.ValueType
MAP_TYPE_GPS: MapType.ValueType
Expand Down
8 changes: 1 addition & 7 deletions src/viam/gen/service/slam/v1/slam_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .... import common
import google.api.annotations_pb2
import google.protobuf.struct_pb2
import google.protobuf.timestamp_pb2
from .... import service

class SLAMServiceBase(abc.ABC):
Expand All @@ -24,10 +23,6 @@ async def GetPointCloudMap(self, stream: 'grpclib.server.Stream[service.slam.v1.
async def GetInternalState(self, stream: 'grpclib.server.Stream[service.slam.v1.slam_pb2.GetInternalStateRequest, service.slam.v1.slam_pb2.GetInternalStateResponse]') -> None:
pass

@abc.abstractmethod
async def GetLatestMapInfo(self, stream: 'grpclib.server.Stream[service.slam.v1.slam_pb2.GetLatestMapInfoRequest, service.slam.v1.slam_pb2.GetLatestMapInfoResponse]') -> None:
pass

@abc.abstractmethod
async def GetProperties(self, stream: 'grpclib.server.Stream[service.slam.v1.slam_pb2.GetPropertiesRequest, service.slam.v1.slam_pb2.GetPropertiesResponse]') -> None:
pass
Expand All @@ -37,14 +32,13 @@ async def DoCommand(self, stream: 'grpclib.server.Stream[common.v1.common_pb2.Do
pass

def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
return {'/viam.service.slam.v1.SLAMService/GetPosition': grpclib.const.Handler(self.GetPosition, grpclib.const.Cardinality.UNARY_UNARY, service.slam.v1.slam_pb2.GetPositionRequest, service.slam.v1.slam_pb2.GetPositionResponse), '/viam.service.slam.v1.SLAMService/GetPointCloudMap': grpclib.const.Handler(self.GetPointCloudMap, grpclib.const.Cardinality.UNARY_STREAM, service.slam.v1.slam_pb2.GetPointCloudMapRequest, service.slam.v1.slam_pb2.GetPointCloudMapResponse), '/viam.service.slam.v1.SLAMService/GetInternalState': grpclib.const.Handler(self.GetInternalState, grpclib.const.Cardinality.UNARY_STREAM, service.slam.v1.slam_pb2.GetInternalStateRequest, service.slam.v1.slam_pb2.GetInternalStateResponse), '/viam.service.slam.v1.SLAMService/GetLatestMapInfo': grpclib.const.Handler(self.GetLatestMapInfo, grpclib.const.Cardinality.UNARY_UNARY, service.slam.v1.slam_pb2.GetLatestMapInfoRequest, service.slam.v1.slam_pb2.GetLatestMapInfoResponse), '/viam.service.slam.v1.SLAMService/GetProperties': grpclib.const.Handler(self.GetProperties, grpclib.const.Cardinality.UNARY_UNARY, service.slam.v1.slam_pb2.GetPropertiesRequest, service.slam.v1.slam_pb2.GetPropertiesResponse), '/viam.service.slam.v1.SLAMService/DoCommand': grpclib.const.Handler(self.DoCommand, grpclib.const.Cardinality.UNARY_UNARY, common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse)}
return {'/viam.service.slam.v1.SLAMService/GetPosition': grpclib.const.Handler(self.GetPosition, grpclib.const.Cardinality.UNARY_UNARY, service.slam.v1.slam_pb2.GetPositionRequest, service.slam.v1.slam_pb2.GetPositionResponse), '/viam.service.slam.v1.SLAMService/GetPointCloudMap': grpclib.const.Handler(self.GetPointCloudMap, grpclib.const.Cardinality.UNARY_STREAM, service.slam.v1.slam_pb2.GetPointCloudMapRequest, service.slam.v1.slam_pb2.GetPointCloudMapResponse), '/viam.service.slam.v1.SLAMService/GetInternalState': grpclib.const.Handler(self.GetInternalState, grpclib.const.Cardinality.UNARY_STREAM, service.slam.v1.slam_pb2.GetInternalStateRequest, service.slam.v1.slam_pb2.GetInternalStateResponse), '/viam.service.slam.v1.SLAMService/GetProperties': grpclib.const.Handler(self.GetProperties, grpclib.const.Cardinality.UNARY_UNARY, service.slam.v1.slam_pb2.GetPropertiesRequest, service.slam.v1.slam_pb2.GetPropertiesResponse), '/viam.service.slam.v1.SLAMService/DoCommand': grpclib.const.Handler(self.DoCommand, grpclib.const.Cardinality.UNARY_UNARY, common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse)}

class SLAMServiceStub:

def __init__(self, channel: grpclib.client.Channel) -> None:
self.GetPosition = grpclib.client.UnaryUnaryMethod(channel, '/viam.service.slam.v1.SLAMService/GetPosition', service.slam.v1.slam_pb2.GetPositionRequest, service.slam.v1.slam_pb2.GetPositionResponse)
self.GetPointCloudMap = grpclib.client.UnaryStreamMethod(channel, '/viam.service.slam.v1.SLAMService/GetPointCloudMap', service.slam.v1.slam_pb2.GetPointCloudMapRequest, service.slam.v1.slam_pb2.GetPointCloudMapResponse)
self.GetInternalState = grpclib.client.UnaryStreamMethod(channel, '/viam.service.slam.v1.SLAMService/GetInternalState', service.slam.v1.slam_pb2.GetInternalStateRequest, service.slam.v1.slam_pb2.GetInternalStateResponse)
self.GetLatestMapInfo = grpclib.client.UnaryUnaryMethod(channel, '/viam.service.slam.v1.SLAMService/GetLatestMapInfo', service.slam.v1.slam_pb2.GetLatestMapInfoRequest, service.slam.v1.slam_pb2.GetLatestMapInfoResponse)
self.GetProperties = grpclib.client.UnaryUnaryMethod(channel, '/viam.service.slam.v1.SLAMService/GetProperties', service.slam.v1.slam_pb2.GetPropertiesRequest, service.slam.v1.slam_pb2.GetPropertiesResponse)
self.DoCommand = grpclib.client.UnaryUnaryMethod(channel, '/viam.service.slam.v1.SLAMService/DoCommand', common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse)
49 changes: 21 additions & 28 deletions src/viam/gen/service/slam/v1/slam_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from ....common.v1 import common_pb2 as common_dot_v1_dot_common__pb2
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aservice/slam/v1/slam.proto\x12\x14viam.service.slam.v1\x1a\x16common/v1/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"(\n\x12GetPositionRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"\x9f\x01\n\x13GetPositionResponse\x12(\n\x04pose\x18\x01 \x01(\x0b2\x14.viam.common.v1.PoseR\x04pose\x12/\n\x13component_reference\x18\x02 \x01(\tR\x12componentReference\x12-\n\x05extra\x18c \x01(\x0b2\x17.google.protobuf.StructR\x05extra"-\n\x17GetPointCloudMapRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"M\n\x18GetPointCloudMapResponse\x121\n\x15point_cloud_pcd_chunk\x18\x01 \x01(\x0cR\x12pointCloudPcdChunk"-\n\x17GetInternalStateRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"L\n\x18GetInternalStateResponse\x120\n\x14internal_state_chunk\x18\x01 \x01(\x0cR\x12internalStateChunk"-\n\x17GetLatestMapInfoRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"^\n\x18GetLatestMapInfoResponse\x12B\n\x0flast_map_update\x18\x01 \x01(\x0b2\x1a.google.protobuf.TimestampR\rlastMapUpdate"*\n\x14GetPropertiesRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"|\n\x15GetPropertiesResponse\x12\x1d\n\ncloud_slam\x18\x01 \x01(\x08R\tcloudSlam\x12D\n\x0cmapping_mode\x18\x02 \x01(\x0e2!.viam.service.slam.v1.MappingModeR\x0bmappingMode*\x92\x01\n\x0bMappingMode\x12\x1c\n\x18MAPPING_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMAPPING_MODE_CREATE_NEW_MAP\x10\x01\x12\x1e\n\x1aMAPPING_MODE_LOCALIZE_ONLY\x10\x02\x12$\n MAPPING_MODE_UPDATE_EXISTING_MAP\x10\x032\xdc\x07\n\x0bSLAMService\x12\x95\x01\n\x0bGetPosition\x12(.viam.service.slam.v1.GetPositionRequest\x1a).viam.service.slam.v1.GetPositionResponse"1\x82\xd3\xe4\x93\x02+\x12)/viam/api/v1/service/slam/{name}/position\x12\xad\x01\n\x10GetPointCloudMap\x12-.viam.service.slam.v1.GetPointCloudMapRequest\x1a..viam.service.slam.v1.GetPointCloudMapResponse"8\x82\xd3\xe4\x93\x022\x120/viam/api/v1/service/slam/{name}/point_cloud_map0\x01\x12\xac\x01\n\x10GetInternalState\x12-.viam.service.slam.v1.GetInternalStateRequest\x1a..viam.service.slam.v1.GetInternalStateResponse"7\x82\xd3\xe4\x93\x021\x12//viam/api/v1/service/slam/{name}/internal_state0\x01\x12\xad\x01\n\x10GetLatestMapInfo\x12-.viam.service.slam.v1.GetLatestMapInfoRequest\x1a..viam.service.slam.v1.GetLatestMapInfoResponse":\x82\xd3\xe4\x93\x024\x122/viam/api/v1/component/slam/{name}/latest_map_info\x12\x9d\x01\n\rGetProperties\x12*.viam.service.slam.v1.GetPropertiesRequest\x1a+.viam.service.slam.v1.GetPropertiesResponse"3\x82\xd3\xe4\x93\x02-\x12+/viam/api/v1/service/slam/{name}/properties\x12\x85\x01\n\tDoCommand\x12 .viam.common.v1.DoCommandRequest\x1a!.viam.common.v1.DoCommandResponse"3\x82\xd3\xe4\x93\x02-"+/viam/api/v1/service/slam/{name}/do_commandB;\n\x18com.viam.service.slam.v1Z\x1fgo.viam.com/api/service/slam/v1b\x06proto3')
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aservice/slam/v1/slam.proto\x12\x14viam.service.slam.v1\x1a\x16common/v1/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto"(\n\x12GetPositionRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"\x9f\x01\n\x13GetPositionResponse\x12(\n\x04pose\x18\x01 \x01(\x0b2\x14.viam.common.v1.PoseR\x04pose\x12/\n\x13component_reference\x18\x02 \x01(\tR\x12componentReference\x12-\n\x05extra\x18c \x01(\x0b2\x17.google.protobuf.StructR\x05extra"-\n\x17GetPointCloudMapRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"M\n\x18GetPointCloudMapResponse\x121\n\x15point_cloud_pcd_chunk\x18\x01 \x01(\x0cR\x12pointCloudPcdChunk"-\n\x17GetInternalStateRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"L\n\x18GetInternalStateResponse\x120\n\x14internal_state_chunk\x18\x01 \x01(\x0cR\x12internalStateChunk"*\n\x14GetPropertiesRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"|\n\x15GetPropertiesResponse\x12\x1d\n\ncloud_slam\x18\x01 \x01(\x08R\tcloudSlam\x12D\n\x0cmapping_mode\x18\x02 \x01(\x0e2!.viam.service.slam.v1.MappingModeR\x0bmappingMode*\x92\x01\n\x0bMappingMode\x12\x1c\n\x18MAPPING_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMAPPING_MODE_CREATE_NEW_MAP\x10\x01\x12\x1e\n\x1aMAPPING_MODE_LOCALIZE_ONLY\x10\x02\x12$\n MAPPING_MODE_UPDATE_EXISTING_MAP\x10\x032\xac\x06\n\x0bSLAMService\x12\x95\x01\n\x0bGetPosition\x12(.viam.service.slam.v1.GetPositionRequest\x1a).viam.service.slam.v1.GetPositionResponse"1\x82\xd3\xe4\x93\x02+\x12)/viam/api/v1/service/slam/{name}/position\x12\xad\x01\n\x10GetPointCloudMap\x12-.viam.service.slam.v1.GetPointCloudMapRequest\x1a..viam.service.slam.v1.GetPointCloudMapResponse"8\x82\xd3\xe4\x93\x022\x120/viam/api/v1/service/slam/{name}/point_cloud_map0\x01\x12\xac\x01\n\x10GetInternalState\x12-.viam.service.slam.v1.GetInternalStateRequest\x1a..viam.service.slam.v1.GetInternalStateResponse"7\x82\xd3\xe4\x93\x021\x12//viam/api/v1/service/slam/{name}/internal_state0\x01\x12\x9d\x01\n\rGetProperties\x12*.viam.service.slam.v1.GetPropertiesRequest\x1a+.viam.service.slam.v1.GetPropertiesResponse"3\x82\xd3\xe4\x93\x02-\x12+/viam/api/v1/service/slam/{name}/properties\x12\x85\x01\n\tDoCommand\x12 .viam.common.v1.DoCommandRequest\x1a!.viam.common.v1.DoCommandResponse"3\x82\xd3\xe4\x93\x02-"+/viam/api/v1/service/slam/{name}/do_commandB;\n\x18com.viam.service.slam.v1Z\x1fgo.viam.com/api/service/slam/v1b\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'service.slam.v1.slam_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
Expand All @@ -20,33 +19,27 @@
_SLAMSERVICE.methods_by_name['GetPointCloudMap']._serialized_options = b'\x82\xd3\xe4\x93\x022\x120/viam/api/v1/service/slam/{name}/point_cloud_map'
_SLAMSERVICE.methods_by_name['GetInternalState']._options = None
_SLAMSERVICE.methods_by_name['GetInternalState']._serialized_options = b'\x82\xd3\xe4\x93\x021\x12//viam/api/v1/service/slam/{name}/internal_state'
_SLAMSERVICE.methods_by_name['GetLatestMapInfo']._options = None
_SLAMSERVICE.methods_by_name['GetLatestMapInfo']._serialized_options = b'\x82\xd3\xe4\x93\x024\x122/viam/api/v1/component/slam/{name}/latest_map_info'
_SLAMSERVICE.methods_by_name['GetProperties']._options = None
_SLAMSERVICE.methods_by_name['GetProperties']._serialized_options = b'\x82\xd3\xe4\x93\x02-\x12+/viam/api/v1/service/slam/{name}/properties'
_SLAMSERVICE.methods_by_name['DoCommand']._options = None
_SLAMSERVICE.methods_by_name['DoCommand']._serialized_options = b'\x82\xd3\xe4\x93\x02-"+/viam/api/v1/service/slam/{name}/do_command'
_MAPPINGMODE._serialized_start = 938
_MAPPINGMODE._serialized_end = 1084
_GETPOSITIONREQUEST._serialized_start = 169
_GETPOSITIONREQUEST._serialized_end = 209
_GETPOSITIONRESPONSE._serialized_start = 212
_GETPOSITIONRESPONSE._serialized_end = 371
_GETPOINTCLOUDMAPREQUEST._serialized_start = 373
_GETPOINTCLOUDMAPREQUEST._serialized_end = 418
_GETPOINTCLOUDMAPRESPONSE._serialized_start = 420
_GETPOINTCLOUDMAPRESPONSE._serialized_end = 497
_GETINTERNALSTATEREQUEST._serialized_start = 499
_GETINTERNALSTATEREQUEST._serialized_end = 544
_GETINTERNALSTATERESPONSE._serialized_start = 546
_GETINTERNALSTATERESPONSE._serialized_end = 622
_GETLATESTMAPINFOREQUEST._serialized_start = 624
_GETLATESTMAPINFOREQUEST._serialized_end = 669
_GETLATESTMAPINFORESPONSE._serialized_start = 671
_GETLATESTMAPINFORESPONSE._serialized_end = 765
_GETPROPERTIESREQUEST._serialized_start = 767
_GETPROPERTIESREQUEST._serialized_end = 809
_GETPROPERTIESRESPONSE._serialized_start = 811
_GETPROPERTIESRESPONSE._serialized_end = 935
_SLAMSERVICE._serialized_start = 1087
_SLAMSERVICE._serialized_end = 2075
_MAPPINGMODE._serialized_start = 762
_MAPPINGMODE._serialized_end = 908
_GETPOSITIONREQUEST._serialized_start = 136
_GETPOSITIONREQUEST._serialized_end = 176
_GETPOSITIONRESPONSE._serialized_start = 179
_GETPOSITIONRESPONSE._serialized_end = 338
_GETPOINTCLOUDMAPREQUEST._serialized_start = 340
_GETPOINTCLOUDMAPREQUEST._serialized_end = 385
_GETPOINTCLOUDMAPRESPONSE._serialized_start = 387
_GETPOINTCLOUDMAPRESPONSE._serialized_end = 464
_GETINTERNALSTATEREQUEST._serialized_start = 466
_GETINTERNALSTATEREQUEST._serialized_end = 511
_GETINTERNALSTATERESPONSE._serialized_start = 513
_GETINTERNALSTATERESPONSE._serialized_end = 589
_GETPROPERTIESREQUEST._serialized_start = 591
_GETPROPERTIESREQUEST._serialized_end = 633
_GETPROPERTIESRESPONSE._serialized_start = 635
_GETPROPERTIESRESPONSE._serialized_end = 759
_SLAMSERVICE._serialized_start = 911
_SLAMSERVICE._serialized_end = 1723
34 changes: 0 additions & 34 deletions src/viam/gen/service/slam/v1/slam_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import google.protobuf.struct_pb2
import google.protobuf.timestamp_pb2
import sys
import typing
if sys.version_info >= (3, 10):
Expand Down Expand Up @@ -136,39 +135,6 @@ class GetInternalStateResponse(google.protobuf.message.Message):
...
global___GetInternalStateResponse = GetInternalStateResponse

@typing_extensions.final
class GetLatestMapInfoRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
name: builtins.str
'Name of the SLAM algo'

def __init__(self, *, name: builtins.str=...) -> None:
...

def ClearField(self, field_name: typing_extensions.Literal['name', b'name']) -> None:
...
global___GetLatestMapInfoRequest = GetLatestMapInfoRequest

@typing_extensions.final
class GetLatestMapInfoResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
LAST_MAP_UPDATE_FIELD_NUMBER: builtins.int

@property
def last_map_update(self) -> google.protobuf.timestamp_pb2.Timestamp:
...

def __init__(self, *, last_map_update: google.protobuf.timestamp_pb2.Timestamp | None=...) -> None:
...

def HasField(self, field_name: typing_extensions.Literal['last_map_update', b'last_map_update']) -> builtins.bool:
...

def ClearField(self, field_name: typing_extensions.Literal['last_map_update', b'last_map_update']) -> None:
...
global___GetLatestMapInfoResponse = GetLatestMapInfoResponse

@typing_extensions.final
class GetPropertiesRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down
4 changes: 0 additions & 4 deletions src/viam/proto/service/slam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from ....gen.service.slam.v1.slam_pb2 import (
GetInternalStateRequest,
GetInternalStateResponse,
GetLatestMapInfoRequest,
GetLatestMapInfoResponse,
GetPointCloudMapRequest,
GetPointCloudMapResponse,
GetPositionRequest,
Expand All @@ -22,8 +20,6 @@
"SLAMServiceStub",
"GetInternalStateRequest",
"GetInternalStateResponse",
"GetLatestMapInfoRequest",
"GetLatestMapInfoResponse",
"GetPointCloudMapRequest",
"GetPointCloudMapResponse",
"GetPositionRequest",
Expand Down
8 changes: 0 additions & 8 deletions src/viam/services/slam/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from datetime import datetime
from typing import List, Mapping, Optional, Tuple

from grpclib.client import Channel
Expand All @@ -7,8 +6,6 @@
from viam.proto.service.slam import (
GetInternalStateRequest,
GetInternalStateResponse,
GetLatestMapInfoRequest,
GetLatestMapInfoResponse,
GetPointCloudMapRequest,
GetPointCloudMapResponse,
GetPositionRequest,
Expand Down Expand Up @@ -51,11 +48,6 @@ async def get_internal_state(self, *, timeout: Optional[float] = None) -> List[b
response: List[GetInternalStateResponse] = await self.client.GetInternalState(request, timeout=timeout)
return [r.internal_state_chunk for r in response]

async def get_latest_map_info(self, *, timeout: Optional[float] = None) -> datetime:
request = GetLatestMapInfoRequest(name=self.name)
response: GetLatestMapInfoResponse = await self.client.GetLatestMapInfo(request, timeout=timeout)
return response.last_map_update.ToDatetime()

async def get_properties(self, *, timeout: Optional[float] = None) -> Tuple[bool, MappingMode.ValueType]:
request = GetPropertiesRequest(name=self.name)
response: GetPropertiesResponse = await self.client.GetProperties(request, timeout=timeout)
Expand Down
Loading

0 comments on commit 74dd928

Please sign in to comment.