Documentation ¶
Overview ¶
Package server contains a gRPC based robot.Robot server implementation.
It should be used by an rpc.Server.
Index ¶
- func New(robot robot.Robot) pb.RobotServiceServer
- type Server
- func (s *Server) BlockForOperation(ctx context.Context, req *pb.BlockForOperationRequest) (*pb.BlockForOperationResponse, error)
- func (s *Server) CancelOperation(ctx context.Context, req *pb.CancelOperationRequest) (*pb.CancelOperationResponse, error)
- func (s *Server) Close()
- func (s *Server) DiscoverComponents(ctx context.Context, req *pb.DiscoverComponentsRequest) (*pb.DiscoverComponentsResponse, error)
- func (s *Server) FrameSystemConfig(ctx context.Context, req *pb.FrameSystemConfigRequest) (*pb.FrameSystemConfigResponse, error)
- func (s *Server) GetCloudMetadata(ctx context.Context, _ *pb.GetCloudMetadataRequest) (*pb.GetCloudMetadataResponse, error)
- func (s *Server) GetOperations(ctx context.Context, req *pb.GetOperationsRequest) (*pb.GetOperationsResponse, error)
- func (s *Server) GetSessions(ctx context.Context, req *pb.GetSessionsRequest) (*pb.GetSessionsResponse, error)
- func (s *Server) GetStatus(ctx context.Context, req *pb.GetStatusRequest) (*pb.GetStatusResponse, error)
- func (s *Server) Log(ctx context.Context, req *pb.LogRequest) (*pb.LogResponse, error)
- func (s *Server) ResourceNames(ctx context.Context, _ *pb.ResourceNamesRequest) (*pb.ResourceNamesResponse, error)
- func (s *Server) ResourceRPCSubtypes(ctx context.Context, _ *pb.ResourceRPCSubtypesRequest) (*pb.ResourceRPCSubtypesResponse, error)
- func (s *Server) RestartModule(ctx context.Context, req *pb.RestartModuleRequest) (*pb.RestartModuleResponse, error)
- func (s *Server) SendSessionHeartbeat(ctx context.Context, req *pb.SendSessionHeartbeatRequest) (*pb.SendSessionHeartbeatResponse, error)
- func (s *Server) StartSession(ctx context.Context, req *pb.StartSessionRequest) (*pb.StartSessionResponse, error)
- func (s *Server) StopAll(ctx context.Context, req *pb.StopAllRequest) (*pb.StopAllResponse, error)
- func (s *Server) StreamStatus(req *pb.StreamStatusRequest, streamServer pb.RobotService_StreamStatusServer) error
- func (s *Server) TransformPCD(ctx context.Context, req *pb.TransformPCDRequest) (*pb.TransformPCDResponse, error)
- func (s *Server) TransformPose(ctx context.Context, req *pb.TransformPoseRequest) (*pb.TransformPoseResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct { pb.UnimplementedRobotServiceServer // contains filtered or unexported fields }
Server implements the contract from robot.proto that ultimately satisfies a robot.Robot as a gRPC server.
func (*Server) BlockForOperation ¶
func (s *Server) BlockForOperation(ctx context.Context, req *pb.BlockForOperationRequest) (*pb.BlockForOperationResponse, error)
BlockForOperation blocks for an operation to finish.
func (*Server) CancelOperation ¶
func (s *Server) CancelOperation(ctx context.Context, req *pb.CancelOperationRequest) (*pb.CancelOperationResponse, error)
CancelOperation kills an operations.
func (*Server) DiscoverComponents ¶
func (s *Server) DiscoverComponents(ctx context.Context, req *pb.DiscoverComponentsRequest) (*pb.DiscoverComponentsResponse, error)
DiscoverComponents takes a list of discovery queries and returns corresponding component configurations.
func (*Server) FrameSystemConfig ¶
func (s *Server) FrameSystemConfig(ctx context.Context, req *pb.FrameSystemConfigRequest) (*pb.FrameSystemConfigResponse, error)
FrameSystemConfig returns the info of each individual part that makes up the frame system.
func (*Server) GetCloudMetadata ¶ added in v0.22.0
func (s *Server) GetCloudMetadata(ctx context.Context, _ *pb.GetCloudMetadataRequest) (*pb.GetCloudMetadataResponse, error)
GetCloudMetadata returns app-related information about the robot.
func (*Server) GetOperations ¶
func (s *Server) GetOperations(ctx context.Context, req *pb.GetOperationsRequest) (*pb.GetOperationsResponse, error)
GetOperations lists all running operations.
func (*Server) GetSessions ¶ added in v0.2.5
func (s *Server) GetSessions(ctx context.Context, req *pb.GetSessionsRequest) (*pb.GetSessionsResponse, error)
GetSessions lists all active sessions.
func (*Server) GetStatus ¶
func (s *Server) GetStatus(ctx context.Context, req *pb.GetStatusRequest) (*pb.GetStatusResponse, error)
GetStatus takes a list of resource names and returns their corresponding statuses. If no names are passed in, return all statuses.
func (*Server) Log ¶ added in v0.21.0
func (s *Server) Log(ctx context.Context, req *pb.LogRequest) (*pb.LogResponse, error)
Log receives logs to be logged by this robot.
func (*Server) ResourceNames ¶
func (s *Server) ResourceNames(ctx context.Context, _ *pb.ResourceNamesRequest) (*pb.ResourceNamesResponse, error)
ResourceNames returns the list of resources.
func (*Server) ResourceRPCSubtypes ¶
func (s *Server) ResourceRPCSubtypes(ctx context.Context, _ *pb.ResourceRPCSubtypesRequest) (*pb.ResourceRPCSubtypesResponse, error)
ResourceRPCSubtypes returns the list of resource RPC APIs. Subtypes is an older name but preserved in proto.
func (*Server) RestartModule ¶ added in v0.26.0
func (s *Server) RestartModule(ctx context.Context, req *pb.RestartModuleRequest) (*pb.RestartModuleResponse, error)
RestartModule restarts a module by name or ID.
func (*Server) SendSessionHeartbeat ¶ added in v0.2.5
func (s *Server) SendSessionHeartbeat(ctx context.Context, req *pb.SendSessionHeartbeatRequest) (*pb.SendSessionHeartbeatResponse, error)
SendSessionHeartbeat sends a heartbeat to the given session.
func (*Server) StartSession ¶ added in v0.2.5
func (s *Server) StartSession(ctx context.Context, req *pb.StartSessionRequest) (*pb.StartSessionResponse, error)
StartSession creates a new session that expects heartbeats at the given interval. If the interval lapses, any resources that have safety heart monitored methods, where this session was the last caller on the resource, will be stopped.
func (*Server) StopAll ¶
func (s *Server) StopAll(ctx context.Context, req *pb.StopAllRequest) (*pb.StopAllResponse, error)
StopAll will stop all current and outstanding operations for the robot and stops all actuators and movement.
func (*Server) StreamStatus ¶
func (s *Server) StreamStatus(req *pb.StreamStatusRequest, streamServer pb.RobotService_StreamStatusServer) error
StreamStatus periodically sends the status of all statuses requested. An empty request signifies all resources.
func (*Server) TransformPCD ¶ added in v0.2.11
func (s *Server) TransformPCD(ctx context.Context, req *pb.TransformPCDRequest) (*pb.TransformPCDResponse, error)
TransformPCD will transform the pointcloud to the desired frame in the robot's frame system. Do not move the robot between the generation of the initial pointcloud and the receipt of the transformed pointcloud because that will make the transformations inaccurate. TODO(RSDK-1123): PCD files have a field called VIEWPOINT which encodes an offset as a translation+quaternion. if we used VIEWPOINT, you only need to query the frame system to get the transform between the source and destination frame. Then, you put that transform as a translation+quaternion in the VIEWPOINT field. You would only change one line in the PCD file, rather than having to decode and then encode every point in the PCD. Would be a considerable speed up.
func (*Server) TransformPose ¶
func (s *Server) TransformPose(ctx context.Context, req *pb.TransformPoseRequest) (*pb.TransformPoseResponse, error)
TransformPose will transform the pose of the requested poseInFrame to the desired frame in the robot's frame system.