|
| void | clearAll (bool sleep=false) |
| | Clear all layers.
|
| |
| void | clearColoredPointCloud (const VisuID &id) |
| | Forces the "deletion" of a point cloud by drawing an empty one.
|
| |
| void | clearLayer (bool sleep=false) |
| | Clear the (set default) layer.
|
| |
| void | clearLayer (const std::string &layer, bool sleep=false) |
| | Clear the given layer.
|
| |
| | DebugDrawerTopic (const DebugDrawerInterfacePrx &topic, const std::string &layer=DEFAULT_LAYER) |
| | Construct with given topic and optional layer.
|
| |
| | DebugDrawerTopic (const std::string &layer=DEFAULT_LAYER) |
| | Construct without topic, and optional layer.
|
| |
| 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 | 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 | drawBox (const VisuID &id, const Eigen::Matrix4f &pose, const Eigen::Vector3f &extents, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false) |
| | Draw a box.
|
| |
| 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 | drawBox (const VisuID &id, const VirtualRobot::BoundingBox &boundingBox, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false) |
| | Draw an axis aligned bounding box.
|
| |
| 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.
|
| |
| 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).
|
| |
| 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).
|
| |
| 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).
|
| |
| 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 | 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).
|
| |
| 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).
|
| |
| 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.
|
| |
| 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 | 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 | 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 | 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 | drawLineSet (const VisuID &id, const DebugDrawerLineSet &lineSet, bool ignoreLengthScale=false) |
| | Draw a line set.
|
| |
| 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.
|
| |
| 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.
|
| |
| void | drawPointCloud (const VisuID &id, const DebugDrawer24BitColoredPointCloud &pointCloud) |
| | Draw a 24 bit colored point cloud.
|
| |
| void | drawPointCloud (const VisuID &id, const DebugDrawerColoredPointCloud &pointCloud) |
| | Draw a colored point cloud.
|
| |
| void | drawPointCloud (const VisuID &id, const DebugDrawerPointCloud &pointCloud) |
| | Draw a non-colored point cloud.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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 | drawPose (const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreLengthScale=false) |
| | Draw a pose (with the preset scale).
|
| |
| void | drawPose (const VisuID &id, const Eigen::Matrix4f &pose, float scale, bool ignoreLengthScale=false) |
| | Draw a pose with the given scale.
|
| |
| void | drawPose (const VisuID &id, const Eigen::Vector3f &pos, const Eigen::Quaternionf &ori, bool ignoreLengthScale=false) |
| | Draw a pose (with the preset scale).
|
| |
| 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.
|
| |
| void | drawRobot (const VisuID &id, const std::string &robotFile, const std::string &armarxProject, armarx::DrawStyle drawStyle=armarx::DrawStyle::FullModel) |
| | Draw a robot.
|
| |
| void | drawSphere (const VisuID &id, const Eigen::Vector3f ¢er, float radius, const DrawColor &color=DEFAULTS.colorSphere, bool ignoreLengthScale=false) |
| | Draw a sphere.
|
| |
| 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 | drawTriMesh (const VisuID &id, const VirtualRobot::TriMeshModel &triMesh, const DrawColor &color={.5,.5,.5, 1}, bool ignoreLengthScale=false) |
| | Draw a TriMeshModel as DebugDrawerTriMesh.
|
| |
| 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 | 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.
|
| |
| 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.
|
| |
| bool | enabled () const |
| | Indicate whether visualization is enabled, i.e. a topic is set and enabled flag is set.
|
| |
| 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.
|
| |
| float | getPoseScale () const |
| | Get the scale for pose visualization.
|
| |
| DebugDrawerInterfacePrx | getTopic () const |
| | Get the topic.
|
| |
| void | getTopic (ManagedIceObject &component, const std::string &topicNameOverride="") |
| | Get the topic by calling getTopic([topicName]) on the given component.
|
| |
| void | offeringTopic (ManagedIceObject &component, const std::string &topicNameOverride="") const |
| | Call offeringTopic([topicName]) on the given component.
|
| |
| | operator bool () const |
| | Indicate whether visualization is enabled.
|
| |
| | operator const DebugDrawerInterfacePrx & () const |
| |
| | operator DebugDrawerInterfacePrx & () |
| | Conversion operator to DebugDrawerInterfacePrx.
|
| |
| DebugDrawerInterfacePrx & | operator-> () |
| | Pointer member access operator to access the raw debug drawer proxy.
|
| |
| const DebugDrawerInterfacePrx & | operator-> () const |
| |
| void | removeArrow (const VisuID &id) |
| | Remove an arrow.
|
| |
| void | removeBox (const VisuID &id) |
| | Remove a box.
|
| |
| void | removeboxEdges (const VisuID &id) |
| | Remove box edges (as a line set).
|
| |
| void | removeCylinder (const VisuID &id) |
| | Remove a cylinder.
|
| |
| void | removeLine (const VisuID &id) |
| | Remove a line.
|
| |
| void | removeLineSet (const VisuID &id) |
| | Remove a line set.
|
| |
| void | removePolygon (const VisuID &id) |
| | Remove a polygon.
|
| |
| void | removePose (const VisuID &id) |
| | Remove a pose.
|
| |
| void | removeRobot (const VisuID &id) |
| | Remove a robot visualization.
|
| |
| void | removeSphere (const VisuID &id) |
| | Remove a sphere.
|
| |
| void | setEnabled (bool enabled) |
| | Set whether drawing is enabled.
|
| |
| void | setLayer (const std::string &layer) |
| | Set the default layer (used if no layer is passed to a method).
|
| |
| void | setLengthScale (float scale) |
| | Set the scale for positions, lengths and distances.
|
| |
| void | setLengthScaleMetersToMillimeters () |
| | Set the scale for positions, lengths and distances to 1000.
|
| |
| void | setLengthScaleMillimetersToMeters () |
| | Set the scale for positions, lengths and distances to 0.001.
|
| |
| void | setPoseScale (float scale) |
| | Set the scale for pose visualization. This value will be used for all successive calls to drawPose().
|
| |
| void | setPoseScaleMeters () |
| | Set the pose scale to 0.001 (good when drawing in meters).
|
| |
| void | setPoseScaleMillimeters () |
| | Set the pose scale to 1 (good when drawing in millimeters).
|
| |
| template<typename DurationT> |
| void | setShortSleepDuration (const DurationT &duration) |
| | Set the duration for "short sleeps".
|
| |
| void | setTopic (const DebugDrawerInterfacePrx &topic) |
| | Set the topic.
|
| |
| void | shortSleep () |
| | Sleep for the shortSleepDuration. Useful after clearing.
|
| |
| template<typename DurationT> |
| void | sleepFor (const DurationT &duration) |
| | If enabled, sleep for the given duration (e.g. a chrono duration).
|
| |
| void | updateRobotColor (const VisuID &id, const DrawColor &color) |
| | Update / set the robot color.
|
| |
| void | updateRobotConfig (const VisuID &id, const std::map< std::string, float > &config) |
| | Update / set the robot configuration (joint angles).
|
| |
| void | updateRobotNodeColor (const VisuID &id, const std::string &nodeName, const DrawColor &color) |
| | Update / set the color of a robot node.
|
| |
| void | updateRobotPose (const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreScale=false) |
| | Update / set the robot pose.
|
| |
| void | updateRobotPose (const VisuID &id, const Eigen::Vector3f &pos, const Eigen::Quaternionf &ori, bool ignoreScale=false) |
| | Update / set the robot pose.
|
| |
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:
if (debugDrawer)
{
}
DebugDrawerTopic(const std::string &layer=DEFAULT_LAYER)
Construct without topic, and optional layer.
Definition DebugDrawerTopic.cpp:45
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.
- Initialisation by Offering and Getting Topic
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:
void offeringTopic(ManagedIceObject &component, const std::string &topicNameOverride="") const
Call offeringTopic([topicName]) on the given component.
Definition DebugDrawerTopic.cpp:80
In onConnectComponent() (or equivalent), call:
DebugDrawerInterfacePrx getTopic() const
Get the topic.
Definition DebugDrawerTopic.cpp:62
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.
- Scaling
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.
- Note
- Robots are always drawn in their native size (the
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.
- Argument Pattern
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:
Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();
std::string name = "pose";
void drawPose(const VisuID &id, const Eigen::Matrix4f &pose, bool ignoreLengthScale=false)
Draw a pose (with the preset scale).
Definition DebugDrawerTopic.cpp:705
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:
Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();
std::string layer = "layer";
std::string name = "pose";
debugDrawer.
drawPose({layer, name}, pose);
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.)
- See also
DebugDrawerTopic::VisuID