Skip to content
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

Merged
9 commits merged into from Nov 3, 2022
Merged

DATA-534 Map Saving Localizing (RDK) #1548

9 commits merged into from Nov 3, 2022

Conversation

ghost
Copy link

@ghost ghost commented Nov 2, 2022

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

@@ -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"`
Copy link
Author

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

Copy link
Contributor

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

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,
Copy link
Author

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

Copy link
Member

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.

@ghost ghost added the safe to test This pull request is marked safe to test from a trusted zone label Nov 2, 2022
@ghost ghost requested review from tessavitabile, kkufieta and JohnN193 and removed request for tessavitabile November 2, 2022 16:53
@ghost ghost marked this pull request as ready for review November 2, 2022 16:54
@ghost ghost requested a review from tessavitabile November 2, 2022 16:54
Copy link
Member

@JohnN193 JohnN193 left a 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

services/slam/builtin/builtin.go Outdated Show resolved Hide resolved
services/slam/builtin/builtin_test.go Outdated Show resolved Hide resolved
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Nov 2, 2022
@ghost ghost added the safe to test This pull request is marked safe to test from a trusted zone label Nov 2, 2022
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Nov 2, 2022
@tessavitabile tessavitabile removed their request for review November 2, 2022 17:50
Copy link
Contributor

@kkufieta kkufieta left a 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"`
Copy link
Contributor

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 Show resolved Hide resolved
Comment on lines 488 to 491
if svcConfig.MapRateSec != nil && *svcConfig.MapRateSec >= 0 {
if *svcConfig.MapRateSec >= 0 {
logger.Info("setting slam system to localization mode")
}
Copy link
Contributor

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:

  1. If the value is nil, set to the default & log it
  2. Else If the value is >= 0 set to that value
    a. If value is == 0 then log that it's in localization only mode
  3. 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?)

Copy link
Author

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

services/slam/builtin/builtin.go Outdated Show resolved Hide resolved
services/slam/builtin/builtin_test.go Show resolved Hide resolved
@ghost ghost requested a review from kkufieta November 2, 2022 23:35
Copy link
Contributor

@kkufieta kkufieta left a 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

services/slam/builtin/builtin.go Outdated Show resolved Hide resolved
services/slam/builtin/builtin.go Outdated Show resolved Hide resolved
services/slam/builtin/builtin.go Show resolved Hide resolved
jeremyhyde-viam added 2 commits November 3, 2022 11:06
@ghost ghost added the safe to test This pull request is marked safe to test from a trusted zone label Nov 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2022

Code Coverage

Package Line Rate Delta Health
go.viam.com/rdk/components/arm 59% 0.00%
go.viam.com/rdk/components/arm/universalrobots 12% 0.00%
go.viam.com/rdk/components/arm/xarm 2% 0.00%
go.viam.com/rdk/components/arm/yahboom 7% 0.00%
go.viam.com/rdk/components/audioinput 55% 0.00%
go.viam.com/rdk/components/base 68% 0.00%
go.viam.com/rdk/components/base/agilex 62% 0.00%
go.viam.com/rdk/components/base/boat 41% 0.00%
go.viam.com/rdk/components/base/wheeled 76% 0.00%
go.viam.com/rdk/components/board 69% 0.00%
go.viam.com/rdk/components/board/arduino 10% 0.00%
go.viam.com/rdk/components/board/commonsysfs 47% 0.00%
go.viam.com/rdk/components/board/fake 39% 0.00%
go.viam.com/rdk/components/board/numato 19% 0.00%
go.viam.com/rdk/components/board/pi 50% 0.00%
go.viam.com/rdk/components/camera 66% 0.00%
go.viam.com/rdk/components/camera/fake 67% 0.00%
go.viam.com/rdk/components/camera/ffmpeg 71% -1.27%
go.viam.com/rdk/components/camera/transformpipeline 80% 0.00%
go.viam.com/rdk/components/camera/videosource 56% +0.64%
go.viam.com/rdk/components/encoder/fake 77% 0.00%
go.viam.com/rdk/components/gantry 68% 0.00%
go.viam.com/rdk/components/gantry/multiaxis 84% 0.00%
go.viam.com/rdk/components/gantry/oneaxis 86% 0.00%
go.viam.com/rdk/components/generic 84% 0.00%
go.viam.com/rdk/components/gripper 82% 0.00%
go.viam.com/rdk/components/input 86% 0.00%
go.viam.com/rdk/components/input/gpio 83% 0.00%
go.viam.com/rdk/components/motor 82% 0.00%
go.viam.com/rdk/components/motor/dmc4000 69% 0.00%
go.viam.com/rdk/components/motor/fake 58% 0.00%
go.viam.com/rdk/components/motor/gpio 63% 0.00%
go.viam.com/rdk/components/motor/gpiostepper 57% +0.59%
go.viam.com/rdk/components/motor/tmcstepper 62% 0.00%
go.viam.com/rdk/components/movementsensor 67% 0.00%
go.viam.com/rdk/components/movementsensor/cameramono 40% 0.00%
go.viam.com/rdk/components/movementsensor/gpsnmea 37% 0.00%
go.viam.com/rdk/components/movementsensor/gpsrtk 28% 0.00%
go.viam.com/rdk/components/posetracker 88% 0.00%
go.viam.com/rdk/components/sensor 88% 0.00%
go.viam.com/rdk/components/sensor/ultrasonic 34% 0.00%
go.viam.com/rdk/components/servo 77% 0.00%
go.viam.com/rdk/config 77% 0.00%
go.viam.com/rdk/control 57% 0.00%
go.viam.com/rdk/data 77% 0.00%
go.viam.com/rdk/grpc 25% 0.00%
go.viam.com/rdk/ml 67% 0.00%
go.viam.com/rdk/ml/inference 70% 0.00%
go.viam.com/rdk/motionplan 71% +2.34%
go.viam.com/rdk/operation 84% 0.00%
go.viam.com/rdk/pointcloud 71% +0.09%
go.viam.com/rdk/protoutils 62% 0.00%
go.viam.com/rdk/referenceframe 78% 0.00%
go.viam.com/rdk/registry 88% 0.00%
go.viam.com/rdk/resource 85% 0.00%
go.viam.com/rdk/rimage 78% 0.00%
go.viam.com/rdk/rimage/depthadapter 94% 0.00%
go.viam.com/rdk/rimage/transform 73% 0.00%
go.viam.com/rdk/rimage/transform/cmd/extrinsic_calibration 67% 0.00%
go.viam.com/rdk/robot 93% 0.00%
go.viam.com/rdk/robot/client 79% 0.00%
go.viam.com/rdk/robot/framesystem 68% 0.00%
go.viam.com/rdk/robot/impl 79% 0.00%
go.viam.com/rdk/robot/server 59% +0.97%
go.viam.com/rdk/robot/web 60% 0.00%
go.viam.com/rdk/robot/web/stream 87% 0.00%
go.viam.com/rdk/services/armremotecontrol 75% 0.00%
go.viam.com/rdk/services/armremotecontrol/builtin 25% 0.00%
go.viam.com/rdk/services/baseremotecontrol 75% 0.00%
go.viam.com/rdk/services/baseremotecontrol/builtin 71% 0.00%
go.viam.com/rdk/services/datamanager 62% 0.00%
go.viam.com/rdk/services/datamanager/builtin 78% 0.00%
go.viam.com/rdk/services/datamanager/datacapture 21% 0.00%
go.viam.com/rdk/services/datamanager/datasync 72% 0.00%
go.viam.com/rdk/services/motion 68% 0.00%
go.viam.com/rdk/services/motion/builtin 89% 0.00%
go.viam.com/rdk/services/navigation 54% 0.00%
go.viam.com/rdk/services/sensors 78% 0.00%
go.viam.com/rdk/services/sensors/builtin 97% 0.00%
go.viam.com/rdk/services/shell 15% 0.00%
go.viam.com/rdk/services/slam 86% 0.00%
go.viam.com/rdk/services/slam/builtin 73% -0.11%
go.viam.com/rdk/services/vision 82% 0.00%
go.viam.com/rdk/services/vision/builtin 74% 0.00%
go.viam.com/rdk/spatialmath 85% 0.00%
go.viam.com/rdk/subtype 96% 0.00%
go.viam.com/rdk/utils 71% 0.00%
go.viam.com/rdk/vision 26% 0.00%
go.viam.com/rdk/vision/chess 80% 0.00%
go.viam.com/rdk/vision/delaunay 87% 0.00%
go.viam.com/rdk/vision/keypoints 92% 0.00%
go.viam.com/rdk/vision/objectdetection 82% 0.00%
go.viam.com/rdk/vision/odometry 60% 0.00%
go.viam.com/rdk/vision/odometry/cmd 0% 0.00%
go.viam.com/rdk/vision/segmentation 49% 0.00%
go.viam.com/rdk/web/server 26% 0.00%
Summary 66% (19075 / 28840) +0.17%

@ghost ghost merged commit fd82a61 into viamrobotics:main Nov 3, 2022
@ghost ghost deleted the 11022022_MapRateDefaultUpdate branch December 29, 2022 20:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants