7#include <boost/geometry/algorithms/assign.hpp>
8#include <boost/geometry/algorithms/detail/distance/interface.hpp>
10#include <SimoxUtility/algorithm/apply.hpp>
16 computeDistance(
const std::vector<polygon_type>& obstacles,
const Eigen::Vector2f& pt)
20 float dist = std::numeric_limits<float>::max();
21 for (
const auto& obstacle : obstacles)
23 const float d = boost::geometry::distance(point, obstacle);
24 dist = std::min(d, dist);
33 std::vector<point_type> points = simox::alg::apply(hull,
toPoint);
34 points.push_back(points.front());
37 boost::geometry::assign_points(polygon, points);
45 return {pt.x(), pt.y()};
51 return {pt.x(), pt.y()};
This file is part of ArmarX.
Eigen::Vector2f fromPoint(const point_type &pt)
boost::geometry::model::d2::point_xy< float > point_type
point_type toPoint(const Eigen::Vector2f &pt)
polygon_type toPolygon(const std::vector< Eigen::Vector2f > &hull)
float computeDistance(const std::vector< polygon_type > &obstacles, const Eigen::Vector2f &pt)
boost::geometry::model::polygon< point_type > polygon_type