Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksanford committed Jul 10, 2023
1 parent 5b09e46 commit 803d2dd
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 132 deletions.
2 changes: 1 addition & 1 deletion internal/testhelper/testhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const (
func CreateTempFolderArchitecture(logger golog.Logger) (string, error) {
tmpDir, err := os.MkdirTemp("", "*")
if err != nil {
return "nil", err
return "", err
}
if err := vcConfig.SetupDirectories(tmpDir, logger); err != nil {
return "", err
Expand Down
14 changes: 10 additions & 4 deletions viam-cartographer.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ func New(

// Set up the data directories
// TODO: Figure out how to not do this if v2 is enabled
if err := vcConfig.SetupDirectories(svcConfig.DataDirectory, logger); err != nil {
return nil, err
}

port, dataRateMsec, mapRateSec, useLiveData, deleteProcessedData, modularizationV2Enabled, err := vcConfig.GetOptionalParameters(
svcConfig,
Expand All @@ -178,10 +175,17 @@ func New(
defaultMapRateSec,
logger,
)

if err != nil {
return nil, err
}

if !modularizationV2Enabled {
if err := vcConfig.SetupDirectories(svcConfig.DataDirectory, logger); err != nil {
return nil, err
}
}

// Get the lidar for the Dim2D cartographer sub algorithm
lidar, err := dim2d.NewLidar(ctx, deps, svcConfig.Sensors, logger)
if err != nil {
Expand Down Expand Up @@ -335,8 +339,10 @@ func parseCartoAlgoConfig(configParams map[string]string, logger golog.Logger) (
return cartoAlgoCfg, err
}
cartoAlgoCfg.RotationWeight = fVal
// ignore mode as it is a special case
case "mode":
default:
logger.Warn("unused config param: %s: %s", k, val)
logger.Warnf("unused config param: %s: %s", k, val)
}
}
return cartoAlgoCfg, nil
Expand Down
1 change: 1 addition & 0 deletions viam-cartographer_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,4 @@ func TestParseCartoAlgoConfig(t *testing.T) {
test.That(t, cartoAlgoConfig, test.ShouldResemble, defaultCartoAlgoCfg)
})
}

Loading

0 comments on commit 803d2dd

Please sign in to comment.