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

Faster lookup #190

Closed
wants to merge 10 commits into from
Closed

Faster lookup #190

wants to merge 10 commits into from

Conversation

arjo129
Copy link
Member

@arjo129 arjo129 commented Apr 12, 2022

This PR depends on:

It supersedes #188 and only focuses on the lookup thus making the reviewers life easier.

It implements a fast lookup for grid data like the data provided by MBARI. It also adds an integration test for the science data. Currently we are only checking data that does not vary with time. I have removed all interpolation code from this PR to keep it clean. I will be adding it back in the next PR. On my Laptop's Ryzen 9 5900HX this code takes between 3-15 microseconds per lookup.

Currently all our tests are failing because the garden tagged images were removed. This retargets the tests to use the latest tag.

Signed-off-by: Arjo Chakravarty <[email protected]>
As pointed out by @hidmic , #174 makes test_range_bearing redundant. This PR eleminates the test and the associated files.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass. Left some comments, most are minor. I understand this is halfway a refactor, so I'm good with deferring code cleanup.


// Spawn first vehicle
ignition::transport::Node node;
node.Subscribe("/model/vehicle1/chlorophyll", &ChlorophyllCb);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arjo129 meta: much of this test is preparation in order to check for science data. Why not crafting a world SDF that spawns the vehicle at the desired location?

Copy link
Member Author

@arjo129 arjo129 Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I eventually want to eliminate the zoo of worlds we have and focus just on empty_environment.sdf. Ideally we would write spawning infra to make it easy. For now I have not done that yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arjo129 I agree with not having lots of worlds that are only slightly different. At the same time, I'm not sure if we can (should?) accommodate every test in the same world e.g. for some tests we may have to ensure there are no external forces acting on the vehicle, while others require them. Crafting the world in runtime also adds unrelated failure modes to a test, like in this case, where 90%+ of the assertions are accessory to what is being tested.

In my mind, having a generic base SDF and extending it with test-specific SDF snippets would be ideal. Unclear if that's possible though.

@@ -319,20 +170,14 @@ class tethys::ScienceSensorsSystemPrivate
/// this->timestamps.
/// Point cloud: spatial coordinates to index science data by location
/// in the ENU world frame.
/// TODO(arjo): remove dependence on PCL. We literally are only using it for
/// the visuallization.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arjo129 typo:

Suggested change
/// the visuallization.
/// the visualization.

public: std::vector<pcl::octree::OctreePointCloudSearch<pcl::PointXYZ>::Ptr>
spatialOctrees;
/// \brief Spatial index of data.
/// Vector size: number of time slices. Indices correspond to those of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arjo129 nit:

Suggested change
/// Vector size: number of time slices. Indices correspond to those of
/// Vector size: number of time slices. Indices correspond to those of this->timestamps.

?

points.push_back(
ignition::math::Vector3d(this->timeSpaceCoords[i]->at(j).x,
this->timeSpaceCoords[i]->at(j).y,
this->timeSpaceCoords[i]->at(j).z));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arjo129 nit: index this->timeSpaceCoords once in the outer loop, as in:

const auto & timeSpaceCoord = this->timeSpaceCoords[i];

lrauv_ignition_plugins/src/ScienceSensorsSystem.cc Outdated Show resolved Hide resolved
lrauv_ignition_plugins/src/ScienceSensorsSystem.cc Outdated Show resolved Hide resolved
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@hidmic
Copy link
Collaborator

hidmic commented Apr 25, 2022

I'll re-review when we merge #191 in.

@arjo129
Copy link
Member Author

arjo129 commented Apr 27, 2022

Superceded by #191

@arjo129 arjo129 closed this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants