diff --git a/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/bounding_box_3d_common.hpp b/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/bounding_box_3d_common.hpp index def2f25..d75aec0 100644 --- a/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/bounding_box_3d_common.hpp +++ b/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/bounding_box_3d_common.hpp @@ -107,6 +107,7 @@ class BoundingBox3DCommon : public rviz_common::RosTopicDisplay void showBoxes(const BoundingBox3DArray::ConstSharedPtr & msg) { edges_.clear(); + m_marker_common->clearMarkers(); for (size_t idx = 0U; idx < msg->boxes.size(); idx++) { const auto marker_ptr = get_marker(msg->boxes[idx]); @@ -125,6 +126,7 @@ class BoundingBox3DCommon : public rviz_common::RosTopicDisplay void showBoxes(const BoundingBox3D::ConstSharedPtr & msg) { edges_.clear(); + m_marker_common->clearMarkers(); const auto marker_ptr = get_marker(*msg); marker_ptr->header.frame_id = qPrintable(this->fixed_frame_); diff --git a/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/detection_3d_common.hpp b/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/detection_3d_common.hpp index 7f008c3..3016ca1 100644 --- a/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/detection_3d_common.hpp +++ b/vision_msgs_rviz_plugins/include/vision_msgs_rviz_plugins/detection_3d_common.hpp @@ -146,6 +146,7 @@ class Detection3DCommon : public rviz_common::RosTopicDisplay const bool show_score) { edges_.clear(); + m_marker_common->clearMarkers(); ClearScores(show_score); for (size_t idx = 0U; idx < msg->detections.size(); idx++) { @@ -181,6 +182,7 @@ class Detection3DCommon : public rviz_common::RosTopicDisplay void showBoxes(const vision_msgs::msg::Detection3D::ConstSharedPtr & msg, const bool show_score) { edges_.clear(); + m_marker_common->clearMarkers(); ClearScores(show_score); const auto marker_ptr = get_marker(msg->bbox);