Documentation ¶
Overview ¶
Package navigation contains a navigation service, along with a gRPC server and client
Package navigation implements the navigation service.
Index ¶
Constants ¶
const ( ModeManual = Mode(iota) ModeWaypoint )
The set of known modes.
const SubtypeName = resource.SubtypeName("navigation")
SubtypeName is the name of the type of service.
Variables ¶
var ()
Database and collection names used by the mongoDBNavigationStore.
var Subtype = resource.NewSubtype( resource.ResourceNamespaceRDK, resource.ResourceTypeService, SubtypeName, )
Subtype is a constant that identifies the navigation service resource subtype.
Functions ¶
func Named ¶ added in v0.0.8
Named is a helper for getting the named navigation service's typed resource name.
func NewServer ¶
func NewServer(s subtype.Service) pb.NavigationServiceServer
NewServer constructs a framesystem gRPC service server.
func WrapWithReconfigurable ¶
func WrapWithReconfigurable(s interface{}) (resource.Reconfigurable, error)
WrapWithReconfigurable wraps a navigation service as a Reconfigurable.
Types ¶
type Config ¶
type Config struct { Store StoreConfig `json:"store"` BaseName string `json:"base"` MovementSensorName string `json:"movement_sensor"` DegPerSecDefault float64 `json:"deg_per_sec"` MMPerSecDefault float64 `json:"mm_per_sec"` }
Config describes how to configure the service.
type Service ¶
type Service interface { GetMode(ctx context.Context) (Mode, error) SetMode(ctx context.Context, mode Mode) error GetLocation(ctx context.Context) (*geo.Point, error) // Waypoint GetWaypoints(ctx context.Context) ([]Waypoint, error) AddWaypoint(ctx context.Context, point *geo.Point) error RemoveWaypoint(ctx context.Context, id primitive.ObjectID) error }
A Service controls the navigation for a robot.
func New ¶
func New(ctx context.Context, r robot.Robot, config config.Service, logger golog.Logger) (Service, error)
New returns a new navigation service for the given robot.
func NewClientFromConn ¶
func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Service
NewClientFromConn constructs a new Client from connection passed in.
type StoreConfig ¶
type StoreConfig struct { Type storeType `json:"type"` Config map[string]interface{} `json:"config"` }
StoreConfig describes how to configure data storage.
func (*StoreConfig) Validate ¶
func (config *StoreConfig) Validate(path string) error
Validate ensures all parts of the config are valid.