Skip to content

Commit

Permalink
[RSDK-5601] Add sensor validation when using cloudslam (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnN193 authored Nov 20, 2023
1 parent 0fde277 commit 7f5dbb5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions viam_cartographer.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,6 @@ func New(
return nil, err
}

if svcConfig.UseCloudSlam != nil && *svcConfig.UseCloudSlam {
return &CartographerService{
Named: c.ResourceName().AsNamed(),
useCloudSlam: true,
logger: logger,
}, nil
}

subAlgo := SubAlgo(svcConfig.ConfigParams["mode"])
if subAlgo != Dim2d {
return nil, errors.Errorf("%v does not have a 'mode: %v'",
Expand Down Expand Up @@ -297,6 +289,15 @@ func New(
}
}

// do not initialize CartoFacade or Sensor Processes when using cloudslam
if svcConfig.UseCloudSlam != nil && *svcConfig.UseCloudSlam {
return &CartographerService{
Named: c.ResourceName().AsNamed(),
useCloudSlam: true,
logger: logger,
}, nil
}

err = initCartoFacade(cancelCartoFacadeCtx, cartoSvc)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7f5dbb5

Please sign in to comment.