8 #include <Eigen/Geometry>
10 #include <SimoxUtility/color/Color.h>
11 #include <VirtualRobot/MathTools.h>
24 #include "conversions/eigen.h"
33 const std::string& frame,
34 const Eigen::Isometry3f& globalSensorPose)
38 drawCircles(features, frame, globalSensorPose);
43 drawConvexHulls(features, frame, globalSensorPose);
48 drawEllipsoids(features, frame, globalSensorPose);
53 drawChains(features, frame, globalSensorPose);
59 const Eigen::Isometry3f& globalSensorPose,
69 .
pose(globalSensorPose));
76 const Eigen::Isometry3f& robotGlobalPose,
79 auto layer = arviz.
layer(layerName);
81 drawCircle(layer, circle, robotGlobalPose, color);
88 const Eigen::Isometry3f& globalSensorPose,
92 const Eigen::Vector3f position =
93 globalSensorPose * Eigen::Vector3f(circle.
center.x(), circle.
center.y(), 10.F);
96 .
axisLengths(Eigen::Vector3f{circle.radius, circle.radius, 0.F})
102 ArVizDrawer::drawCircles(
const std::vector<Features>& features,
103 const std::string& frame,
104 const Eigen::Isometry3f& globalSensorPose)
106 auto layer = arviz.
layer(
"circles_" + frame);
108 std::for_each(features.begin(),
124 ArVizDrawer::drawConvexHulls(
const std::vector<Features>& features,
125 const std::string& frame,
126 const Eigen::Isometry3f& globalSensorPose)
128 auto layer = arviz.layer(
"convex_hulls_" + frame);
130 std::for_each(features.begin(),
134 if (not f.convexHull)
146 ArVizDrawer::draw(
const std::string& layerName,
147 const VirtualRobot::MathTools::ConvexHull2D& robotHull,
148 const Eigen::Isometry3f& robotGlobalPose,
151 auto layer = arviz.layer(layerName);
153 drawConvexHull(layer, robotHull, robotGlobalPose, color);
158 ArVizDrawer::drawConvexHull(
viz::Layer& layer,
159 const VirtualRobot::MathTools::ConvexHull2D& hull,
160 const Eigen::Isometry3f& globalSensorPose,
168 .
pose(globalSensorPose));
172 ArVizDrawer::drawEllipsoids(
const std::vector<Features>& features,
173 const std::string& frame,
174 const Eigen::Isometry3f& globalSensorPose)
176 auto layer = arviz.layer(
"ellipsoids_" + frame);
178 std::for_each(features.begin(),
186 drawEllipsoid(layer, *f.ellipsoid, globalSensorPose);
195 const Eigen::Isometry3f& globalSensorPose)
198 const Eigen::Isometry3f pose = globalSensorPose * ellipsoid.pose;
207 ArVizDrawer::drawChains(
const std::vector<Features>& features,
208 const std::string& frame,
209 const Eigen::Isometry3f& globalSensorPose)
211 auto layer = arviz.layer(
"chains_" + frame);
213 std::for_each(features.begin(),
221 drawChain(layer, *f.chain, globalSensorPose);
236 const Eigen::Isometry3f& globalSensorPose)
238 if (chain.size() < 2)
249 .
pose(globalSensorPose));