diff --git a/proto/viam/common/v1/common.proto b/proto/viam/common/v1/common.proto index 4d910715f..2287ddfc8 100644 --- a/proto/viam/common/v1/common.proto +++ b/proto/viam/common/v1/common.proto @@ -89,6 +89,10 @@ message Mesh { bytes mesh = 2; } +message PointCloud { + bytes point_cloud = 1; +} + // Geometry contains the dimensions of a given geometry and the pose of its center. The geometry is one of either a sphere or a box. message Geometry { // Pose of a geometries center point @@ -99,6 +103,7 @@ message Geometry { RectangularPrism box = 3; Capsule capsule = 5; Mesh mesh = 6; + PointCloud pointcloud = 7; } // Label of the geometry. If none supplied, will be an empty string. string label = 4; @@ -135,15 +140,31 @@ message GeoGeometry { repeated Geometry geometries = 2; } -// Transform contains a pose and two reference frames. The first reference frame is the starting reference frame, and the second reference -// frame is the observer reference frame. The second reference frame has a pose which represents the pose of an object in the first -// reference frame as observed within the second reference frame. +// Transform contains a pose and two reference frames. `parent` is the starting reference frame, and `name` is the observer reference frame. +// `pose` represents the pose of an object in the `parent` frame as observed within the `name` frame. message Transform { - // the name of a given reference frame - string reference_frame = 1; - // the pose of the above reference frame with respect to a different observer reference frame - PoseInFrame pose_in_observer_frame = 2; - optional Geometry physical_object = 3; + // The name of the transform + string name = 1; + reserved "reference_frame"; + + // Deprecated: use `parent` and `pose` instead + reserved 2; + reserved "pose_in_observer_frame"; + + repeated Geometry geometries = 3; + reserved "physical_object"; + + // The name of the observer reference frame + string parent = 4; + + // The pose of the named frame as observed from the parent frame + Pose pose = 5; + + // The UUID of the transform + bytes uuid = 6; + + // Can hold information like color, opacity, points colors, collision_allowed, etc... + optional google.protobuf.Struct metadata = 7; } // WorldState contains information about the physical environment around a given robot. All of the fields within this message are optional, diff --git a/proto/viam/service/worldstatestore/v1/world_state_store.proto b/proto/viam/service/worldstatestore/v1/world_state_store.proto new file mode 100644 index 000000000..5fd3022ea --- /dev/null +++ b/proto/viam/service/worldstatestore/v1/world_state_store.proto @@ -0,0 +1,80 @@ +syntax = "proto3"; + +package viam.service.worldstatestore.v1; + +import "common/v1/common.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "go.viam.com/api/service/worldstatestore/v1"; +option java_package = "com.viam.service.worldstatestore.v1"; + +service WorldStateStoreService { + // ListUUIDs returns all world state transform UUIDs + rpc ListUUIDs(ListUUIDsRequest) returns (ListUUIDsResponse) {} + + // GetTransform returns a world state transform by uuid + rpc GetTransform(GetTransformRequest) returns (GetTransformResponse) {} + + // StreamTransformChanges streams changes to world state transforms + rpc StreamTransformChanges(StreamTransformChangesRequest) returns (stream StreamTransformChangesResponse) { + option (google.api.http) = {get: "/viam/api/v1/service/worldstatestore/{name}/stream_transform_changes"}; + } + + // DoCommand sends/receives arbitrary commands + rpc DoCommand(common.v1.DoCommandRequest) returns (common.v1.DoCommandResponse) { + option (google.api.http) = {post: "/viam/api/v1/service/worldstatestore/{name}/do_command"}; + } +} + +message ListUUIDsRequest { + // Name of the world object store service + string name = 1; + + // Additional arguments to the method + google.protobuf.Struct extra = 99; +} + +message ListUUIDsResponse { + repeated bytes uuids = 1; +} + +message GetTransformRequest { + // Name of the world object store service + string name = 1; + + bytes uuid = 2; + + // Additional arguments to the method + google.protobuf.Struct extra = 99; +} + +message GetTransformResponse { + common.v1.Transform transform = 2; +} + +enum TransformChangeType { + TRANSFORM_CHANGE_TYPE_UNSPECIFIED = 0; + TRANSFORM_CHANGE_TYPE_ADDED = 1; + TRANSFORM_CHANGE_TYPE_REMOVED = 2; + TRANSFORM_CHANGE_TYPE_UPDATED = 3; +} + +message StreamTransformChangesRequest { + // Name of the world object store service + string name = 1; + + // Additional arguments to the method + google.protobuf.Struct extra = 99; +} + +message StreamTransformChangesResponse { + TransformChangeType change_type = 1; + common.v1.Transform transform = 2; + + // The field mask of the transform that has changed, if any. For added transforms, this will be empty. For updated + // transforms, this will be the fields that have changed. For removed transforms, this will be the transform's UUID + // path. + google.protobuf.FieldMask updated_fields = 3; +}