Skip to content

Commit

Permalink
Explicitly set stringstream's locale to classic
Browse files Browse the repository at this point in the history
I am not sure whether this is necessary, but this will make sure that
decimal divider will be a dot.
  • Loading branch information
fmauch committed Jun 23, 2020
1 parent 08e7ca3 commit 79874a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ur_robot_driver/src/ros/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw
set_payload_srv_ = robot_hw_nh.advertiseService<ur_msgs::SetPayload::Request, ur_msgs::SetPayload::Response>(
"set_payload", [&](ur_msgs::SetPayload::Request& req, ur_msgs::SetPayload::Response& resp) {
std::stringstream cmd;
cmd.imbue(std::locale::classic()); // Make sure, decimal divider is actually '.'
cmd << "sec setup():" << std::endl
<< " set_payload(" << req.payload << ", [" << req.center_of_gravity.x << ", " << req.center_of_gravity.y
<< ", " << req.center_of_gravity.z << "])" << std::endl
Expand Down

0 comments on commit 79874a8

Please sign in to comment.