-
Notifications
You must be signed in to change notification settings - Fork 310
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 portable version for string-to-double conversion #1257
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1257 +/- ##
==========================================
- Coverage 47.82% 47.66% -0.16%
==========================================
Files 40 41 +1
Lines 3448 3451 +3
Branches 1869 1876 +7
==========================================
- Hits 1649 1645 -4
Misses 455 455
- Partials 1344 1351 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Niceeee. Great job!
7a5e987
to
9e70ea2
Compare
@saikishor what do you think, which version should we use from ROS-J on? |
@christophfroehlich Thanks for bringing up this. I think What do you think? |
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.
LGTM
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.
Happy, just one small comment
@@ -26,22 +26,12 @@ | |||
#include <vector> | |||
|
|||
#include "hardware_interface/component_parser.hpp" | |||
#include "hardware_interface/helpers.hpp" |
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.
Can we add something like this?
#include "hardware_interface/helpers.hpp" | |
#if CPP_VER<=17 | |
#include "hardware_interface/helpers.hpp" | |
#endif |
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.
#if __cplusplus > 201402L
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.
...in a follow-up ticket
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.
The goal is to add the old code of parsing with std::from_chars
protected by CPP version protection. If a higher version then C++17 (this flag #if __cplusplus > 201402L
) is used then we should you this standard; otherwise we use the here implemented version.
2107f81
to
f64dd7b
Compare
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.
Thanks a lot for this !
LGTM
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.
LGTM
(cherry picked from commit 0dfbd3d)
As raised with #949 the current code is not portable to compilers not fully supporting c++17 (like on Debian 11,..) since #921
I propose using the solution of urdfdom_headers, srdfdom and MoveIt2, which fixes #949.
I created a new file and moved also the
parse_bool
function.Maybe we should use this only for humble+iron, and leave the "modern"
std::from_chars
in rolling and for future distros? Edit: we want to keep that and add thestd::from_chars
with build-macros for newer compiler.Once this is merged, I'd fix also with the then-decided solutions