Skip to content

Commit

Permalink
aruco_map: fix publishing detected markers count
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Aug 1, 2023
1 parent 2f8915c commit 7b591d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aruco_pose/src/aruco_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,16 @@ class ArucoMap : public nodelet::Nodelet {

if (put_markers_count_to_covariance_) {
// HACK: pass markers count using covariance field
pose_.pose.covariance[0] = markers->markers.size();
int valid_markers = 0;
for (auto const &marker : markers->markers) {
for (auto const &board_marker : board_->ids) {
if (board_marker == marker.id) {
valid_markers++;
break;
}
}
}
pose_.pose.covariance[0] = valid_markers;
}

if (known_vertical_.empty()) {
Expand Down

0 comments on commit 7b591d3

Please sign in to comment.