Skip to content

Commit

Permalink
Ignore vision measurements if less than two tags are detected
Browse files Browse the repository at this point in the history
Resolves #18
  • Loading branch information
spacey-sooty committed Jul 3, 2024
1 parent 00aaa77 commit ada0c7d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ public void periodic() {
new Translation3d(data[0], data[1], data[2]),
new Rotation3d(data[4], data[5], data[6]));

if (reasonablePose(m_botpose)) {
addVisionMeasurement(m_botpose.toPose2d(), frc.robot.Utils.now());
if ((int) data[7] < 2) {
if (reasonablePose(m_botpose)) {
addVisionMeasurement(m_botpose.toPose2d(), frc.robot.Utils.now());
}
}
}
}
Expand Down

0 comments on commit ada0c7d

Please sign in to comment.