-
Notifications
You must be signed in to change notification settings - Fork 111
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
DATA-534 Map Saving Localizing (RDK) #1548
Conversation
@@ -248,7 +248,7 @@ type AttrConfig struct { | |||
Algorithm string `json:"algorithm"` | |||
ConfigParams map[string]string `json:"config_params"` | |||
DataRateMs int `json:"data_rate_msec"` | |||
MapRateSec int `json:"map_rate_sec"` |
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.
Do we want to repeat this process for DataRateMs and potentially other parameters as well? It makes a clearer check of if its present or not
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.
Yes, if there is a strong reason to do so. If so, we can probably discuss in the next slam meeting
…-viam/rdk into 11022022_MapRateDefaultUpdate
attrCfg := &builtin.AttrConfig{ | ||
Algorithm: "fake_orbslamv3", | ||
Sensors: []string{"good_color_camera"}, | ||
ConfigParams: map[string]string{"mode": "mono", "test_param": "viam"}, | ||
DataDirectory: name, | ||
MapRateSec: 200, | ||
MapRateSec: &mapRate, |
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.
Note: cant do &(200) or anything like that so I have had to define the mapRate variable to create the pointer. If anyone has a better way to do that let me know
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.
only thought would be making them constants(idk if that would work here) or just making a good_mapRate
and bad_mapRate
.
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.
LGTM just some small stuff
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.
Nice! A few changes needed
@@ -248,7 +248,7 @@ type AttrConfig struct { | |||
Algorithm string `json:"algorithm"` | |||
ConfigParams map[string]string `json:"config_params"` | |||
DataRateMs int `json:"data_rate_msec"` | |||
MapRateSec int `json:"map_rate_sec"` |
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.
Yes, if there is a strong reason to do so. If so, we can probably discuss in the next slam meeting
services/slam/builtin/builtin.go
Outdated
if svcConfig.MapRateSec != nil && *svcConfig.MapRateSec >= 0 { | ||
if *svcConfig.MapRateSec >= 0 { | ||
logger.Info("setting slam system to localization mode") | ||
} |
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.
The nested if statements where you check twice for the same condition are confusing. I would just go about it sequentially:
- If the value is nil, set to the default & log it
- Else If the value is >= 0 set to that value
a. If value is == 0 then log that it's in localization only mode - else if the value is < 0, complain that it's an invalid number and exit (or set to default? What did we define in the tech spec?)
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.
moving check of map_rate being less than 0 (invalid) to configuration check similar to data_rate_msec. Nested if statement also removed
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.
LGTM mod a few [opt]s
|
Adding localization mode when map rate is set to 0. Using a pointer value for this to allow 0 to be specified and not used as the default for this optional parameter.
JIRA Ticket: https://viam.atlassian.net/browse/DATA-534
Associated PR: viamrobotics/slam#72