-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
Really cool, ill test it shortly 🎉
…On Thu, 28 Nov, 2024, 9:16 am Sebastian Jahr, ***@***.***> wrote:
@sjahr <https://github.com/sjahr> requested your review on: #64
<#64> Add rudimentary stl
support.
—
Reply to this email directly, view it on GitHub
<#64 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNFZJBTNCI3TKQ3T72SELT2C3NN5AVCNFSM6AAAAABSUUT4M6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGQ3DENBZGU2DSMI>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
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.
Cool!
Thanks @sea-bass! Ready for round 2. |
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.
Few really minor things, and LGTM
Co-authored-by: Sebastian Castro <[email protected]>
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.
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.
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 | ||
} |
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.
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> |
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.
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 |
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.
I am worried about the fact that dockerfile doesnt use this repos file.
const std::string lower_case_stl = ".stl"; | ||
const std::string upper_case_stl = ".STL"; | ||
const std::string replacement = ".obj"; |
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.
Why didn't we think of to use constexpr
here? Just take it as a question bc i haven't use constexpr
before.
I wouldn't call it .stl support but at least everybody should be able to use moveit configs other than the panda with this 😅