Skip to content

Commit 92d211b

Browse files
committed
convert err msg to ostringstream
1 parent ddf8195 commit 92d211b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ed_sensor_integration/src/kinect/fitter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
// Communication
2626
#include <ed_sensor_integration_msgs/ImageBinary.h>
2727

28+
#include <sstream>
29+
2830

2931
const double ERROR_THRESHOLD = 1e5;
3032

@@ -285,8 +287,9 @@ bool Fitter::estimateEntityPoseImp(const FitterData& data, const ed::WorldModel&
285287
double error_threshold = ERROR_THRESHOLD;
286288
if (current_optimum->getError() > error_threshold)
287289
{
288-
std::string errormsg = "Error of best fit [" + std::to_string(current_optimum->getError()) + "]exceeds threshold [" + std::to_string(error_threshold) +"]";
289-
throw FitterError(errormsg);
290+
std::ostringstream errormsg;
291+
errormsg << "Error of best fit [" << current_optimum->getError() << "] exceeds threshold [" << error_threshold << "]";
292+
throw FitterError(errormsg.str());
290293
}
291294

292295
// Correct for shape transformation

0 commit comments

Comments
 (0)