|
The DebugDrawerTopic
wraps a DebugDrawerInterfacePrx
and provides a more useful interface than the Ice interface.
More...
#include <RobotAPI/libraries/core/visualization/DebugDrawerTopic.h>
Classes | |
struct | Defaults |
Default values for drawing functions. More... | |
struct | VisuID |
A visualisation ID. More... | |
Public Member Functions | |
void | clearAll (bool sleep=false) |
Clear all layers. More... | |
void | clearColoredPointCloud (const VisuID &id) |
Forces the "deletion" of a point cloud by drawing an empty one. More... | |
void | clearLayer (bool sleep=false) |
Clear the (set default) layer. More... | |
void | clearLayer (const std::string &layer, bool sleep=false) |
Clear the given layer. More... | |
DebugDrawerTopic (const DebugDrawerInterfacePrx &topic, const std::string &layer=DEFAULT_LAYER) | |
Construct with given topic and optional layer. More... | |
DebugDrawerTopic (const std::string &layer=DEFAULT_LAYER) | |
Construct without topic, and optional layer. More... | |
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. More... | |
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. More... | |
void | drawBox (const VisuID &id, const Eigen::Matrix4f &pose, const Eigen::Vector3f &extents, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false) |
Draw a box. More... | |
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. More... | |
void | drawBox (const VisuID &id, const VirtualRobot::BoundingBox &boundingBox, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false) |
Draw an axis aligned bounding box. More... | |
void | drawBox (const VisuID &id, const VirtualRobot::BoundingBox &boundingBox, const Eigen::Matrix4f &pose, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false) |
Draw a locally axis aligned bounding box, transformed by the given pose. More... | |
void | drawBoxEdges (const VisuID &id, const Eigen::Matrix32f &aabb, const Eigen::Matrix4f &pose, float width=DEFAULTS.boxEdgesWidth, const DrawColor &color=DEFAULTS.boxEdgesColor, bool ignoreLengthScale=false) |
Draw edges of a locally axis-aligned bounding box, transformed by the given pose (as a line set). More... | |
void | drawBoxEdges (const VisuID &id, const Eigen::Matrix32f &aabb, float width=DEFAULTS.boxEdgesWidth, const DrawColor &color=DEFAULTS.boxEdgesColor, bool ignoreLengthScale=false) |
Draw edges of an axis aligned bounding box (as a line set). More... | |
void | drawBoxEdges (const VisuID &id, const Eigen::Matrix4f &pose, const Eigen::Vector3f &extents, float width=DEFAULTS.boxEdgesWidth, const DrawColor &color=DEFAULTS.boxEdgesColor, bool ignoreLengthScale=false) |
Draw box edges (as a line set). More... | |
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). More... | |
void | drawBoxEdges (const VisuID &id, const VirtualRobot::BoundingBox &boundingBox, const Eigen::Matrix4f &pose, float width=DEFAULTS.boxEdgesWidth, const DrawColor &color=DEFAULTS.boxEdgesColor, bool ignoreLengthScale=false) |
Draw edges of a locally axis-aligned bounding box, transformed by the given pose (as a line set). More... | |
void | drawBoxEdges (const VisuID &id, const VirtualRobot::BoundingBox &boundingBox, float width=DEFAULTS.boxEdgesWidth, const DrawColor &color=DEFAULTS.boxEdgesColor, bool ignoreLengthScale=false) |
Draw edges of an axis aligned bounding box (as a line set). More... | |
void | drawCylinder (const VisuID &id, const Eigen::Vector3f ¢er, const Eigen::Quaternionf &orientation, float length, float radius, const DrawColor &color=DEFAULTS.colorCylinder, bool ignoreLengthScale=false) |
Draw a cylinder with center and orientation. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | drawLineSet (const VisuID &id, const DebugDrawerLineSet &lineSet, bool ignoreLengthScale=false) |
Draw a line set. More... | |
void | drawLineSet (const VisuID &id, const std::vector< Eigen::Vector3f > &points, float width, const DrawColor &color=DEFAULTS.colorLine, bool ignoreLengthScale=false) |
Draw a set of lines with constant color. More... | |
void | drawLineSet (const VisuID &id, const std::vector< Eigen::Vector3f > &points, float width, const DrawColor &colorA, const DrawColor &colorB, const std::vector< float > &intensitiesB, bool ignoreLengthScale=false) |
Draw a set of lines with constant color. More... | |
void | drawPointCloud (const VisuID &id, const DebugDrawer24BitColoredPointCloud &pointCloud) |
Draw a 24 bit colored point cloud. More... | |
void | drawPointCloud (const VisuID &id, const DebugDrawerColoredPointCloud &pointCloud) |
Draw a colored point cloud. More... | |
void | drawPointCloud (const VisuID &id, const DebugDrawerPointCloud &pointCloud) |
Draw a non-colored point cloud. More... | |
template<class PointCloudT , class ColorFuncT > | |
void | drawPointCloud (const VisuID &id, const PointCloudT &pointCloud, const ColorFuncT &colorFunc, float pointSize=DEFAULTS.pointCloudPointSize, bool ignoreLengthScale=false) |
Draw a colored point cloud with custom colors. More... | |
template<class PointCloudT > | |
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. More... | |
template<class PointCloudT > | |
void | drawPointCloudLabeled (const VisuID &id, const PointCloudT &pointCloud, float pointSize=DEFAULTS.pointCloudPointSize, bool ignoreLengthScale=false) |
Draw a colored point cloud with colors according to labels. More... | |
template<class PointCloudT > | |
void | drawPointCloudRGBA (const VisuID &id, const PointCloudT &pointCloud, float pointSize=DEFAULTS.pointCloudPointSize, bool ignoreLengthScale=false) |
Draw a colored point cloud with RGBA information. More... | |
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. More... | |
void | drawPose (const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreLengthScale=false) |
Draw a pose (with the preset scale). More... | |
void | drawPose (const VisuID &id, const Eigen::Matrix4f &pose, float scale, bool ignoreLengthScale=false) |
Draw a pose with the given scale. More... | |
void | drawPose (const VisuID &id, const Eigen::Vector3f &pos, const Eigen::Quaternionf &ori, bool ignoreLengthScale=false) |
Draw a pose (with the preset scale). More... | |
void | drawPose (const VisuID &id, const Eigen::Vector3f &pos, const Eigen::Quaternionf &ori, float scale, bool ignoreLengthScale=false) |
Draw a pose with the given scale. More... | |
void | drawRobot (const VisuID &id, const std::string &robotFile, const std::string &armarxProject, armarx::DrawStyle drawStyle=armarx::DrawStyle::FullModel) |
Draw a robot. More... | |
void | drawSphere (const VisuID &id, const Eigen::Vector3f ¢er, float radius, const DrawColor &color=DEFAULTS.colorSphere, bool ignoreLengthScale=false) |
Draw a sphere. More... | |
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. More... | |
void | drawTriMesh (const VisuID &id, const VirtualRobot::TriMeshModel &triMesh, const DrawColor &color={.5,.5,.5, 1}, bool ignoreLengthScale=false) |
Draw a TriMeshModel as DebugDrawerTriMesh. More... | |
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. More... | |
void | drawTriMeshAsPolygons (const VisuID &id, const VirtualRobot::TriMeshModel &trimesh, const Eigen::Matrix4f &pose, const DrawColor &colorFace=DEFAULTS.colorPolygonFace, float lineWidth=0, const DrawColor &colorEdge=DEFAULTS.colorPolygonEdge, bool ignoreLengthScale=false) |
Draw a TriMeshModel as individual polygons, transformed by the given pose. More... | |
void | drawTriMeshAsPolygons (const VisuID &id, const VirtualRobot::TriMeshModel &trimesh, const std::vector< DrawColor > &faceColorsInner, float lineWidth=0, const DrawColor &colorEdge=DEFAULTS.colorPolygonEdge, bool ignoreLengthScale=false) |
Draw a TriMeshModel as individual polygons with individual face colors. More... | |
bool | enabled () const |
Indicate whether visualization is enabled, i.e. a topic is set and enabled flag is set. More... | |
const std::string & | getLayer () const |
Get the default layer (used if no layer is passed to a method). More... | |
float | getLengthScale () const |
Get the scaling for positions, lengths and distances. More... | |
float | getPoseScale () const |
Get the scale for pose visualization. More... | |
DebugDrawerInterfacePrx | getTopic () const |
Get the topic. More... | |
void | getTopic (ManagedIceObject &component, const std::string &topicNameOverride="") |
Get the topic by calling getTopic([topicName]) on the given component. More... | |
void | offeringTopic (ManagedIceObject &component, const std::string &topicNameOverride="") const |
Call offeringTopic([topicName]) on the given component. More... | |
operator bool () const | |
Indicate whether visualization is enabled. More... | |
operator const DebugDrawerInterfacePrx & () const | |
operator DebugDrawerInterfacePrx & () | |
Conversion operator to DebugDrawerInterfacePrx. More... | |
DebugDrawerInterfacePrx & | operator-> () |
Pointer member access operator to access the raw debug drawer proxy. More... | |
const DebugDrawerInterfacePrx & | operator-> () const |
void | removeArrow (const VisuID &id) |
Remove an arrow. More... | |
void | removeBox (const VisuID &id) |
Remove a box. More... | |
void | removeboxEdges (const VisuID &id) |
Remove box edges (as a line set). More... | |
void | removeCylinder (const VisuID &id) |
Remove a cylinder. More... | |
void | removeLine (const VisuID &id) |
Remove a line. More... | |
void | removeLineSet (const VisuID &id) |
Remove a line set. More... | |
void | removePolygon (const VisuID &id) |
Remove a polygon. More... | |
void | removePose (const VisuID &id) |
Remove a pose. More... | |
void | removeRobot (const VisuID &id) |
Remove a robot visualization. More... | |
void | removeSphere (const VisuID &id) |
Remove a sphere. More... | |
void | setEnabled (bool enabled) |
Set whether drawing is enabled. More... | |
void | setLayer (const std::string &layer) |
Set the default layer (used if no layer is passed to a method). More... | |
void | setLengthScale (float scale) |
Set the scale for positions, lengths and distances. More... | |
void | setLengthScaleMetersToMillimeters () |
Set the scale for positions, lengths and distances to 1000. More... | |
void | setLengthScaleMillimetersToMeters () |
Set the scale for positions, lengths and distances to 0.001. More... | |
void | setPoseScale (float scale) |
Set the scale for pose visualization. More... | |
void | setPoseScaleMeters () |
Set the pose scale to 0.001 (good when drawing in meters). More... | |
void | setPoseScaleMillimeters () |
Set the pose scale to 1 (good when drawing in millimeters). More... | |
template<typename DurationT > | |
void | setShortSleepDuration (const DurationT &duration) |
Set the duration for "short sleeps". More... | |
void | setTopic (const DebugDrawerInterfacePrx &topic) |
Set the topic. More... | |
void | shortSleep () |
Sleep for the shortSleepDuration . Useful after clearing. More... | |
template<typename DurationT > | |
void | sleepFor (const DurationT &duration) |
If enabled, sleep for the given duration (e.g. a chrono duration). More... | |
void | updateRobotColor (const VisuID &id, const DrawColor &color) |
Update / set the robot color. More... | |
void | updateRobotConfig (const VisuID &id, const std::map< std::string, float > &config) |
Update / set the robot configuration (joint angles). More... | |
void | updateRobotNodeColor (const VisuID &id, const std::string &nodeName, const DrawColor &color) |
Update / set the color of a robot node. More... | |
void | updateRobotPose (const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreScale=false) |
Update / set the robot pose. More... | |
void | updateRobotPose (const VisuID &id, const Eigen::Vector3f &pos, const Eigen::Quaternionf &ori, bool ignoreScale=false) |
Update / set the robot pose. More... | |
Static Public Member Functions | |
static DrawColor | getGlasbeyLUTColor (int id, float alpha=1.f) |
Get a color from the Glasbey look-up-table. More... | |
static DrawColor | getGlasbeyLUTColor (std::size_t id, float alpha=1.f) |
static DrawColor | getGlasbeyLUTColor (uint32_t id, float alpha=1.f) |
static Eigen::Vector3f | hsv2rgb (const Eigen::Vector3f &hsv) |
Convert a HSV color RGB. More... | |
static Eigen::Vector3f | rgb2hsv (const Eigen::Vector3f &rgb) |
Convert a RGB color to HSV. More... | |
template<class ColorT > | |
static DrawColor | toDrawColor (const ColorT &color, float alpha=1, bool byteToFloat=false) |
Construct a DrawColor from the given color type. More... | |
Static Public Attributes | |
static const Defaults | DEFAULTS = {} |
The DebugDrawerTopic
wraps a DebugDrawerInterfacePrx
and provides a more useful interface than the Ice interface.
The methods by DebugDrawerTopic
take "raw" types, such as Eigen or PCL types, and take care of conversion to Ice variants or data structures. In addition, this class provides useful overloads for different use cases.
Drawing is enabled if the internal topic proxy is set and an optional enabled flag is set (true by default). All methods check whether drawing is enabled and do nothing if drawing is disabled. To disable visualization by this class completely, use setEnabled(true/false)
or just do not set the topic. To check whether visualization is enabled, use enabled()
or just convert *this
to bool:
The DebugDrawerTopic
allows to set a layer on constructor or via setLayer()
. This layer will be used if none is passed to a drawing method. If no layer is passed or set, DebugDrawerTopic::DEFAULT_LAYER
is used.
A DebugDrawerTopic
needs an underlying DebugDrawerInterfacePrx
topic proxy. This proxy can be passed on construction or set via setTopic()
. In a component (or any other ManagedIceObject
), DebugDrawerTopic
provides convenience functions to register and fetch the topics.
In onInitComponent()
(or equivalent method), call:
In onConnectComponent()
(or equivalent), call:
where *this
is a ManagedIceObject
.
This will call this->offeringTopic("...")
and this->getTopic("...")
with the correct topic name (DebugDrawerTopic::TOPIC_NAME
) and enable the DebugDrawerTopic
.
DebugDrawerTopic
supports length scaling and pose scaling.
If a length scale is set, all visualizations will be scaled up or down by this value. This scaling affects positions, sizes / extents, and distances / lengths. This is useful when drawing quantities of different sources using different scalings (such as meters vs millimeters). Length scale can be set via setPoseScale()
or the short hands setPoseScaleMetersToMillimeters()
and setPoseScaleMillimetersToMeters()
.
All applicable methods offer a final argument called ignoreLengthScaling
(false by default, expect for robots, see below), which can be set to true to ignore the set length scale for this method call.
DebugDrawerInterface
offers no size scaling for robots). (That is, robots are drawn in millimeters most of the time.)In addition, this class allows to set a pose scale, which will be used for all drawn poses (if no other value is passed to drawPose()). This is useful when working with geometries scaled in meters, in which case a pose scale of 0.001 can be used.
All drawing methods take a VisuID
as first argument, which specifies the name of the visualization and the layer to draw on. There are different ways to specify the first argument. For example, to specify a only the name for a pose, pass just the name:
This will draw a pose on the preset layer (i.e. the layer passed to the constructor or set via setLayer()
, or "debug" by default). To specify both name and layer of a single visualization, pass both in an initializer list:
After the VisuID, usually the essential geometric parameters follow, (e.g. position, size, length, point list, ...), depending on the type of visualization. Finally, decorative parameters like colors and width can be passed. Most of the time, they have sensible default values and can be omitted for quick-and-dirty drawing.
(Added methods should adhere to this pattern.)
DebugDrawerTopic::VisuID
Definition at line 152 of file DebugDrawerTopic.h.
DebugDrawerTopic | ( | const std::string & | layer = DEFAULT_LAYER | ) |
Construct without topic, and optional layer.
Definition at line 44 of file DebugDrawerTopic.cpp.
DebugDrawerTopic | ( | const DebugDrawerInterfacePrx & | topic, |
const std::string & | layer = DEFAULT_LAYER |
||
) |
Construct with given topic and optional layer.
Definition at line 48 of file DebugDrawerTopic.cpp.
void clearAll | ( | bool | sleep = false | ) |
Clear all layers.
sleep | If true, do a short sleep clearing. |
Definition at line 138 of file DebugDrawerTopic.cpp.
void clearColoredPointCloud | ( | const VisuID & | id | ) |
Forces the "deletion" of a point cloud by drawing an empty one.
Definition at line 881 of file DebugDrawerTopic.cpp.
void clearLayer | ( | bool | sleep = false | ) |
Clear the (set default) layer.
sleep | If true, do a short sleep clearing. |
Definition at line 150 of file DebugDrawerTopic.cpp.
void clearLayer | ( | const std::string & | layer, |
bool | sleep = false |
||
) |
Clear the given layer.
sleep | If true, do a short sleep clearing. |
Definition at line 155 of file DebugDrawerTopic.cpp.
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.
Definition at line 411 of file DebugDrawerTopic.cpp.
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.
Definition at line 425 of file DebugDrawerTopic.cpp.
void drawBox | ( | const VisuID & | id, |
const Eigen::Matrix4f & | pose, | ||
const Eigen::Vector3f & | extents, | ||
const DrawColor & | color = DEFAULTS.colorBox , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a box.
Definition at line 193 of file DebugDrawerTopic.cpp.
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.
Definition at line 179 of file DebugDrawerTopic.cpp.
void drawBox | ( | const VisuID & | id, |
const VirtualRobot::BoundingBox & | boundingBox, | ||
const DrawColor & | color = DEFAULTS.colorBox , |
||
bool | ignoreLengthScale = false |
||
) |
Draw an axis aligned bounding box.
Definition at line 200 of file DebugDrawerTopic.cpp.
void drawBox | ( | const VisuID & | id, |
const VirtualRobot::BoundingBox & | boundingBox, | ||
const Eigen::Matrix4f & | pose, | ||
const DrawColor & | color = DEFAULTS.colorBox , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a locally axis aligned bounding box, transformed by the given pose.
Definition at line 206 of file DebugDrawerTopic.cpp.
void drawBoxEdges | ( | const VisuID & | id, |
const Eigen::Matrix32f & | aabb, | ||
const Eigen::Matrix4f & | pose, | ||
float | width = DEFAULTS.boxEdgesWidth , |
||
const DrawColor & | color = DEFAULTS.boxEdgesColor , |
||
bool | ignoreLengthScale = false |
||
) |
Draw edges of a locally axis-aligned bounding box, transformed by the given pose (as a line set).
Definition at line 322 of file DebugDrawerTopic.cpp.
void drawBoxEdges | ( | const VisuID & | id, |
const Eigen::Matrix32f & | aabb, | ||
float | width = DEFAULTS.boxEdgesWidth , |
||
const DrawColor & | color = DEFAULTS.boxEdgesColor , |
||
bool | ignoreLengthScale = false |
||
) |
Draw edges of an axis aligned bounding box (as a line set).
Definition at line 302 of file DebugDrawerTopic.cpp.
void drawBoxEdges | ( | const VisuID & | id, |
const Eigen::Matrix4f & | pose, | ||
const Eigen::Vector3f & | extents, | ||
float | width = DEFAULTS.boxEdgesWidth , |
||
const DrawColor & | color = DEFAULTS.boxEdgesColor , |
||
bool | ignoreLengthScale = false |
||
) |
Draw box edges (as a line set).
Definition at line 234 of file DebugDrawerTopic.cpp.
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).
Definition at line 225 of file DebugDrawerTopic.cpp.
void drawBoxEdges | ( | const VisuID & | id, |
const VirtualRobot::BoundingBox & | boundingBox, | ||
const Eigen::Matrix4f & | pose, | ||
float | width = DEFAULTS.boxEdgesWidth , |
||
const DrawColor & | color = DEFAULTS.boxEdgesColor , |
||
bool | ignoreLengthScale = false |
||
) |
Draw edges of a locally axis-aligned bounding box, transformed by the given pose (as a line set).
Definition at line 309 of file DebugDrawerTopic.cpp.
void drawBoxEdges | ( | const VisuID & | id, |
const VirtualRobot::BoundingBox & | boundingBox, | ||
float | width = DEFAULTS.boxEdgesWidth , |
||
const DrawColor & | color = DEFAULTS.boxEdgesColor , |
||
bool | ignoreLengthScale = false |
||
) |
Draw edges of an axis aligned bounding box (as a line set).
Definition at line 295 of file DebugDrawerTopic.cpp.
void drawCylinder | ( | const VisuID & | id, |
const Eigen::Vector3f & | center, | ||
const Eigen::Quaternionf & | orientation, | ||
float | length, | ||
float | radius, | ||
const DrawColor & | color = DEFAULTS.colorCylinder , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a cylinder with center and orientation.
An identity orientation represents a cylinder with an axis aligned to the Y-axis.
length | The full length (not half-length). |
Definition at line 355 of file DebugDrawerTopic.cpp.
void drawCylinder | ( | const VisuID & | id, |
const Eigen::Vector3f & | center, | ||
const Eigen::Vector3f & | direction, | ||
float | length, | ||
float | radius, | ||
const DrawColor & | color = DEFAULTS.colorCylinder , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a cylinder with center and direction.
length | The full length (not half-length). |
Definition at line 341 of file DebugDrawerTopic.cpp.
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.
Definition at line 365 of file DebugDrawerTopic.cpp.
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.
at | the quad'S center |
up | the up direction (normal of the floor plane) |
size | the quad's edge length |
Definition at line 887 of file DebugDrawerTopic.cpp.
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.
Definition at line 480 of file DebugDrawerTopic.cpp.
void drawLineSet | ( | const VisuID & | id, |
const DebugDrawerLineSet & | lineSet, | ||
bool | ignoreLengthScale = false |
||
) |
Draw a line set.
Definition at line 503 of file DebugDrawerTopic.cpp.
void drawLineSet | ( | const VisuID & | id, |
const std::vector< Eigen::Vector3f > & | points, | ||
float | width, | ||
const DrawColor & | color = DEFAULTS.colorLine , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a set of lines with constant color.
points | List of start and end points [ s1, e1, s2, e2, ..., sn, en ]. |
Definition at line 529 of file DebugDrawerTopic.cpp.
void drawLineSet | ( | const VisuID & | id, |
const std::vector< Eigen::Vector3f > & | points, | ||
float | width, | ||
const DrawColor & | colorA, | ||
const DrawColor & | colorB, | ||
const std::vector< float > & | intensitiesB, | ||
bool | ignoreLengthScale = false |
||
) |
Draw a set of lines with constant color.
points | List of start and end points [ s1, e1, s2, e2, ..., sn, en ]. |
colors | List of line colors [ c1, c2, ..., cn ]. |
Definition at line 552 of file DebugDrawerTopic.cpp.
void drawPointCloud | ( | const VisuID & | id, |
const DebugDrawer24BitColoredPointCloud & | pointCloud | ||
) |
Draw a 24 bit colored point cloud.
Definition at line 871 of file DebugDrawerTopic.cpp.
void drawPointCloud | ( | const VisuID & | id, |
const DebugDrawerColoredPointCloud & | pointCloud | ||
) |
Draw a colored point cloud.
Definition at line 861 of file DebugDrawerTopic.cpp.
void drawPointCloud | ( | const VisuID & | id, |
const DebugDrawerPointCloud & | pointCloud | ||
) |
Draw a non-colored point cloud.
Definition at line 851 of file DebugDrawerTopic.cpp.
void drawPointCloud | ( | const VisuID & | id, |
const PointCloudT & | pointCloud, | ||
const ColorFuncT & | colorFunc, | ||
float | pointSize = DEFAULTS.pointCloudPointSize , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a colored point cloud with custom colors.
pointCloud
must be iterable and its elements must provide members x, y, z
. The color of a point is specified by colorFunc
, which must be a callable taking an element of pointCloud
and returning its color as armarx::DrawColor
.
Definition at line 892 of file DebugDrawerTopic.h.
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.
pointCloud
must be iterable and its elements must provide members x, y, z
.
Definition at line 849 of file DebugDrawerTopic.h.
void drawPointCloudLabeled | ( | const VisuID & | id, |
const PointCloudT & | pointCloud, | ||
float | pointSize = DEFAULTS.pointCloudPointSize , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a colored point cloud with colors according to labels.
pointCloud
must be iterable and its elements must provide members x, y, z, label
.
Definition at line 878 of file DebugDrawerTopic.h.
void drawPointCloudRGBA | ( | const VisuID & | id, |
const PointCloudT & | pointCloud, | ||
float | pointSize = DEFAULTS.pointCloudPointSize , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a colored point cloud with RGBA information.
pointCloud
must be iterable and its elements must provide members x, y, z, r, g, b, a
.
Definition at line 864 of file DebugDrawerTopic.h.
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.
Definition at line 448 of file DebugDrawerTopic.cpp.
void drawPose | ( | const VisuID & | id, |
const Eigen::Matrix4f & | pose, | ||
bool | ignoreLengthScale = false |
||
) |
Draw a pose (with the preset scale).
Definition at line 586 of file DebugDrawerTopic.cpp.
void drawPose | ( | const VisuID & | id, |
const Eigen::Matrix4f & | pose, | ||
float | scale, | ||
bool | ignoreLengthScale = false |
||
) |
Draw a pose with the given scale.
Definition at line 602 of file DebugDrawerTopic.cpp.
void drawPose | ( | const VisuID & | id, |
const Eigen::Vector3f & | pos, | ||
const Eigen::Quaternionf & | ori, | ||
bool | ignoreLengthScale = false |
||
) |
Draw a pose (with the preset scale).
Definition at line 593 of file DebugDrawerTopic.cpp.
void drawPose | ( | const VisuID & | id, |
const Eigen::Vector3f & | pos, | ||
const Eigen::Quaternionf & | ori, | ||
float | scale, | ||
bool | ignoreLengthScale = false |
||
) |
Draw a pose with the given scale.
Definition at line 623 of file DebugDrawerTopic.cpp.
void drawRobot | ( | const VisuID & | id, |
const std::string & | robotFile, | ||
const std::string & | armarxProject, | ||
armarx::DrawStyle | drawStyle = armarx::DrawStyle::FullModel |
||
) |
Draw a robot.
Afterwards, updateRobot*()
methods can be used with the same VisuID.
robotFile | The robot file. Either an absolute path, or a path relative to the data directory of the ArmarX project specified by armarxProject . |
armarxProject | The name of the ArmarX project keeping the robot model. |
drawStyle | The draw style (full or collision model). |
Definition at line 640 of file DebugDrawerTopic.cpp.
void drawSphere | ( | const VisuID & | id, |
const Eigen::Vector3f & | center, | ||
float | radius, | ||
const DrawColor & | color = DEFAULTS.colorSphere , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a sphere.
Definition at line 388 of file DebugDrawerTopic.cpp.
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.
size | the text size (in pixels, not affected by length scaling) |
Definition at line 167 of file DebugDrawerTopic.cpp.
void drawTriMesh | ( | const VisuID & | id, |
const VirtualRobot::TriMeshModel & | triMesh, | ||
const DrawColor & | color = {.5, .5, .5, 1} , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a TriMeshModel as DebugDrawerTriMesh.
Definition at line 710 of file DebugDrawerTopic.cpp.
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.
Definition at line 774 of file DebugDrawerTopic.cpp.
void drawTriMeshAsPolygons | ( | const VisuID & | id, |
const VirtualRobot::TriMeshModel & | trimesh, | ||
const Eigen::Matrix4f & | pose, | ||
const DrawColor & | colorFace = DEFAULTS.colorPolygonFace , |
||
float | lineWidth = 0 , |
||
const DrawColor & | colorEdge = DEFAULTS.colorPolygonEdge , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a TriMeshModel as individual polygons, transformed by the given pose.
Definition at line 784 of file DebugDrawerTopic.cpp.
void drawTriMeshAsPolygons | ( | const VisuID & | id, |
const VirtualRobot::TriMeshModel & | trimesh, | ||
const std::vector< DrawColor > & | faceColorsInner, | ||
float | lineWidth = 0 , |
||
const DrawColor & | colorEdge = DEFAULTS.colorPolygonEdge , |
||
bool | ignoreLengthScale = false |
||
) |
Draw a TriMeshModel as individual polygons with individual face colors.
Definition at line 822 of file DebugDrawerTopic.cpp.
bool enabled | ( | ) | const |
Indicate whether visualization is enabled, i.e. a topic is set and enabled flag is set.
Definition at line 68 of file DebugDrawerTopic.cpp.
|
static |
Get a color from the Glasbey look-up-table.
Definition at line 1008 of file DebugDrawerTopic.cpp.
|
static |
|
static |
const std::string & getLayer | ( | ) | const |
Get the default layer (used if no layer is passed to a method).
Definition at line 83 of file DebugDrawerTopic.cpp.
float getLengthScale | ( | ) | const |
Get the scaling for positions, lengths and distances.
Definition at line 93 of file DebugDrawerTopic.cpp.
float getPoseScale | ( | ) | const |
Get the scale for pose visualization.
Definition at line 113 of file DebugDrawerTopic.cpp.
DebugDrawerInterfacePrx getTopic | ( | ) | const |
Get the topic.
Definition at line 58 of file DebugDrawerTopic.cpp.
void getTopic | ( | ManagedIceObject & | component, |
const std::string & | topicNameOverride = "" |
||
) |
Get the topic by calling getTopic([topicName]) on the given component.
component | The component (*this when called from a component). |
topicNameOverride | Optional override for the topic name. If left empty (default), uses the standard topic name (see TOPIC_NAME ). |
Definition at line 78 of file DebugDrawerTopic.cpp.
|
static |
Convert a HSV color RGB.
HSV | color as [h, s, v] with h in [0 deg, 360 deg] and s, v in [0, 1]. |
Definition at line 1002 of file DebugDrawerTopic.cpp.
void offeringTopic | ( | ManagedIceObject & | component, |
const std::string & | topicNameOverride = "" |
||
) | const |
Call offeringTopic([topicName]) on the given component.
component | The component (*this when called from a component). |
topicNameOverride | Optional override for the topic name. If left empty (default), uses the standard topic name (see TOPIC_NAME ). |
Definition at line 73 of file DebugDrawerTopic.cpp.
operator bool | ( | ) | const |
Indicate whether visualization is enabled.
enabled()
Definition at line 972 of file DebugDrawerTopic.cpp.
operator const DebugDrawerInterfacePrx & | ( | ) | const |
Definition at line 982 of file DebugDrawerTopic.cpp.
operator DebugDrawerInterfacePrx & | ( | ) |
Conversion operator to DebugDrawerInterfacePrx.
Definition at line 977 of file DebugDrawerTopic.cpp.
const DebugDrawerInterfacePrx & operator-> | ( | ) |
Pointer member access operator to access the raw debug drawer proxy.
Definition at line 987 of file DebugDrawerTopic.cpp.
const DebugDrawerInterfacePrx& operator-> | ( | ) | const |
void removeArrow | ( | const VisuID & | id | ) |
Remove an arrow.
Definition at line 439 of file DebugDrawerTopic.cpp.
void removeBox | ( | const VisuID & | id | ) |
Remove a box.
Definition at line 217 of file DebugDrawerTopic.cpp.
void removeboxEdges | ( | const VisuID & | id | ) |
Remove box edges (as a line set).
Definition at line 335 of file DebugDrawerTopic.cpp.
void removeCylinder | ( | const VisuID & | id | ) |
Remove a cylinder.
Definition at line 379 of file DebugDrawerTopic.cpp.
void removeLine | ( | const VisuID & | id | ) |
Remove a line.
Definition at line 494 of file DebugDrawerTopic.cpp.
void removeLineSet | ( | const VisuID & | id | ) |
Remove a line set.
Definition at line 577 of file DebugDrawerTopic.cpp.
void removePolygon | ( | const VisuID & | id | ) |
Remove a polygon.
Definition at line 471 of file DebugDrawerTopic.cpp.
void removePose | ( | const VisuID & | id | ) |
Remove a pose.
Definition at line 631 of file DebugDrawerTopic.cpp.
void removeRobot | ( | const VisuID & | id | ) |
Remove a robot visualization.
Definition at line 701 of file DebugDrawerTopic.cpp.
void removeSphere | ( | const VisuID & | id | ) |
Remove a sphere.
Definition at line 402 of file DebugDrawerTopic.cpp.
|
static |
Convert a RGB color to HSV.
rgb | RGB color as [r, g, b] with r, g, b in [0, 1]. |
Definition at line 997 of file DebugDrawerTopic.cpp.
void setEnabled | ( | bool | enabled | ) |
Set whether drawing is enabled.
Visualization is only truly enabled if the topic is set.
Definition at line 63 of file DebugDrawerTopic.cpp.
void setLayer | ( | const std::string & | layer | ) |
Set the default layer (used if no layer is passed to a method).
Definition at line 88 of file DebugDrawerTopic.cpp.
void setLengthScale | ( | float | scale | ) |
Set the scale for positions, lengths and distances.
Definition at line 98 of file DebugDrawerTopic.cpp.
void setLengthScaleMetersToMillimeters | ( | ) |
Set the scale for positions, lengths and distances to 1000.
Definition at line 103 of file DebugDrawerTopic.cpp.
void setLengthScaleMillimetersToMeters | ( | ) |
Set the scale for positions, lengths and distances to 0.001.
Definition at line 108 of file DebugDrawerTopic.cpp.
void setPoseScale | ( | float | scale | ) |
Set the scale for pose visualization.
This value will be used for all successive calls to drawPose().
Definition at line 118 of file DebugDrawerTopic.cpp.
void setPoseScaleMeters | ( | ) |
Set the pose scale to 0.001 (good when drawing in meters).
Definition at line 123 of file DebugDrawerTopic.cpp.
void setPoseScaleMillimeters | ( | ) |
Set the pose scale to 1 (good when drawing in millimeters).
Definition at line 128 of file DebugDrawerTopic.cpp.
void setShortSleepDuration | ( | const DurationT & | duration | ) |
Set the duration for "short sleeps".
Definition at line 835 of file DebugDrawerTopic.h.
void setTopic | ( | const DebugDrawerInterfacePrx & | topic | ) |
Set the topic.
Definition at line 53 of file DebugDrawerTopic.cpp.
void shortSleep | ( | ) |
Sleep for the shortSleepDuration
. Useful after clearing.
Definition at line 133 of file DebugDrawerTopic.cpp.
void sleepFor | ( | const DurationT & | duration | ) |
If enabled, sleep for the given duration (e.g. a chrono duration).
Definition at line 826 of file DebugDrawerTopic.h.
|
static |
Construct a DrawColor from the given color type.
The used color type must have members named r
, g
and b
. Applicable types include:
alpha | the alpha (default: 1) |
byteToFloat | If true, scale from range [0, 255] to [0, 1] |
Definition at line 841 of file DebugDrawerTopic.h.
void updateRobotColor | ( | const VisuID & | id, |
const DrawColor & | color | ||
) |
Update / set the robot color.
Definition at line 680 of file DebugDrawerTopic.cpp.
Update / set the robot configuration (joint angles).
Definition at line 670 of file DebugDrawerTopic.cpp.
void updateRobotNodeColor | ( | const VisuID & | id, |
const std::string & | nodeName, | ||
const DrawColor & | color | ||
) |
Update / set the color of a robot node.
Definition at line 690 of file DebugDrawerTopic.cpp.
void updateRobotPose | ( | const VisuID & | id, |
const Eigen::Matrix4f & | pose, | ||
bool | ignoreScale = false |
||
) |
Update / set the robot pose.
Definition at line 651 of file DebugDrawerTopic.cpp.
void updateRobotPose | ( | const VisuID & | id, |
const Eigen::Vector3f & | pos, | ||
const Eigen::Quaternionf & | ori, | ||
bool | ignoreScale = false |
||
) |
Update / set the robot pose.
Definition at line 662 of file DebugDrawerTopic.cpp.
|
static |
Definition at line 232 of file DebugDrawerTopic.h.