Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected indices used to index observation data in limelight example #135

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void updateInputs(VisionIOInputs inputs) {
List<PoseObservation> poseObservations = new LinkedList<>();
for (var rawSample : megatag1Subscriber.readQueue()) {
if (rawSample.value.length == 0) continue;
for (int i = 10; i < rawSample.value.length; i += 7) {
for (int i = 11; i < rawSample.value.length; i += 7) {
tagIds.add((int) rawSample.value[i]);
}
poseObservations.add(
Expand All @@ -90,20 +90,20 @@ public void updateInputs(VisionIOInputs inputs) {
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));
}
for (var rawSample : megatag2Subscriber.readQueue()) {
if (rawSample.value.length == 0) continue;
for (int i = 10; i < rawSample.value.length; i += 7) {
for (int i = 11; i < rawSample.value.length; i += 7) {
tagIds.add((int) rawSample.value[i]);
}
poseObservations.add(
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
Loading