Skip to content

Commit

Permalink
Clear stale markers (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmm-slamcore authored Jul 26, 2023
1 parent a6d6777 commit 4ef5f0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class BoundingBox3DCommon : public rviz_common::RosTopicDisplay<MessageType>
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]);
Expand All @@ -125,6 +126,7 @@ class BoundingBox3DCommon : public rviz_common::RosTopicDisplay<MessageType>
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_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class Detection3DCommon : public rviz_common::RosTopicDisplay<MessageType>
const bool show_score)
{
edges_.clear();
m_marker_common->clearMarkers();
ClearScores(show_score);

for (size_t idx = 0U; idx < msg->detections.size(); idx++) {
Expand Down Expand Up @@ -181,6 +182,7 @@ class Detection3DCommon : public rviz_common::RosTopicDisplay<MessageType>
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);
Expand Down

0 comments on commit 4ef5f0f

Please sign in to comment.