@@ -12,10 +12,8 @@ ArucoDetectorNode::ArucoDetectorNode(const rclcpp::NodeOptions& options)
1212 detect_board_ = this ->declare_parameter <bool >(" detect_board" );
1313 visualize_ = this ->declare_parameter <bool >(" visualize" );
1414 log_markers_ = this ->declare_parameter <bool >(" log_markers" );
15- publish_detections_ =
16- this ->declare_parameter <bool >(" publish_detections" );
17- publish_landmarks_ =
18- this ->declare_parameter <bool >(" publish_landmarks" );
15+ publish_detections_ = this ->declare_parameter <bool >(" publish_detections" );
16+ publish_landmarks_ = this ->declare_parameter <bool >(" publish_landmarks" );
1917
2018 this ->declare_parameter <float >(" aruco.marker_size" );
2119 this ->declare_parameter <std::string>(" aruco.dictionary" );
@@ -222,6 +220,12 @@ void ArucoDetectorNode::imageCallback(
222220 board_pose_cov.pose = pose_msg.pose ;
223221 std::fill (board_pose_cov.covariance .begin (),
224222 board_pose_cov.covariance .end (), 0.0 );
223+
224+ // Set covariance to identity
225+ for (int i = 0 ; i < 6 ; ++i) {
226+ board_pose_cov.covariance [i * 6 + i] = 1.0 ;
227+ }
228+
225229 board_landmark.pose = board_pose_cov;
226230
227231 landmark_array.landmarks .push_back (board_landmark);
@@ -271,6 +275,10 @@ void ArucoDetectorNode::imageCallback(
271275 geometry_msgs::msg::PoseWithCovariance pose_cov;
272276 pose_cov.pose = pose_msg.pose ;
273277 std::fill (pose_cov.covariance .begin (), pose_cov.covariance .end (), 0.0 );
278+ // Set covariance to identity
279+ for (int i = 0 ; i < 36 ; i += 7 ) {
280+ pose_cov.covariance [i] = 1.0 ;
281+ }
274282 landmark.pose = pose_cov;
275283 landmark_array.landmarks .push_back (landmark);
276284 }
0 commit comments