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

Add rudimentary stl support #64

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Conversation

sjahr
Copy link
Contributor

@sjahr sjahr commented Nov 28, 2024

I wouldn't call it .stl support but at least everybody should be able to use moveit configs other than the panda with this 😅

@sjahr sjahr requested review from sea-bass and kamiradi November 28, 2024 09:15
@kamiradi
Copy link
Member

kamiradi commented Nov 28, 2024 via email

Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Cool!

scripts/convert_stl_to_obj.py Outdated Show resolved Hide resolved
moveit_drake.repos Show resolved Hide resolved
include/moveit/drake/conversions.hpp Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
src/conversions.cpp Outdated Show resolved Hide resolved
@sjahr
Copy link
Contributor Author

sjahr commented Nov 29, 2024

Thanks @sea-bass! Ready for round 2.

@sjahr sjahr requested a review from sea-bass November 29, 2024 14:54
Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Few really minor things, and LGTM

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
moveit_drake.repos Show resolved Hide resolved
scripts/convert_stl_to_obj.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
scripts/convert_stl_to_obj.py Outdated Show resolved Hide resolved
Co-authored-by: Sebastian Castro <[email protected]>
@sjahr sjahr merged commit 15c9687 into moveit:main Nov 29, 2024
2 checks passed
Copy link
Member

@CihatAltiparmak CihatAltiparmak left a comment

Choose a reason for hiding this comment

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

Hello, seems i am late, but there is some reviews to be consider if you have willingness to consider it. Maybe you can take into account of it for next follow-up PRs.

Comment on lines +243 to +260
std::string result = input;
const std::string lower_case_stl = ".stl";
const std::string upper_case_stl = ".STL";
const std::string replacement = ".obj";

size_t pos = 0;
while ((pos = result.find(lower_case_stl, pos)) != std::string::npos)
{
result.replace(pos, lower_case_stl.length(), replacement);
pos += replacement.length(); // Move past the replacement to avoid infinite loop
}

pos = 0;
while ((pos = result.find(upper_case_stl, pos)) != std::string::npos)
{
result.replace(pos, upper_case_stl.length(), replacement);
pos += replacement.length(); // Move past the replacement to avoid infinite loop
}
Copy link
Member

Choose a reason for hiding this comment

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

As i understood, you're trying to change file extenstions only. By asssuming it is used c++17 standard, why didn't you consider to use filesystem library's replace extenstion for this stuff?

@@ -1,4 +1,6 @@
#include <cmath>
#include <iostream>
Copy link
Member

Choose a reason for hiding this comment

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

Is this header really necessary?

@@ -13,8 +13,8 @@ repositories:
version: main
moveit_resources:
type: git
url: https://github.com/moveit/moveit_resources
version: ros2
url: https://github.com/sjahr/moveit_resources
Copy link
Member

Choose a reason for hiding this comment

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

I am worried about the fact that dockerfile doesnt use this repos file.

Comment on lines +244 to +246
const std::string lower_case_stl = ".stl";
const std::string upper_case_stl = ".STL";
const std::string replacement = ".obj";
Copy link
Member

Choose a reason for hiding this comment

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

Why didn't we think of to use constexpr here? Just take it as a question bc i haven't use constexpr before.

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.

4 participants