-
Notifications
You must be signed in to change notification settings - Fork 113
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-1870 Data Loss in ReadPCDtoBasicOctree #1973
Changes from 2 commits
f69750f
364a757
2dbc6b0
fe4864e
a2706d5
468efac
b4a55f4
06860d6
f1eb455
d3afe1a
aee56ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -557,8 +557,19 @@ func TestBasicOctreePointcloudIngestion(t *testing.T) { | |
|
||
// Test the functionalities involved with converting a pcd into a basic octree. | ||
func TestReadBasicOctreeFromPCD(t *testing.T) { | ||
artifactPath := "pointcloud/test_short.pcd" | ||
t.Run("reading from binary PCD to octree", func(t *testing.T) { | ||
binaryArtifactPath := "slam/example_cartographer_outputs/viam-office-02-22-1/pointcloud/pointcloud_15.pcd" | ||
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.
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. In the additional details section, I note that the actual creation is only 0.3secs. I will look into on parallelizing the iterate calls 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. Note: the time for octree/pointcloud creations includes adding all the points 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. Can you find out what is taking 15s now? I want to make sure that Iterate() isn't slower than expected. 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. It is purely in the If this iterate that happens at every node is removed, the time goes down to 7 secs instead of 15 secs 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. @nicksanford based on the time sink being in the validate and caused not by the iterate, I don't think it's worth doing batching at present (the iterate takes approx. 0.2 sec on this large dataset and will be much smaller on a smaller dataset). Let me know if this works for you 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. Test now takes 0.1 secs on the raw data from an rplidar (808 points) 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.
@tessavitabile @nicksanford please confirm that we are alright with the 800 point pcd file instead of the 30,000 that takes 2.7 sec 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. yes 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. done |
||
testPCDToBasicOctree(t, binaryArtifactPath) | ||
}) | ||
|
||
t.Run("reading from ascii PCD to octree", func(t *testing.T) { | ||
asciiArtifactPath := "slam/mock_lidar/0.pcd" | ||
testPCDToBasicOctree(t, asciiArtifactPath) | ||
}) | ||
} | ||
|
||
// Helper function for testing basic octree creation from a given artifact. | ||
func testPCDToBasicOctree(t *testing.T, artifactPath string) { | ||
basicPC, err := makeFullPointCloudFromArtifact(t, artifactPath, BasicType) | ||
test.That(t, err, test.ShouldBeNil) | ||
basic, ok := basicPC.(*basicPointCloud) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,9 +247,11 @@ func validateMetadata(t *testing.T, bOct *BasicOctree) { | |
test.That(t, bOct.meta.MinY, test.ShouldEqual, metadata.MinY) | ||
test.That(t, bOct.meta.MaxZ, test.ShouldEqual, metadata.MaxZ) | ||
test.That(t, bOct.meta.MinZ, test.ShouldEqual, metadata.MinZ) | ||
test.That(t, bOct.meta.TotalX(), test.ShouldAlmostEqual, metadata.TotalX()) | ||
test.That(t, bOct.meta.TotalY(), test.ShouldAlmostEqual, metadata.TotalY()) | ||
test.That(t, bOct.meta.TotalZ(), test.ShouldAlmostEqual, metadata.TotalZ()) | ||
|
||
tol := 0.0001 | ||
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. What is 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. tolerance value, ill update the variable to make that more explicit 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. Could you please also add a comment why this is needed? 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. done |
||
test.That(t, bOct.meta.TotalX(), test.ShouldBeBetween, metadata.TotalX()-tol, metadata.TotalX()+tol) | ||
test.That(t, bOct.meta.TotalY(), test.ShouldBeBetween, metadata.TotalY()-tol, metadata.TotalY()+tol) | ||
test.That(t, bOct.meta.TotalZ(), test.ShouldBeBetween, metadata.TotalZ()-tol, metadata.TotalZ()+tol) | ||
} | ||
|
||
// Helper function to create lopsided octree for testing of recursion depth limit. | ||
|
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.
This test seems to check that all points in the pointcloud are also in the octree. Do you know why it passed previously? Does it fail now if the points are different?
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.
See conversation here: https://viaminc.slack.com/archives/C036N5GJFLM/p1678115565635339
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.
Just to confirm, without the fix, the test does fail on large input sizes? And we're now testing large enough input sizes that we would catch the regression?