diff --git a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp index ef4c6d5a64a8a0dcc49ba960babc9c0c74848348..1a75392e053c3b162321270d2e07f1a13f5434fd 100644 --- a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp +++ b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp @@ -194,6 +194,15 @@ namespace armarx boundingBox.getMax() - boundingBox.getMin(), color, ignoreLengthScale); } + void DebugDrawerTopic::removeBox(const DebugDrawerTopic::VisuID& id) + { + if (enabled()) + { + topic->removeBoxVisu(layer(id), id.name); + } + } + + void DebugDrawerTopic::drawCylinder(const DebugDrawerTopic::VisuID& id, const Eigen::Vector3f& center, const Eigen::Vector3f& direction, float radius, float length, const DrawColor& color, bool ignoreLengthScale) @@ -228,6 +237,16 @@ namespace armarx } } + + void DebugDrawerTopic::removeCylinder(const DebugDrawerTopic::VisuID& id) + { + if (enabled()) + { + topic->removeCylinderVisu(layer(id), id.name); + } + } + + void DebugDrawerTopic::drawSphere( const DebugDrawerTopic::VisuID& id, const Eigen::Vector3f& center, float radius, @@ -242,6 +261,15 @@ namespace armarx } + void DebugDrawerTopic::removeSphere(const DebugDrawerTopic::VisuID& id) + { + if (enabled()) + { + topic->removeSphereVisu(layer(id), id.name); + } + } + + void DebugDrawerTopic::drawArrow( const VisuID& id, const Eigen::Vector3f& position, const Eigen::Vector3f& direction, float length, @@ -255,6 +283,7 @@ namespace armarx } } + void DebugDrawerTopic::drawArrowFromTo( const VisuID& id, const Eigen::Vector3f& from, const Eigen::Vector3f& to, @@ -268,6 +297,7 @@ namespace armarx } } + void DebugDrawerTopic::removeArrow(const DebugDrawerTopic::VisuID& id) { if (enabled()) @@ -299,6 +329,16 @@ namespace armarx } } + + void DebugDrawerTopic::removePolygon(const DebugDrawerTopic::VisuID& id) + { + if (enabled()) + { + topic->removePolygonVisu(layer(id), id.name); + } + } + + void DebugDrawerTopic::drawLine( const VisuID& id, const Eigen::Vector3f& from, const Eigen::Vector3f& to, float width, const DrawColor& color, bool ignoreLengthScale) @@ -312,6 +352,16 @@ namespace armarx } } + + void DebugDrawerTopic::removeLine(const DebugDrawerTopic::VisuID& id) + { + if (enabled()) + { + topic->removeLineVisu(layer(id), id.name); + } + } + + void DebugDrawerTopic::drawLineSet( const VisuID& id, const DebugDrawerLineSet& lineSet, bool ignoreLengthScale) { @@ -337,6 +387,7 @@ namespace armarx } } + void DebugDrawerTopic::drawLineSet( const VisuID& id, const std::vector<Eigen::Vector3f>& points, float width, const DrawColor& color, bool ignoreLengthScale) @@ -385,12 +436,22 @@ namespace armarx } + void DebugDrawerTopic::removeLineSet(const DebugDrawerTopic::VisuID& id) + { + if (enabled()) + { + topic->removeLineSetVisu(layer(id), id.name); + } + } + + void DebugDrawerTopic::drawPose( const VisuID& id, const Eigen::Matrix4f& pose, bool ignoreLengthScale) { drawPose(id, pose, _poseScale, ignoreLengthScale); } + void DebugDrawerTopic::drawPose( const VisuID& id, const Eigen::Vector3f& pos, const Eigen::Quaternionf& ori, @@ -399,6 +460,7 @@ namespace armarx drawPose(id, math::Helpers::Pose(pos, ori), _poseScale, ignoreLengthScale); } + void DebugDrawerTopic::drawPose( const VisuID& id, const Eigen::Matrix4f& pose, float scale, bool ignoreLengthScale) @@ -419,6 +481,7 @@ namespace armarx } + void DebugDrawerTopic::drawPose( const VisuID& id, const Eigen::Vector3f& pos, const Eigen::Quaternionf& ori, float scale, bool ignoreLengthScale) @@ -426,6 +489,7 @@ namespace armarx drawPose(id, math::Helpers::Pose(pos, ori), scale, ignoreLengthScale); } + void DebugDrawerTopic::removePose(const DebugDrawerTopic::VisuID& id) { if (enabled()) @@ -445,6 +509,7 @@ namespace armarx } } + void DebugDrawerTopic::updateRobotPose( const DebugDrawerTopic::VisuID& id, const Eigen::Matrix4f& pose, bool ignoreScale) @@ -455,6 +520,7 @@ namespace armarx } } + void DebugDrawerTopic::updateRobotPose( const DebugDrawerTopic::VisuID& id, const Eigen::Vector3f& pos, const Eigen::Quaternionf& ori, bool ignoreScale) @@ -462,6 +528,7 @@ namespace armarx updateRobotPose(id, math::Helpers::Pose(pos, ori), ignoreScale); } + void DebugDrawerTopic::updateRobotConfig( const DebugDrawerTopic::VisuID& id, const std::map<std::string, float>& config) { @@ -471,6 +538,7 @@ namespace armarx } } + void DebugDrawerTopic::updateRobotColor( const DebugDrawerTopic::VisuID& id, const DrawColor& color) { @@ -480,6 +548,7 @@ namespace armarx } } + void DebugDrawerTopic::updateRobotNodeColor( const DebugDrawerTopic::VisuID& id, const std::string& nodeName, const DrawColor& color) @@ -490,6 +559,7 @@ namespace armarx } } + void DebugDrawerTopic::removeRobot(const DebugDrawerTopic::VisuID& id) { if (enabled()) @@ -562,6 +632,7 @@ namespace armarx topic->setTriMeshVisu(layer(id), id.name, dd); } + void DebugDrawerTopic::drawTriMeshAsPolygons(const VisuID& id, const VirtualRobot::TriMeshModel& trimesh, const DrawColor& colorFace, float lineWidth, const DrawColor& colorEdge, @@ -571,6 +642,7 @@ namespace armarx colorFace, lineWidth, colorEdge, ignoreLengthScale); } + void DebugDrawerTopic::drawTriMeshAsPolygons(const VisuID& id, const VirtualRobot::TriMeshModel& trimesh, const Eigen::Matrix4f& pose, const DrawColor& colorFace, float lineWidth, const DrawColor& colorEdge, @@ -608,6 +680,7 @@ namespace armarx } } + void DebugDrawerTopic::drawTriMeshAsPolygons( const VisuID& id, const VirtualRobot::TriMeshModel& trimesh, diff --git a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h index b95de6d43258d5a34246a639f6735ea4ee1ee1b4..d77b4908094e30e3ebe1a5efba89aad6e2d9638c 100644 --- a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h +++ b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h @@ -320,6 +320,9 @@ namespace armarx const DrawColor& color = DEFAULTS.colorBox, bool ignoreLengthScale = false); + /// Remove a box. + void removeBox(const VisuID& id); + /** * @brief Draw a cylinder with center and direction. @@ -349,6 +352,9 @@ namespace armarx const DrawColor& color = DEFAULTS.colorCylinder, bool ignoreLengthScale = false); + /// Remove a cylinder. + void removeCylinder(const VisuID& id); + /// Draw a sphere. void drawSphere( @@ -357,6 +363,9 @@ namespace armarx const DrawColor& color = DEFAULTS.colorSphere, bool ignoreLengthScale = false); + /// Remove a sphere. + void removeSphere(const VisuID& id); + /// Draw an arrow with position (start) and direction. void drawArrow( @@ -384,6 +393,9 @@ namespace armarx float lineWidth = 0, const DrawColor& colorEdge = DEFAULTS.colorPolygonEdge, bool ignoreLengthScale = false); + /// Remove a polygon. + void removePolygon(const VisuID& id); + /// Draw a line from start to end. void drawLine( @@ -392,6 +404,9 @@ namespace armarx float width, const DrawColor& color = DEFAULTS.colorLine, bool ignoreLengthScale = false); + /// Remove a line. + void removeLine(const VisuID& id); + /// Draw a line set. void drawLineSet( @@ -421,6 +436,9 @@ namespace armarx const std::vector<float>& intensitiesB, bool ignoreLengthScale = false); + /// Remove a line set. + void removeLineSet(const VisuID& id); + // POSE @@ -439,7 +457,7 @@ namespace armarx float scale, bool ignoreLengthScale = false); - /// Remove a pose visualization. + /// Remove a pose. void removePose(const VisuID& id);