config

package
v0.2.35 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package config implements functions to assist with attribute evaluation in the SLAM service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineDeleteProcessedData

func DetermineDeleteProcessedData(logger golog.Logger, deleteData *bool, useLiveData bool) bool

DetermineDeleteProcessedData will determine the value of the deleteProcessData attribute based on the useLiveData and deleteData input parameters.

func DetermineUseLiveData

func DetermineUseLiveData(logger golog.Logger, liveData *bool, sensors []string) (bool, error)

DetermineUseLiveData will determine the value of the useLiveData attribute based on the liveData input parameter and sensor list.

func GetOptionalParameters

func GetOptionalParameters(config *AttrConfig, defaultPort string,
	defaultDataRateMsec, defaultMapRateSec int, logger golog.Logger,
) (string, int, int, bool, bool, error)

GetOptionalParameters sets any unset optional config parameters to the values passed to this function, and returns them.

func SetupDirectories

func SetupDirectories(dataDirectory string, logger golog.Logger) error

SetupDirectories creates the data directory at the specified path along with its data, map, and config subdirectories.

func SetupGRPCConnection

func SetupGRPCConnection(
	ctx context.Context,
	port string,
	dialMaxTimeoutSec int,
	logger golog.Logger,
) (pb.SLAMServiceClient, func() error, error)

SetupGRPCConnection uses the defined port to create a GRPC client for communicating with the SLAM algorithms.

Types

type AttrConfig

type AttrConfig struct {
	Sensors             []string          `json:"sensors"`
	ConfigParams        map[string]string `json:"config_params"`
	DataDirectory       string            `json:"data_dir"`
	UseLiveData         *bool             `json:"use_live_data"`
	DataRateMsec        int               `json:"data_rate_msec"`
	MapRateSec          *int              `json:"map_rate_sec"`
	Port                string            `json:"port"`
	DeleteProcessedData *bool             `json:"delete_processed_data"`
}

AttrConfig describes how to configure the SLAM service.

func NewAttrConfig

func NewAttrConfig(cfg config.Service) (*AttrConfig, error)

NewAttrConfig creates a SLAM config from a service config.

func (*AttrConfig) Validate

func (config *AttrConfig) Validate(path string) ([]string, error)

Validate creates the list of implicit dependencies.

Jump to

Keyboard shortcuts

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