Skip to content
Snippets Groups Projects
Commit d6a472bd authored by Fabian Reister's avatar Fabian Reister
Browse files

orientation optimization: clamping orientations before printing

parent 5bf61fbe
No related branches found
No related tags found
No related merge requests found
#include "OrientationOptimizer.h"
#include <algorithm>
#include <cmath>
#include <range/v3/range/conversion.hpp>
......@@ -16,6 +17,7 @@
#include <SimoxUtility/math/convert/mat4f_to_xyyaw.h>
#include <SimoxUtility/math/convert/rpy_to_mat3f.h>
#include <SimoxUtility/math/periodic/periodic_clamp.h>
#include <SimoxUtility/math/periodic/periodic_diff.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
......@@ -134,6 +136,11 @@ namespace armarx::navigation::global_planning::optimization
std::cout << summary.FullReport() << "\n";
// std::cout << summary.BriefReport() << "\n";
const auto clampInPlace = [](auto& val)
{ val = simox::math::periodic_clamp(val, -M_PI, M_PI); };
std::for_each(orientations.begin(), orientations.end(), clampInPlace);
ARMARX_INFO << "orientations after: " << orientations;
ARMARX_INFO << "Optimization: " << summary.iterations.size() << " iterations";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment