-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RSDK-3786] full-mod-new-close #186
Merged
nicksanford
merged 32 commits into
viam-modules:main
from
nicksanford:RSDK-3547-use-cgo-api-methods2
Jul 11, 2023
Merged
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
b39c81c
RSDK-3547-use-cgo-api-methods2
nicksanford 717af18
wip
nicksanford 6de6b80
wip
nicksanford b7bc8b9
wip
nicksanford e1189cb
wip
nicksanford 79dfb99
fix tests
nicksanford da0e6bc
wip
nicksanford 73a15b4
clean up tests
nicksanford ca859bb
fix test helper names
nicksanford 4b1c2fb
wip
nicksanford 9305149
wip
nicksanford 3202c73
add tests
nicksanford e95fa5f
more tests
nicksanford 0f2f56e
more tests
nicksanford 5b09e46
wip
nicksanford 803d2dd
wip
nicksanford 2ccc1bc
wip
nicksanford a4012ab
add tests
nicksanford bc1c149
lint
nicksanford ad23318
fix lint
nicksanford 02df80f
remove debugging stubs
nicksanford 62223bc
wip
nicksanford 8ba1d3c
wip
nicksanford 98dc6ee
Update internal/testhelper/testhelper.go
nicksanford c57dce6
Update sensors/lidar/dim-2d/dim-2d.go
nicksanford a35cd37
Update testhelper/testhelper.go
nicksanford 63619ec
Update testhelper/testhelper.go
nicksanford 4f2677c
Update testhelper/testhelper.go
nicksanford e37e9d9
Update testhelper/testhelper.go
nicksanford 23f7ea1
Update viam-cartographer.go
nicksanford edfb2d7
fix build & respond to feedback
nicksanford 3b7930b
lint
nicksanford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,8 +77,10 @@ type GetPosition struct { | |
type LidarConfig int64 | ||
|
||
const ( | ||
twoD LidarConfig = iota | ||
threeD | ||
// TwoD LidarConfig denotes a 2d lidar | ||
TwoD LidarConfig = iota | ||
// ThreeD LidarConfig denotes a 3d lidar | ||
ThreeD | ||
) | ||
|
||
// CartoConfig contains config values from app | ||
|
@@ -92,19 +94,19 @@ type CartoConfig struct { | |
|
||
// CartoAlgoConfig contains config values from app | ||
type CartoAlgoConfig struct { | ||
optimizeOnStart bool | ||
optimizeEveryNNodes int | ||
numRangeData int | ||
missingDataRayLength float32 | ||
maxRange float32 | ||
minRange float32 | ||
maxSubmapsToKeep int | ||
freshSubmapsCount int | ||
minCoveredArea float64 | ||
minAddedSubmapsCount int | ||
occupiedSpaceWeight float64 | ||
translationWeight float64 | ||
rotationWeight float64 | ||
OptimizeOnStart bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to make these public to set them in viam-cartographer |
||
OptimizeEveryNNodes int | ||
NumRangeData int | ||
MissingDataRayLength float32 | ||
MaxRange float32 | ||
MinRange float32 | ||
MaxSubmapsToKeep int | ||
FreshSubmapsCount int | ||
MinCoveredArea float64 | ||
MinAddedSubmapsCount int | ||
OccupiedSpaceWeight float64 | ||
TranslationWeight float64 | ||
RotationWeight float64 | ||
} | ||
|
||
// NewLib calls viam_carto_lib_init and returns a pointer to a viam carto lib object. | ||
|
@@ -311,9 +313,9 @@ func goStringToBstring(goStr string) C.bstring { | |
|
||
func toLidarConfig(lidarConfig LidarConfig) (C.viam_carto_LIDAR_CONFIG, error) { | ||
switch lidarConfig { | ||
case twoD: | ||
case TwoD: | ||
return C.VIAM_CARTO_TWO_D, nil | ||
case threeD: | ||
case ThreeD: | ||
return C.VIAM_CARTO_THREE_D, nil | ||
default: | ||
return 0, errors.New("invalid lidar config value") | ||
|
@@ -349,19 +351,19 @@ func getConfig(cfg CartoConfig) (C.viam_carto_config, error) { | |
|
||
func toAlgoConfig(acfg CartoAlgoConfig) C.viam_carto_algo_config { | ||
vcac := C.viam_carto_algo_config{} | ||
vcac.optimize_on_start = C.bool(acfg.optimizeOnStart) | ||
vcac.optimize_every_n_nodes = C.int(acfg.optimizeEveryNNodes) | ||
vcac.num_range_data = C.int(acfg.numRangeData) | ||
vcac.missing_data_ray_length = C.float(acfg.missingDataRayLength) | ||
vcac.max_range = C.float(acfg.maxRange) | ||
vcac.min_range = C.float(acfg.minRange) | ||
vcac.max_submaps_to_keep = C.int(acfg.maxSubmapsToKeep) | ||
vcac.fresh_submaps_count = C.int(acfg.freshSubmapsCount) | ||
vcac.min_covered_area = C.double(acfg.minCoveredArea) | ||
vcac.min_added_submaps_count = C.int(acfg.minAddedSubmapsCount) | ||
vcac.occupied_space_weight = C.double(acfg.occupiedSpaceWeight) | ||
vcac.translation_weight = C.double(acfg.translationWeight) | ||
vcac.rotation_weight = C.double(acfg.rotationWeight) | ||
vcac.optimize_on_start = C.bool(acfg.OptimizeOnStart) | ||
vcac.optimize_every_n_nodes = C.int(acfg.OptimizeEveryNNodes) | ||
vcac.num_range_data = C.int(acfg.NumRangeData) | ||
vcac.missing_data_ray_length = C.float(acfg.MissingDataRayLength) | ||
vcac.max_range = C.float(acfg.MaxRange) | ||
vcac.min_range = C.float(acfg.MinRange) | ||
vcac.max_submaps_to_keep = C.int(acfg.MaxSubmapsToKeep) | ||
vcac.fresh_submaps_count = C.int(acfg.FreshSubmapsCount) | ||
vcac.min_covered_area = C.double(acfg.MinCoveredArea) | ||
vcac.min_added_submaps_count = C.int(acfg.MinAddedSubmapsCount) | ||
vcac.occupied_space_weight = C.double(acfg.OccupiedSpaceWeight) | ||
vcac.translation_weight = C.double(acfg.TranslationWeight) | ||
vcac.rotation_weight = C.double(acfg.RotationWeight) | ||
return vcac | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to make these public to use them in viam-cartographer