lis-epfl / robogen

RoboGen - Robot generation through artificial evolution
http://www.robogen.org
GNU General Public License v3.0
27 stars 16 forks source link

Robot txt params may fail to read depending on system locale #53

Open ElteHupkes opened 8 years ago

ElteHupkes commented 8 years ago

In a nutshell (because I'm in a hurry, also the reason you're not getting a pull request, sorry): std::atof() is locale dependent, and may expect a comma as a decimal separator. This may truncate all sorts of values read by RobotRepresentation.cpp into their integer parts or multiply them by several orders of magnitude depending on the number of digits. Apparently my fully English Ubuntu 14.04 still has a Dutch locale setting for numbers, which is why I noticed this issue.

Possible solutions here: http://stackoverflow.com/questions/1333451/locale-independent-atof/1333534#1333534