Skip to content

Commit 73fc09e

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 5d021de commit 73fc09e

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
@@ -324,6 +324,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
324324
set_payload_srv_ = robot_hw_nh.advertiseService<ur_msgs::SetPayload::Request, ur_msgs::SetPayload::Response>(
325325
"set_payload", [&](ur_msgs::SetPayload::Request& req, ur_msgs::SetPayload::Response& resp) {
326326
std::stringstream cmd;
327+
cmd.imbue(std::locale::classic()); // Make sure, decimal divider is actually '.'
327328
cmd << "sec setup():" << std::endl
328329
<< " set_payload(" << req.payload << ", [" << req.center_of_gravity.x << ", " << req.center_of_gravity.y
329330
<< ", " << req.center_of_gravity.z << "])" << std::endl

0 commit comments

Comments
 (0)