server

package
v0.0.0-...-f856108 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdResponseParse

func CmdResponseParse(result string, name, uuid string) (bool, error)

解析命令的响应报文 如果收到的不是所发命令对应的响应报文,且没有出错,返回false,nil 如果是对应的响应报文,且状态正确,返回true,nil 如果出错,返回error

func GenerateMoveCommand

func GenerateMoveCommand(spi *pb.SinglePointInfo) (name, cmd string, uuid string)

func SubscribeResponseParse

func SubscribeResponseParse(result string) (bool, error)

解析命令的响应报文 如果收到的不是callback消息订阅,或者不是robot_status主题,或者运动没有完成,返回false 如果是对应的响应报文,且指示移动命令已完成,返回true 如果出错,由于订阅消息的可重复性,直接忽略,返回false

Types

type Server

type Server struct {
	pb.UnimplementedSinglePointMoveServer
}

func (*Server) Move

func (s *Server) Move(ctx context.Context, in *pb.SinglePointInfo) (*pb.MoveResponse, error)

func (*Server) MoveAndWaitForArrival

func (s *Server) MoveAndWaitForArrival(ctx context.Context, in *pb.SinglePointInfo) (*pb.MoveAndWaitForArrivalResponse, error)

type SingleMoveCommandResponse

type SingleMoveCommandResponse struct {
	common.CommandResponse
	TaskID string `json:"task_id"`
}

func (*SingleMoveCommandResponse) UnmarshalJSON

func (smcr *SingleMoveCommandResponse) UnmarshalJSON(strJSON string) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL