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

Use assimp to load stl #1063

Merged
merged 4 commits into from
Oct 16, 2023
Merged

Use assimp to load stl #1063

merged 4 commits into from
Oct 16, 2023

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Sep 11, 2023

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Sep 11, 2023
@ahcorde ahcorde mentioned this pull request Sep 11, 2023
@ahcorde ahcorde requested a review from clalancette September 11, 2023 14:07
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I only have one concern with this PR, which is whether all of the STL files we used to be able to load still load after this. There are like 600 in the Rolling sources right now, which is obviously too many to test by hand.

I'm not quite sure how to test this; @ahcorde what's your feeling here?

@clalancette clalancette linked an issue Sep 13, 2023 that may be closed by this pull request
@ahcorde
Copy link
Contributor Author

ahcorde commented Sep 13, 2023

I only have one concern with this PR, which is whether all of the STL files we used to be able to load still load after this. There are like 600 in the Rolling sources right now, which is obviously too many to test by hand.

I'm not quite sure how to test this; @ahcorde what's your feeling here?

This behaviour is already working on ROS 1. Just to avoid discrepancies between them when porting to ROS 2.

@ahcorde ahcorde requested a review from clalancette September 14, 2023 08:49
@ahcorde
Copy link
Contributor Author

ahcorde commented Oct 6, 2023

friendly ping @clalancette

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I've left a few minor comments on things to cleanup.

I have to say that while I think this is the correct thing to do, I'm a little nervous about it. It seems like we'll be rejecting more STL files now. But I guess the best we can do is try it out and see what happens.

Comment on lines 145 to 147
/// Load a "potentially" valid STL binary file with bigger size than the
/// expected. The extra "unexpected" data at the end of the file should be
/// ignored.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should remove this comment now, right? That is, we will not succeed on these STL files anymore, if I understand the change.

@@ -126,6 +125,13 @@ TEST_F(MeshLoaderTestFixture, loading_invalid_stl_files_fail) {
ASSERT_FALSE(rviz_rendering::loadMeshFromResource(mesh_path));
}

TEST_F(MeshLoaderTestFixture, loading_valid_ascii_stl_file) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this actually loading an "invalid" ascii STL file now? That is, we are changing this from valid -> invalid, so we should rename this (and probably the filename as well).

@@ -135,13 +141,13 @@ TEST_F(MeshLoaderTestFixture, loading_invalid_stl_files_should_fail) {
ASSERT_FALSE(rviz_rendering::loadMeshFromResource(mesh_path));
}

TEST_F(MeshLoaderTestFixture, loading_almost_valid_stl_files_should_succed) {
TEST_F(MeshLoaderTestFixture, loading_almost_valid_stl_files_should_fail) {
/// Load a "potentially" valid STL binary file with bigger size than the
/// expected. The extra "unexpected" data at the end of the file should be
/// ignored.
std::string mesh_path = "package://rviz_rendering_tests/test_meshes/valid_extra.stl";
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here; I think we should probably rename this to invalid_extra.stl.

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Oct 16, 2023

We are rejecting files which are not well-formed and this is the current behaviour of ROS 1.

@ahcorde ahcorde requested a review from clalancette October 16, 2023 11:25
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! This looks good to me with green CI.

@ahcorde
Copy link
Contributor Author

ahcorde commented Oct 16, 2023

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@ahcorde
Copy link
Contributor Author

ahcorde commented Oct 16, 2023

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit d02d94f into rolling Oct 16, 2023
@delete-merged-branch delete-merged-branch bot deleted the ahcorde/rolling/assimp_to_load_stl branch October 16, 2023 20:31
This was referenced Jul 12, 2024
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.

support ascii stl files
2 participants