Skip to content

Commit

Permalink
Fix Limelight array indices (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Dec 19, 2024
1 parent bac2037 commit d421ab8
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ public void updateInputs(VisionIOInputs inputs) {
poseObservations.add(
new PoseObservation(
// Timestamp, based on server timestamp of publish and latency
rawSample.timestamp * 1.0e-6 - rawSample.value[7] * 1.0e-3,
rawSample.timestamp * 1.0e-6 - rawSample.value[6] * 1.0e-3,

// 3D pose estimate
parsePose(rawSample.value),

// Ambiguity, using only the first tag because ambiguity isn't applicable for multitag
rawSample.value.length >= 17 ? rawSample.value[16] : 0.0,
rawSample.value.length >= 18 ? rawSample.value[17] : 0.0,

// Tag count
(int) rawSample.value[8],
(int) rawSample.value[7],

// Average tag distance
rawSample.value[10],
rawSample.value[9],

// Observation type
PoseObservationType.MEGATAG_1));
Expand All @@ -109,7 +109,7 @@ public void updateInputs(VisionIOInputs inputs) {
poseObservations.add(
new PoseObservation(
// Timestamp, based on server timestamp of publish and latency
rawSample.timestamp * 1.0e-6 - rawSample.value[7] * 1.0e-3,
rawSample.timestamp * 1.0e-6 - rawSample.value[6] * 1.0e-3,

// 3D pose estimate
parsePose(rawSample.value),
Expand All @@ -118,10 +118,10 @@ public void updateInputs(VisionIOInputs inputs) {
0.0,

// Tag count
(int) rawSample.value[8],
(int) rawSample.value[7],

// Average tag distance
rawSample.value[10],
rawSample.value[9],

// Observation type
PoseObservationType.MEGATAG_2));
Expand Down

0 comments on commit d421ab8

Please sign in to comment.