@@ -300,21 +300,7 @@ bool SRDFConfig::GeneratedJointLimits::writeYaml(YAML::Emitter& emitter)
300300
301301 // Output property
302302 emitter << YAML::Key << " max_velocity" ;
303-
304- // To Solve Putting integer Values like 100 as 100.0 in YAML
305- double val = std::min (fabs (b.max_velocity_ ), fabs (b.min_velocity_ ));
306-
307- // Check if val is a full integer (within floating-point tolerance)
308- bool is_integer = std::fabs (val - std::round (val)) < 1e-9 ;
309-
310- // Format value as string
311- std::ostringstream oss;
312- if (is_integer)
313- oss << std::fixed << std::setprecision (1 ) << val; // e.g. 100.0
314- else
315- oss << val; // e.g. 99.75
316-
317- emitter << YAML::Value << oss.str ();
303+ emitter << YAML::Value << static_cast <double >(std::min (fabs (b.max_velocity_ ), fabs (b.min_velocity_ )));
318304
319305 // Output property
320306 emitter << YAML::Key << " has_acceleration_limits" ;
@@ -329,21 +315,7 @@ bool SRDFConfig::GeneratedJointLimits::writeYaml(YAML::Emitter& emitter)
329315
330316 // Output property
331317 emitter << YAML::Key << " max_acceleration" ;
332-
333- // To Solve Putting integer Values like 100 as 100.0 in YAML
334- val = std::min (fabs (b.max_acceleration_ ), fabs (b.min_acceleration_ ));
335-
336- // Check if val is a full integer (within floating-point tolerance)
337- is_integer = std::fabs (val - std::round (val)) < 1e-9 ;
338-
339- // Format value as string
340- oss.str (" " ); // Clear the stringstream
341- if (is_integer)
342- oss << std::fixed << std::setprecision (1 ) << val; // e.g. 100.0
343- else
344- oss << val; // e.g. 99.75
345-
346- emitter << YAML::Value << oss.str ();
318+ emitter << YAML::Value << static_cast <double >(std::min (fabs (b.max_acceleration_ ), fabs (b.min_acceleration_ )));
347319
348320 emitter << YAML::EndMap;
349321 }
0 commit comments