Documentation ¶
Overview ¶
Package viamcartographer implements simultaneous localization and mapping. This is an Experimental package.
Index ¶
- Constants
- Variables
- func CheckQuaternionFromClientAlgo(pose spatialmath.Pose, returnedExt map[string]interface{}) (spatialmath.Pose, error)
- func InitCartoLib(logger logging.Logger) error
- func New(ctx context.Context, deps resource.Dependencies, c resource.Config, ...) (slam.Service, error)
- func TerminateCartoLib() error
- type CartographerService
- func (cartoSvc *CartographerService) Close(ctx context.Context) error
- func (cartoSvc *CartographerService) DoCommand(ctx context.Context, req map[string]interface{}) (map[string]interface{}, error)
- func (cartoSvc *CartographerService) InternalState(ctx context.Context) (func() ([]byte, error), error)
- func (cartoSvc *CartographerService) PointCloudMap(ctx context.Context, returnEditedMap bool) (func() ([]byte, error), error)
- func (cartoSvc *CartographerService) Position(ctx context.Context) (spatialmath.Pose, error)
- func (cartoSvc *CartographerService) Properties(ctx context.Context) (slam.Properties, error)
- type SubAlgo
Constants ¶
const ( // JobDoneCommand is the string that needs to be sent to DoCommand to find out if the job has finished. JobDoneCommand = "job_done" // SuccessMessage is sent back after a successful DoCommand request. SuccessMessage = "success" // PostprocessToggleResponseKey is the key sent back for the toggle postprocess command. PostprocessToggleResponseKey = "postprocessed" )
Variables ¶
var ( Model = resource.NewModel("viam", "slam", "cartographer") // ErrClosed denotes that the slam service method was called on a closed slam resource. ErrClosed = errors.Errorf("resource (%s) is closed", Model.String()) // ErrUseCloudSlamEnabled denotes that the slam service method was called while use_cloud_slam was set to true. ErrUseCloudSlamEnabled = errors.Errorf("resource (%s) unavailable, configured with use_cloud_slam set to true", Model.String()) // ErrNoPostprocessingToUndo denotes that the points have not been properly formatted. ErrNoPostprocessingToUndo = errors.New("there are no postprocessing tasks to undo") // ErrBadPostprocessingPointsFormat denotest that the postprocesing points have not been correctly provided. ErrBadPostprocessingPointsFormat = errors.New("invalid postprocessing points format") // ErrBadPostprocessingPointsFormat denotest that the postprocesing points have not been correctly provided. ErrBadPostprocessingPath = errors.New("could not parse path to pcd") )
Model is the model name of cartographer.
Functions ¶
func CheckQuaternionFromClientAlgo ¶
func CheckQuaternionFromClientAlgo(pose spatialmath.Pose, returnedExt map[string]interface{}, ) (spatialmath.Pose, error)
CheckQuaternionFromClientAlgo checks to see if the internal SLAM algorithm sent a quaternion. If it did, return the updated pose.
func InitCartoLib ¶
InitCartoLib is run to initialize the cartographer library must be called before module.AddModelFromRegistry is called.
func New ¶
func New( ctx context.Context, deps resource.Dependencies, c resource.Config, logger logging.Logger, cartoFacadeTimeout time.Duration, cartoFacadeInternalTimeout time.Duration, testTimedLidarOverride s.TimedLidar, testTimedMovementSensorOverride s.TimedMovementSensor, ) (slam.Service, error)
New returns a new slam service for the given robot.
func TerminateCartoLib ¶
func TerminateCartoLib() error
TerminateCartoLib is run to terminate the cartographer library.
Types ¶
type CartographerService ¶
type CartographerService struct { resource.Named resource.AlwaysRebuild SlamMode cartofacade.SlamMode // contains filtered or unexported fields }
CartographerService is the structure of the slam service.
func (*CartographerService) Close ¶
func (cartoSvc *CartographerService) Close(ctx context.Context) error
Close out of all slam related processes.
func (*CartographerService) DoCommand ¶
func (cartoSvc *CartographerService) DoCommand(ctx context.Context, req map[string]interface{}) (map[string]interface{}, error)
DoCommand receives arbitrary commands.
func (*CartographerService) InternalState ¶
func (cartoSvc *CartographerService) InternalState(ctx context.Context) (func() ([]byte, error), error)
InternalState creates a request, calls the slam algorithms InternalState endpoint and returns a callback function which will return the next chunk of the current internal state of the slam algo.
func (*CartographerService) PointCloudMap ¶
func (cartoSvc *CartographerService) PointCloudMap(ctx context.Context, returnEditedMap bool) (func() ([]byte, error), error)
PointCloudMap creates a request calls the slam algorithms PointCloudMap endpoint and returns a callback function which will return the next chunk of the current pointcloud map.
func (*CartographerService) Position ¶
func (cartoSvc *CartographerService) Position(ctx context.Context) (spatialmath.Pose, error)
Position forwards the request for positional data to the slam library's gRPC service. Once a response is received, it is unpacked into a Pose.
func (*CartographerService) Properties ¶
func (cartoSvc *CartographerService) Properties(ctx context.Context) (slam.Properties, error)
Properties returns information regarding the current SLAM session including the mapping mode and is the session is being run in the cloud.
Directories ¶
Path | Synopsis |
---|---|
Package cartofacade contains the api to call into CGO
|
Package cartofacade contains the api to call into CGO |
Package config implements functions to assist with attribute evaluation in the SLAM service.
|
Package config implements functions to assist with attribute evaluation in the SLAM service. |
Package main is a module with a cartographer SLAM service model.
|
Package main is a module with a cartographer SLAM service model. |
Package postprocess contains functionality to postprocess pointcloud maps
|
Package postprocess contains functionality to postprocess pointcloud maps |
Package sensorprocess contains the logic to add lidar or replay sensor readings to cartographer's cartofacade
|
Package sensorprocess contains the logic to add lidar or replay sensor readings to cartographer's cartofacade |
Package sensors defines interfaces for sensors used by viam cartographer
|
Package sensors defines interfaces for sensors used by viam cartographer |
inject
Package inject provides dependency injected structures for mocking interfaces.
|
Package inject provides dependency injected structures for mocking interfaces. |
Package testhelper provides test helpers which don't depend on viamcartographer
|
Package testhelper provides test helpers which don't depend on viamcartographer |