3#include <SimoxUtility/color/hsv.h>
4#include <VirtualRobot/Visualization/TriMeshModel.h>
5#include <VirtualRobot/math/Helpers.h>
37 os <<
"Visu '" << rhs.
name <<
"' on layer '" << rhs.
layer <<
"'";
41 const std::string DebugDrawerTopic::TOPIC_NAME =
"DebugDrawerUpdates";
42 const std::string DebugDrawerTopic::DEFAULT_LAYER =
"debug";
50 const std::string& layer) :
51 topic(topic), _layer(layer)
76 return _enabled && topic;
81 const std::string& topicNameOverride)
const
83 component.offeringTopic(topicNameOverride.empty() ? TOPIC_NAME : topicNameOverride);
90 topicNameOverride.empty() ? TOPIC_NAME : topicNameOverride));
102 this->_layer = layer;
114 this->_lengthScale = scale;
138 this->_poseScale = scale;
156 this->
sleepFor(_shortSleepDuration);
183 topic->clearLayer(layer);
193 const Eigen::Vector3f& position,
194 const std::string& text,
196 const DrawColor color,
197 bool ignoreLengthScale)
201 const float scale = lengthScale(ignoreLengthScale);
202 topic->setTextVisu(layer(
id),
id.name, text, scaled(scale, position), color, size);
208 const Eigen::Vector3f& position,
210 const Eigen::Vector3f& extents,
211 const DrawColor& color,
212 bool ignoreLengthScale)
216 const float scale = lengthScale(ignoreLengthScale);
217 topic->setBoxVisu(layer(
id),
220 scaled(scale, extents),
227 const Eigen::Matrix4f& pose,
228 const Eigen::Vector3f& extents,
229 const DrawColor& color,
230 bool ignoreLengthScale)
233 ::math::Helpers::Position(pose),
242 const VirtualRobot::BoundingBox& boundingBox,
243 const DrawColor& color,
244 bool ignoreLengthScale)
246 drawBox(
id, boundingBox, Eigen::Matrix4f::Identity(), color, ignoreLengthScale);
251 const VirtualRobot::BoundingBox& boundingBox,
252 const Eigen::Matrix4f& pose,
253 const DrawColor& color,
254 bool ignoreLengthScale)
256 const Eigen::Vector3f center = .5 * (boundingBox.getMin() + boundingBox.getMax());
258 ::math::Helpers::TransformPosition(pose, center),
260 boundingBox.getMax() - boundingBox.getMin(),
270 topic->removeBoxVisu(layer(
id),
id.name);
276 const Eigen::Vector3f& position,
278 const Eigen::Vector3f& extents,
280 const DrawColor& color,
281 bool ignoreLengthScale)
284 ::math::Helpers::Pose(position, orientation),
293 const Eigen::Matrix4f& pose,
294 const Eigen::Vector3f& extents,
296 const DrawColor& color,
297 bool ignoreLengthScale)
304 std::vector<Eigen::Vector3f> points;
307 bb.col(0) = -extents / 2;
308 bb.col(1) = extents / 2;
310 auto addLine = [&](
int x1,
int y1,
int z1,
int x2,
int y2,
int z2)
312 Eigen::Vector3f start = {bb.col(x1).x(), bb.col(y1).y(), bb.col(z1).z()};
313 Eigen::Vector3f end = {bb.col(x2).x(), bb.col(y2).y(), bb.col(z2).z()};
315 start = ::math::Helpers::TransformPosition(pose, start);
316 end = ::math::Helpers::TransformPosition(pose, end);
318 points.push_back(start);
319 points.push_back(end);
331 addLine(0, 0, 0, 1, 0, 0);
332 addLine(0, 0, 0, 0, 1, 0);
333 addLine(0, 0, 0, 0, 0, 1);
336 addLine(1, 1, 1, 0, 1, 1);
337 addLine(1, 1, 1, 1, 0, 1);
338 addLine(1, 1, 1, 1, 1, 0);
341 addLine(1, 0, 0, 1, 0, 1);
342 addLine(1, 0, 0, 1, 1, 0);
345 addLine(0, 1, 0, 1, 1, 0);
346 addLine(0, 1, 0, 0, 1, 1);
349 addLine(0, 0, 1, 1, 0, 1);
350 addLine(0, 0, 1, 0, 1, 1);
352 drawLineSet(
id, points, width, color, ignoreLengthScale);
357 const VirtualRobot::BoundingBox& boundingBox,
359 const DrawColor& color,
360 bool ignoreLengthScale)
362 drawBoxEdges(
id, boundingBox, Eigen::Matrix4f::Identity(), width, color, ignoreLengthScale);
369 const DrawColor& color,
370 bool ignoreLengthScale)
372 drawBoxEdges(
id, aabb, Eigen::Matrix4f::Identity(), width, color, ignoreLengthScale);
377 const VirtualRobot::BoundingBox& boundingBox,
378 const Eigen::Matrix4f& pose,
380 const DrawColor& color,
381 bool ignoreLengthScale)
383 const Eigen::Vector3f center = .5 * (boundingBox.getMin() + boundingBox.getMax());
386 ::math::Helpers::Pose(::math::Helpers::TransformPosition(pose, center),
387 ::math::Helpers::Orientation(pose)),
388 boundingBox.getMax() - boundingBox.getMin(),
397 const Eigen::Matrix4f& pose,
399 const DrawColor& color,
400 bool ignoreLengthScale)
402 const Eigen::Vector3f center = 0.5 * (aabb.col(0) + aabb.col(1));
405 ::math::Helpers::Pose(::math::Helpers::TransformPosition(pose, center),
406 ::math::Helpers::Orientation(pose)),
407 aabb.col(1) - aabb.col(0),
421 const Eigen::Vector3f& center,
422 const Eigen::Vector3f& direction,
425 const DrawColor& color,
426 bool ignoreLengthScale)
430 const float scale = lengthScale(ignoreLengthScale);
431 topic->setCylinderVisu(layer(
id),
433 scaled(scale, center),
435 scaled(scale, length),
436 scaled(scale, radius),
443 const Eigen::Vector3f& center,
447 const DrawColor& color,
448 bool ignoreLengthScale)
452 orientation * Eigen::Vector3f::UnitY(),
461 const Eigen::Vector3f& from,
462 const Eigen::Vector3f& to,
464 const DrawColor& color,
465 bool ignoreLengthScale)
469 const Eigen::Vector3f dir = (to - from);
470 const float length = dir.norm();
472 id, .5 * (from + to), dir / length, radius, length, color, ignoreLengthScale);
481 topic->removeCylinderVisu(layer(
id),
id.name);
487 const Eigen::Vector3f& center,
489 const DrawColor& color,
490 bool ignoreLengthScale)
494 const float scale = lengthScale(ignoreLengthScale);
495 topic->setSphereVisu(
496 layer(
id),
id.name, scaled(scale, center), color, scaled(scale, radius));
505 topic->removeSphereVisu(layer(
id),
id.name);
511 const Eigen::Vector3f& position,
512 const Eigen::Vector3f& direction,
515 const DrawColor& color,
516 bool ignoreLengthScale)
520 const float scale = lengthScale(ignoreLengthScale);
521 topic->setArrowVisu(layer(
id),
523 scaled(scale, position),
526 scaled(scale, length),
527 scaled(scale, width));
533 const Eigen::Vector3f& from,
534 const Eigen::Vector3f& to,
536 const DrawColor& color,
537 bool ignoreLengthScale)
541 const Eigen::Vector3f dir = (to - from);
542 const float length = dir.norm();
543 drawArrow(
id, from, dir / length, length, width, color, ignoreLengthScale);
552 topic->removeArrowVisu(layer(
id),
id.name);
558 const std::vector<Eigen::Vector3f>& points,
559 const DrawColor& colorFace,
561 const DrawColor& colorEdge,
562 bool ignoreLengthScale)
566 const float scale = lengthScale(ignoreLengthScale);
568 PolygonPointList polyPoints;
569 polyPoints.reserve(points.size());
571 for (
const auto& point : points)
573 polyPoints.push_back(scaled(scale, point));
576 topic->setPolygonVisu(layer(
id),
id.name, polyPoints, colorFace, colorEdge, lineWidth);
585 topic->removePolygonVisu(layer(
id),
id.name);
591 const Eigen::Vector3f& from,
592 const Eigen::Vector3f& to,
594 const DrawColor& color,
595 bool ignoreLengthScale)
599 const float scale = lengthScale(ignoreLengthScale);
602 layer(
id),
id.name, scaled(scale, from), scaled(scale, to), width, color);
611 topic->removeLineVisu(layer(
id),
id.name);
617 const DebugDrawerLineSet& lineSet,
618 bool ignoreLengthScale)
622 const float scale = lengthScale(ignoreLengthScale);
624 if (1.f <= scale && scale <= 1.f)
627 topic->setLineSetVisu(layer(
id),
id.name, lineSet);
632 DebugDrawerLineSet scaledLineSet = lineSet;
633 for (
auto& point : scaledLineSet.points)
635 scaleXYZ(scale, point);
637 topic->setLineSetVisu(layer(
id),
id.name, scaledLineSet);
644 const std::vector<Eigen::Vector3f>& points,
646 const DrawColor& color,
647 bool ignoreLengthScale)
651 const float scale = lengthScale(ignoreLengthScale);
653 DebugDrawerLineSet lineSet;
654 for (
const auto& point : points)
656 lineSet.points.push_back(scaledT<DebugDrawerPointCloudElement>(scale, point));
659 lineSet.lineWidth = width;
660 lineSet.colorNoIntensity = lineSet.colorFullIntensity = color;
661 lineSet.intensities.assign(points.size() / 2, 0.);
663 topic->setLineSetVisu(layer(
id),
id.name, lineSet);
669 const std::vector<Eigen::Vector3f>& points,
671 const DrawColor& colorA,
672 const DrawColor& colorB,
673 const std::vector<float>& intensitiesB,
674 bool ignoreLengthScale)
678 const float scale = lengthScale(ignoreLengthScale);
680 DebugDrawerLineSet lineSet;
681 for (
const auto& point : points)
683 lineSet.points.push_back(scaledT<DebugDrawerPointCloudElement>(scale, point));
686 lineSet.lineWidth = width;
687 lineSet.colorNoIntensity = colorA;
688 lineSet.colorFullIntensity = colorB;
689 lineSet.intensities = intensitiesB;
691 topic->setLineSetVisu(layer(
id),
id.name, lineSet);
700 topic->removeLineSetVisu(layer(
id),
id.name);
706 const Eigen::Matrix4f& pose,
707 bool ignoreLengthScale)
709 drawPose(
id, pose, _poseScale, ignoreLengthScale);
714 const Eigen::Vector3f& pos,
716 bool ignoreLengthScale)
718 drawPose(
id, ::math::Helpers::Pose(pos, ori), _poseScale, ignoreLengthScale);
723 const Eigen::Matrix4f& pose,
725 bool ignoreLengthScale)
729 const float lenghtScale = lengthScale(ignoreLengthScale);
731 if (scale >= 1 && scale <= 1)
733 topic->setPoseVisu(layer(
id),
id.name, scaled(lenghtScale, pose));
737 topic->setScaledPoseVisu(layer(
id),
id.name, scaled(lenghtScale, pose), scale);
744 const Eigen::Vector3f& pos,
747 bool ignoreLengthScale)
749 drawPose(
id, ::math::Helpers::Pose(pos, ori), scale, ignoreLengthScale);
757 topic->removePoseVisu(layer(
id),
id.name);
763 const std::string& robotFile,
764 const std::string& armarxProject,
769 topic->setRobotVisu(layer(
id),
id.name, robotFile, armarxProject, drawStyle);
775 const Eigen::Matrix4f& pose,
780 topic->updateRobotPose(layer(
id),
id.name, scaled(lengthScale(ignoreScale), pose));
786 const Eigen::Vector3f& pos,
795 const std::map<std::string, float>& config)
799 topic->updateRobotConfig(layer(
id),
id.name, config);
808 topic->updateRobotColor(layer(
id),
id.name, color);
814 const std::string& nodeName,
815 const DrawColor& color)
819 topic->updateRobotNodeColor(layer(
id),
id.name, nodeName, color);
828 topic->removeRobotVisu(layer(
id),
id.name);
834 const VirtualRobot::TriMeshModel& triMesh,
835 const DrawColor& color,
836 bool ignoreLengthScale)
843 const float scale = lengthScale(ignoreLengthScale);
845 DebugDrawerTriMesh dd;
846 dd.colors.push_back(color);
848 for (
const auto& vertex : triMesh.vertices)
850 auto scaled = vertex * scale;
851 dd.vertices.push_back({scaled.x(), scaled.y(), scaled.z()});
854 const std::size_t normalBase = dd.vertices.size();
855 for (
const auto& normal : triMesh.normals)
857 dd.vertices.push_back({normal.x(), normal.y(), normal.z()});
860 for (
const auto& face : triMesh.faces)
863 ddf.vertex1.vertexID =
static_cast<Ice::Int
>(face.id1);
864 ddf.vertex2.vertexID =
static_cast<Ice::Int
>(face.id2);
865 ddf.vertex3.vertexID =
static_cast<Ice::Int
>(face.id3);
867 ddf.vertex1.colorID = ddf.vertex2.colorID = ddf.vertex3.colorID = 0;
868 ddf.vertex1.normalID = ddf.vertex2.normalID = ddf.vertex3.normalID = -1;
870 bool validNormalIDs =
true;
871 for (
const auto&
id : {face.idNormal1, face.idNormal2, face.idNormal3})
873 validNormalIDs &=
id < triMesh.normals.size();
878 ddf.vertex1.normalID =
static_cast<Ice::Int
>(normalBase + face.idNormal1);
879 ddf.vertex2.normalID =
static_cast<Ice::Int
>(normalBase + face.idNormal2);
880 ddf.vertex3.normalID =
static_cast<Ice::Int
>(normalBase + face.idNormal3);
884 const Eigen::Vector3f& normal = face.normal;
885 ddf.normal = {normal.x(), normal.y(), normal.z()};
888 dd.faces.push_back(ddf);
891 topic->setTriMeshVisu(layer(
id),
id.name, dd);
896 const VirtualRobot::TriMeshModel& trimesh,
897 const DrawColor& colorFace,
899 const DrawColor& colorEdge,
900 bool ignoreLengthScale)
904 Eigen::Matrix4f::Identity(),
913 const VirtualRobot::TriMeshModel& trimesh,
914 const Eigen::Matrix4f& pose,
915 const DrawColor& colorFace,
917 const DrawColor& colorEdge,
918 bool ignoreLengthScale)
925 const float scale = lengthScale(ignoreLengthScale);
926 bool isIdentity = pose.isIdentity();
928 auto toVector3 = [&scale, &isIdentity, &pose](
const Eigen::Vector3f& v)
929 {
return scaled(scale, isIdentity ? v : ::math::Helpers::TransformPosition(pose, v)); };
934 for (std::size_t i = 0; i < trimesh.faces.size(); ++i)
936 const auto& face = trimesh.faces[i];
937 PolygonPointList points{toVector3(trimesh.vertices.at(face.id1)),
938 toVector3(trimesh.vertices.at(face.id2)),
939 toVector3(trimesh.vertices.at(face.id3))};
941 topic->setPolygonVisu(layer(
id),
942 id.name +
"_" + std::to_string(counter),
953 const VirtualRobot::TriMeshModel& trimesh,
954 const std::vector<DrawColor>& faceColorsInner,
956 const DrawColor& colorEdge,
957 bool ignoreLengthScale)
965 const float scale = lengthScale(ignoreLengthScale);
967 for (std::size_t i = 0; i < trimesh.faces.size(); ++i)
969 const auto& face = trimesh.faces[i];
970 PolygonPointList points{scaled(scale, trimesh.vertices[face.id1]),
971 scaled(scale, trimesh.vertices[face.id2]),
972 scaled(scale, trimesh.vertices[face.id3])};
974 topic->setPolygonVisu(layer(
id),
975 id.name +
"_" + std::to_string(i),
977 faceColorsInner.at(i),
985 const DebugDrawerPointCloud& pointCloud)
989 topic->setPointCloudVisu(
id.layer,
id.name, pointCloud);
995 const DebugDrawerColoredPointCloud& pointCloud)
999 topic->setColoredPointCloudVisu(
id.layer,
id.name, pointCloud);
1005 const DebugDrawer24BitColoredPointCloud& pointCloud)
1009 topic->set24BitColoredPointCloudVisu(
id.layer,
id.name, pointCloud);
1022 const Eigen::Vector3f& at,
1023 const Eigen::Vector3f& up,
1025 const DrawColor& color,
1026 bool ignoreLengthScale)
1033 Eigen::Vector3f seed = seed.UnitX();
1034 if (std::abs(up.dot(seed)) <= 1e-6f)
1036 seed = seed.UnitY();
1046 const float halfSize = size / 2;
1048 const Eigen::Vector3f a = halfSize * up.cross(seed).normalized();
1049 const Eigen::Vector3f b = halfSize * up.cross(a).normalized();
1051 std::vector<Eigen::Vector3f> points;
1052 points.push_back(at + a + b);
1053 points.push_back(at + a - b);
1054 points.push_back(at - a - b);
1055 points.push_back(at - a + b);
1057 drawPolygon(
id, points, color, ignoreLengthScale);
1061 DebugDrawerTopic::layer(
const std::string& passedLayer)
const
1063 return passedLayer.empty() ? _layer : passedLayer;
1067 DebugDrawerTopic::layer(
const VisuID&
id)
const
1069 return layer(
id.layer);
1073 DebugDrawerTopic::lengthScale(
bool ignore)
const
1075 return ignore ? 1 : _lengthScale;
1079 DebugDrawerTopic::scaled(
float scale,
float value)
1081 return scale *
value;
1085 DebugDrawerTopic::scaled(
float scale,
const Eigen::Vector3f& vector)
1087 if (scale >= 1 && scale <= 1)
1093 return new Vector3((vector * scale).eval());
1098 DebugDrawerTopic::scaled(
float scale,
const Eigen::Matrix4f& pose)
1100 if (scale >= 1 && scale <= 1)
1102 return new Pose(pose);
1106 Eigen::Matrix4f out = pose;
1107 ::math::Helpers::Position(out) *= scale;
1108 return new Pose(out);
1112 DebugDrawerTopic::operator bool()
const
1142 return simox::color::rgb_to_hsv(rgb);
1148 return simox::color::hsv_to_rgb(hsv);
void removeLine(const VisuID &id)
Remove a line.
void drawLine(const VisuID &id, const Eigen::Vector3f &from, const Eigen::Vector3f &to, float width, const DrawColor &color=DEFAULTS.colorLine, bool ignoreLengthScale=false)
Draw a line from start to end.
void updateRobotColor(const VisuID &id, const DrawColor &color)
Update / set the robot color.
void shortSleep()
Sleep for the shortSleepDuration. Useful after clearing.
static DrawColor getGlasbeyLUTColor(int id, float alpha=1.f)
Get a color from the Glasbey look-up-table.
void drawCylinderFromTo(const VisuID &id, const Eigen::Vector3f &from, const Eigen::Vector3f &to, float radius, const DrawColor &color=DEFAULTS.colorCylinder, bool ignoreLengthScale=false)
Draw a cylinder from start to end.
void setEnabled(bool enabled)
Set whether drawing is enabled.
const std::string & getLayer() const
Get the default layer (used if no layer is passed to a method).
float getLengthScale() const
Get the scaling for positions, lengths and distances.
DebugDrawerTopic(const std::string &layer=DEFAULT_LAYER)
Construct without topic, and optional layer.
void removeSphere(const VisuID &id)
Remove a sphere.
void drawPolygon(const VisuID &id, const std::vector< Eigen::Vector3f > &points, const DrawColor &colorFace, float lineWidth=0, const DrawColor &colorEdge=DEFAULTS.colorPolygonEdge, bool ignoreLengthScale=false)
Draw a polygon.
void removePolygon(const VisuID &id)
Remove a polygon.
void drawArrow(const VisuID &id, const Eigen::Vector3f &position, const Eigen::Vector3f &direction, float length, float width, const DrawColor &color=DEFAULTS.colorArrow, bool ignoreLengthScale=false)
Draw an arrow with position (start) and direction.
void sleepFor(const DurationT &duration)
If enabled, sleep for the given duration (e.g. a chrono duration).
void setLayer(const std::string &layer)
Set the default layer (used if no layer is passed to a method).
void setPoseScaleMeters()
Set the pose scale to 0.001 (good when drawing in meters).
void drawTriMeshAsPolygons(const VisuID &id, const VirtualRobot::TriMeshModel &trimesh, const DrawColor &colorFace=DEFAULTS.colorPolygonFace, float lineWidth=0, const DrawColor &colorEdge=DEFAULTS.colorPolygonEdge, bool ignoreLengthScale=false)
Draw a TriMeshModel as individual polygons.
void removeArrow(const VisuID &id)
Remove an arrow.
void drawFloor(const VisuID &id={"floor"}, const Eigen::Vector3f &at=Eigen::Vector3f::Zero(), const Eigen::Vector3f &up=Eigen::Vector3f::UnitZ(), float size=5, const DrawColor &color=DEFAULTS.colorFloor, bool ignoreLengthScale=false)
Draw a quad representing the floor.
void drawPointCloud(const VisuID &id, const PointCloudT &pointCloud, const DrawColor &color=DEFAULTS.colorPointCloud, float pointSize=DEFAULTS.pointCloudPointSize, bool ignoreLengthScale=false)
Draw a unicolored point cloud.
void removePose(const VisuID &id)
Remove a pose.
void clearLayer(bool sleep=false)
Clear the (set default) layer.
void updateRobotNodeColor(const VisuID &id, const std::string &nodeName, const DrawColor &color)
Update / set the color of a robot node.
void drawLineSet(const VisuID &id, const DebugDrawerLineSet &lineSet, bool ignoreLengthScale=false)
Draw a line set.
void drawArrowFromTo(const VisuID &id, const Eigen::Vector3f &from, const Eigen::Vector3f &to, float width, const DrawColor &color=DEFAULTS.colorArrow, bool ignoreLengthScale=false)
Draw an arrow with start and end.
void drawPose(const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreLengthScale=false)
Draw a pose (with the preset scale).
void drawSphere(const VisuID &id, const Eigen::Vector3f ¢er, float radius, const DrawColor &color=DEFAULTS.colorSphere, bool ignoreLengthScale=false)
Draw a sphere.
void drawCylinder(const VisuID &id, const Eigen::Vector3f ¢er, const Eigen::Vector3f &direction, float length, float radius, const DrawColor &color=DEFAULTS.colorCylinder, bool ignoreLengthScale=false)
Draw a cylinder with center and direction.
void setLengthScaleMetersToMillimeters()
Set the scale for positions, lengths and distances to 1000.
void setPoseScale(float scale)
Set the scale for pose visualization. This value will be used for all successive calls to drawPose().
void setPoseScaleMillimeters()
Set the pose scale to 1 (good when drawing in millimeters).
static const Defaults DEFAULTS
void removeboxEdges(const VisuID &id)
Remove box edges (as a line set).
DebugDrawerInterfacePrx getTopic() const
Get the topic.
void drawText(const VisuID &id, const Eigen::Vector3f &position, const std::string &text, int size=10, const DrawColor color=DEFAULTS.colorText, bool ignoreLengthScale=false)
Draw text at the specified position.
void removeBox(const VisuID &id)
Remove a box.
void drawBoxEdges(const VisuID &id, const Eigen::Vector3f &position, const Eigen::Quaternionf &orientation, const Eigen::Vector3f &extents, float width=DEFAULTS.boxEdgesWidth, const DrawColor &color=DEFAULTS.boxEdgesColor, bool ignoreLengthScale=false)
Draw box edges (as a line set).
void removeCylinder(const VisuID &id)
Remove a cylinder.
void setTopic(const DebugDrawerInterfacePrx &topic)
Set the topic.
void updateRobotPose(const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreScale=false)
Update / set the robot pose.
void removeLineSet(const VisuID &id)
Remove a line set.
void removeRobot(const VisuID &id)
Remove a robot visualization.
void clearColoredPointCloud(const VisuID &id)
Forces the "deletion" of a point cloud by drawing an empty one.
void clearAll(bool sleep=false)
Clear all layers.
void setLengthScale(float scale)
Set the scale for positions, lengths and distances.
static Eigen::Vector3f hsv2rgb(const Eigen::Vector3f &hsv)
Convert a HSV color RGB.
static Eigen::Vector3f rgb2hsv(const Eigen::Vector3f &rgb)
Convert a RGB color to HSV.
float getPoseScale() const
Get the scale for pose visualization.
void updateRobotConfig(const VisuID &id, const std::map< std::string, float > &config)
Update / set the robot configuration (joint angles).
DebugDrawerInterfacePrx & operator->()
Pointer member access operator to access the raw debug drawer proxy.
void drawRobot(const VisuID &id, const std::string &robotFile, const std::string &armarxProject, armarx::DrawStyle drawStyle=armarx::DrawStyle::FullModel)
Draw a robot.
bool enabled() const
Indicate whether visualization is enabled, i.e. a topic is set and enabled flag is set.
void drawTriMesh(const VisuID &id, const VirtualRobot::TriMeshModel &triMesh, const DrawColor &color={.5,.5,.5, 1}, bool ignoreLengthScale=false)
Draw a TriMeshModel as DebugDrawerTriMesh.
void drawBox(const VisuID &id, const Eigen::Vector3f &position, const Eigen::Quaternionf &orientation, const Eigen::Vector3f &extents, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false)
Draw a box.
void offeringTopic(ManagedIceObject &component, const std::string &topicNameOverride="") const
Call offeringTopic([topicName]) on the given component.
void setLengthScaleMillimetersToMeters()
Set the scale for positions, lengths and distances to 0.001.
static DrawColor at(std::size_t id, float alpha=1.f)
The ManagedIceObject is the base class for all ArmarX objects.
#define ARMARX_INFO
The normal logging level.
Quaternion< float, 0 > Quaternionf
Matrix< float, 3, 2 > Matrix32f
A 3x2 matrix.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::ostream & operator<<(std::ostream &os, const PythonApplicationManager::Paths &paths)
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
std::shared_ptr< Value > value()
Default values for drawing functions.
VisuID withName(const std::string &name) const
Get a VisuID with the given name and same layer as `*this.
std::string layer
The layer name (empty by default).
std::string name
The visu name (empty by default).
VisuID()
Empty constructor.