:py:mod:`viam.proto.service.slam` ================================= .. py:module:: viam.proto.service.slam .. autoapi-nested-parse:: @generated by Viam. Do not edit manually! Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: viam.proto.service.slam.SLAMServiceBase viam.proto.service.slam.SLAMServiceStub viam.proto.service.slam.UnimplementedSLAMServiceBase viam.proto.service.slam.GetInternalStateRequest viam.proto.service.slam.GetInternalStateResponse viam.proto.service.slam.GetPointCloudMapRequest viam.proto.service.slam.GetPointCloudMapResponse viam.proto.service.slam.GetPositionRequest viam.proto.service.slam.GetPositionResponse viam.proto.service.slam.GetPropertiesRequest viam.proto.service.slam.GetPropertiesResponse viam.proto.service.slam.MappingMode viam.proto.service.slam.SensorInfo viam.proto.service.slam.SensorType .. py:class:: SLAMServiceBase Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: GetPosition(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetPositionRequest, service.slam.v1.slam_pb2.GetPositionResponse]) -> None :abstractmethod: :async: .. py:method:: GetPointCloudMap(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetPointCloudMapRequest, service.slam.v1.slam_pb2.GetPointCloudMapResponse]) -> None :abstractmethod: :async: .. py:method:: GetInternalState(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetInternalStateRequest, service.slam.v1.slam_pb2.GetInternalStateResponse]) -> None :abstractmethod: :async: .. py:method:: GetProperties(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetPropertiesRequest, service.slam.v1.slam_pb2.GetPropertiesResponse]) -> None :abstractmethod: :async: .. py:method:: DoCommand(stream: grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]) -> None :abstractmethod: :async: .. py:method:: __mapping__() -> Dict[str, grpclib.const.Handler] .. py:class:: SLAMServiceStub(channel: grpclib.client.Channel) .. py:class:: UnimplementedSLAMServiceBase Bases: :py:obj:`SLAMServiceBase` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: GetPosition(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetPositionRequest, service.slam.v1.slam_pb2.GetPositionResponse]) -> None :async: .. py:method:: GetPointCloudMap(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetPointCloudMapRequest, service.slam.v1.slam_pb2.GetPointCloudMapResponse]) -> None :async: .. py:method:: GetInternalState(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetInternalStateRequest, service.slam.v1.slam_pb2.GetInternalStateResponse]) -> None :async: .. py:method:: GetProperties(stream: grpclib.server.Stream[service.slam.v1.slam_pb2.GetPropertiesRequest, service.slam.v1.slam_pb2.GetPropertiesResponse]) -> None :async: .. py:method:: DoCommand(stream: grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]) -> None :async: .. py:class:: GetInternalStateRequest(*, name: str = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str Name of slam service .. py:class:: GetInternalStateResponse(*, internal_state_chunk: bytes = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: internal_state_chunk :type: bytes Chunk of the internal state of the SLAM algorithm required to continue mapping/localization .. py:class:: GetPointCloudMapRequest(*, name: str = ..., return_edited_map: bool | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str Name of slam service .. py:attribute:: return_edited_map :type: bool For SLAM services that implement handling an edited map, this boolean should indicate whether to return that edited map. If the SLAM service does not handle edited maps, the unedited map will be returned instead. .. py:method:: HasField(field_name: Literal[_return_edited_map, b'_return_edited_map', return_edited_map, b'return_edited_map']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[_return_edited_map, b'_return_edited_map']) -> Literal[return_edited_map] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: GetPointCloudMapResponse(*, point_cloud_pcd_chunk: bytes = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: point_cloud_pcd_chunk :type: bytes One chunk of the PointCloud. For a given GetPointCloudMap request, concatenating all GetPointCloudMapResponse.point_cloud_pcd_chunk values in the order received result in the complete pointcloud in standard PCD format where XY is the ground plane and positive Z is up, following the Right Hand Rule. Read more about the pointcloud format here: https://pointclouds.org/documentation/tutorials/pcd_file_format.html Viam expects pointcloud data with fields "x y z" or "x y z rgb", and for this to be specified in the pointcloud header in the FIELDS entry. If color data is included in the pointcloud, Viam's services assume that the color value encodes a confidence score for that data point. Viam expects the confidence score to be encoded in the blue parameter of the RGB value, on a scale from 1-100. Pointclouds are little endian encoded. .. py:class:: GetPositionRequest(*, name: str = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str Name of slam service .. py:class:: GetPositionResponse(*, pose: viam.gen.common.v1.common_pb2.Pose | None = ..., component_reference: str = ..., extra: google.protobuf.struct_pb2.Struct | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: pose :type: viam.gen.common.v1.common_pb2.Pose Current position of the specified component in the SLAM Map .. py:property:: extra :type: google.protobuf.struct_pb2.Struct Additional information in the response .. py:attribute:: component_reference :type: str This is usually the name of the camera that is in the SLAM config .. py:method:: HasField(field_name: Literal[extra, b'extra', pose, b'pose']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:class:: GetPropertiesRequest(*, name: str = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str Name of the slam service .. py:class:: GetPropertiesResponse(*, cloud_slam: bool = ..., mapping_mode: global___MappingMode = ..., internal_state_file_type: str | None = ..., sensor_info: collections.abc.Iterable[global___SensorInfo] | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Returns properties information for the named slam service .. py:property:: sensor_info :type: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SensorInfo] .. py:attribute:: cloud_slam :type: bool .. py:attribute:: mapping_mode :type: global___MappingMode .. py:attribute:: internal_state_file_type :type: str .. py:method:: HasField(field_name: Literal[_internal_state_file_type, b'_internal_state_file_type', internal_state_file_type, b'internal_state_file_type']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[_internal_state_file_type, b'_internal_state_file_type']) -> Literal[internal_state_file_type] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: MappingMode Bases: :py:obj:`_MappingMode` MappingMode represnts the various form of mapping and localizing SLAM can perform. These include, creating a new map, localizing on an existiing map and updating an exisiting map. .. py:class:: SensorInfo(*, name: str = ..., type: global___SensorType = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str .. py:attribute:: type :type: global___SensorType .. py:class:: SensorType Bases: :py:obj:`_SensorType`