Skip to content

Commit 79874a8

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 08e7ca3 commit 79874a8

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
@@ -385,6 +385,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
385385
set_payload_srv_ = robot_hw_nh.advertiseService<ur_msgs::SetPayload::Request, ur_msgs::SetPayload::Response>(
386386
"set_payload", [&](ur_msgs::SetPayload::Request& req, ur_msgs::SetPayload::Response& resp) {
387387
std::stringstream cmd;
388+
cmd.imbue(std::locale::classic()); // Make sure, decimal divider is actually '.'
388389
cmd << "sec setup():" << std::endl
389390
<< " set_payload(" << req.payload << ", [" << req.center_of_gravity.x << ", " << req.center_of_gravity.y
390391
<< ", " << req.center_of_gravity.z << "])" << std::endl

0 commit comments

Comments
 (0)