You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launch ign-gazebo with a locale in which the decimal separator is not .:
LC_NUMERIC=it_IT ign-gazebo
Expected behavior:
If launched with the C locale, ign-gazebo start correctly:
straversaro@iiticublap103:~/src/gazebo-superbuild/build-ign-gcc-8/install/bin$ LC_ALL="C" ./ign-gazebo --verbose 3
[Msg] Ignition Gazebo v0.1.0~pre1
[GUI] [Msg] Loading config [/home/straversaro/src/gazebo-superbuild/build-ign-gcc-8/install/share/ignition/gazebo0/gui/gui.config]
[GUI] [Msg] World [default] initialized with [default_physics] physics profile.
[GUI] [Msg] Loading plugin [Scene3D]
[GUI] [Msg] Added plugin [3D View] to main window
[GUI] [Msg] Loading plugin [WorldControl]
[GUI] [Msg] Added plugin [World control] to main window
[GUI] [Msg] Loading plugin [WorldStats]
[GUI] [Msg] Added plugin [World stats] to main window
[GUI] [Msg] Serving scene information on [/world/default/scene/info]
[GUI] [Msg] Serving scene graph on [/world/default/scene/graph]
[GUI] [Msg] Publishing pose messages on [/world/default/pose/info]
[GUI] [Msg] Loading plugin [ignition-rendering1-ogre]
Actual behavior:
straversaro@iiticublap103:~/src/gazebo-superbuild/build-ign-gcc-8/install/bin$ ./ign-gazebo --verbose 3
[Msg] Ignition Gazebo v0.1.0~pre1
[GUI] [Msg] Loading config [/home/straversaro/src/gazebo-superbuild/build-ign-gcc-8/install/share/ignition/gazebo0/gui/gui.config]
Error [Param.cc:395] Invalid argument. Unable to set value [.1 ] for key[near].
Exception [Param.cc:44] SDF ASSERTION
Invalid parameter
In function : Param
Assert expression : this->ValueFromString(_default)
terminate called after throwing an instance of 'sdf::v8::AssertionInternalError'
Aborted (core dumped)
Reproduces how often:
Everytime.
Versions
Ubuntu 18.04
sdformat branch : gz11
Additional Information
Checking the backtrace, it seems that the call sequence is:
sdf::Element::AddValue --> sdf::Element::CreateParam --> sdf::Param::Param --> sdf::Param::ValueFromString
A proper solution could be to substitute calls to str::stod with a locale-safe custom function as done in https://github.com/ros/urdfdom_headers/pull/42/files . An alternative, for the branch of SDFormat that support C++17
would be to use std::from_chars. Unfortunately, not all the strings
that represent a valid XML floating point number are valid inputs to std::from_chars (for example, +1.0 is not a valid input to std::to_chars), so even this is not a trivial solution.
The text was updated successfully, but these errors were encountered:
Original report (archived issue) by Silvio Traversaro (Bitbucket: traversaro).
Prerequisites
Description
Remake of https://scpeters-test.github.io/gh-pages_sdformat_fast_export/#!/osrf/sdformat/issues/60/error-when-starting-gazebo-if-lc_numeric (#60) . : )
I recently tried to test the work in progress version of ign-gazebo, and on my system I got a locale-related error (similar to
https://scpeters-test.github.io/gh-pages_sdformat_fast_export/#!/osrf/sdformat/issues/60/error-when-starting-gazebo-if-lc_numeric (#60) , ros/urdfdom#98
and ros/urdfdom#98).
Steps to Reproduce
Launch
ign-gazebo
with a locale in which the decimal separator is not.
:Expected behavior:
If launched with the
C
locale,ign-gazebo
start correctly:Actual behavior:
Reproduces how often:
Everytime.
Versions
Ubuntu 18.04
sdformat branch :
gz11
Additional Information
Checking the backtrace, it seems that the call sequence is:
sdf::Element::AddValue --> sdf::Element::CreateParam --> sdf::Param::Param --> sdf::Param::ValueFromString
A related commit is https://scpeters-test.github.io/gh-pages_sdformat_fast_export/#!/osrf/sdformat/commits/f6af03cf3a63d3a6dd1492a2f6031475625a71cd (3488a30) ,
but I am not sure why I never experienced this, as
template<typename T> void Param::Init(const std::string &_value)
method was prone to this locale error as well.
A proper solution could be to substitute calls to
str::stod
with a locale-safe custom function as done inhttps://github.com/ros/urdfdom_headers/pull/42/files . An alternative, for the branch of SDFormat that support C++17
would be to use
std::from_chars
. Unfortunately, not all the stringsthat represent a valid XML floating point number are valid inputs to
std::from_chars
(for example,+1.0
is not a valid input tostd::to_chars
), so even this is not a trivial solution.The text was updated successfully, but these errors were encountered: