-
Notifications
You must be signed in to change notification settings - Fork 79
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
Parsing floats in URDF yields wrong value depending on locale #41
Comments
Related urdfdom issue: ros/urdfdom#98 . |
So I ended up looking into this a bit. @traversaro did some good investigating of the issue in robotology/idyntree#288 (comment), and digging down into the URDF schema, this is represented as an xs:double. Looking at the XSD document here, it says that the mantissa for a double is represented as a "decimal" number. And looking at the XSD document here, a decimal number is a "finite-length sequence of decimal digits (#x30-#x39) separated by a period as a decimal indicator". Thus, the locale should have no effect on how the document is parsed, and using |
We also ran into this issue over at ros2/rviz when migrating the RobotModel display. |
urdfdom_headers
usesstd::stod
to parse floating point values like position (xyz) and rotation (rpy) from URDF files. The result ofstd::stod
is locale dependant. So with e.g. a German locale (de_DE.UTF-8) "1.57079632679" is parsed to1
.This is the case in
urdfdom_headers/urdf_model/include/urdf_model/pose.h
Line 70 (not necessarily exclusive)In my opinion the issue described here can be linked to this error, as can be the issue described here.
This link states that "[...] using a stringstream to convert it worked perfectly fine."
If desired I can fix this issue using stringstream and create a pull request, but I have to admit I have no background knowledge in ros package building and testing procedures.
Cheers
The text was updated successfully, but these errors were encountered: