Skip to content

Commit 03d0cdf

Browse files
committed
Explicitly set stringstream's locale to classic
I am not sure whether this is necessary, but this will make sure that decimal divider will be a dot.
1 parent 3da9ae1 commit 03d0cdf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ur_robot_driver/src/ros/hardware_interface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
389389
set_payload_srv_ = robot_hw_nh.advertiseService<ur_msgs::SetPayload::Request, ur_msgs::SetPayload::Response>(
390390
"set_payload", [&](ur_msgs::SetPayload::Request& req, ur_msgs::SetPayload::Response& resp) {
391391
std::stringstream cmd;
392+
cmd.imbue(std::locale::classic()); // Make sure, decimal divider is actually '.'
392393
cmd << "sec setup():" << std::endl
393394
<< " set_payload(" << req.payload << ", [" << req.center_of_gravity.x << ", " << req.center_of_gravity.y
394395
<< ", " << req.center_of_gravity.z << "])" << std::endl

0 commit comments

Comments
 (0)