Skip to content

SNS - Wheel Encoder - #117

Open
TomLonergan03 wants to merge 11 commits into
masterfrom
sns-wheel_encoder
Open

SNS - Wheel Encoder#117
TomLonergan03 wants to merge 11 commits into
masterfrom
sns-wheel_encoder

Conversation

@TomLonergan03

@TomLonergan03 TomLonergan03 commented May 28, 2023

Copy link
Copy Markdown
Contributor

wheel encoder support

Comment on lines +26 to +28
if (voltage > kVoltageThreshold && previous_voltage_ < kVoltageThreshold) { count_++; }
previous_voltage_ = voltage;
return core::Result::kSuccess;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep getting a value over the thresh, at what point do we think the encoders aren't working. Ik nav pays a lot of attention to these so want to make sure we report any possible failure asap.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah these are our singular most accurate sensor I think. If these give faulty data, we'll only spot it if it's disagreeing with our other data but this data being unreliable could potentially leave us without a ground truth

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it depends on velocity. we can probably calculate a maximum high period before we stop trusting it based off of minimum velocity we expect to hold

return core::Result::kFailure;
}
const core::Float voltage = *optional_voltage;
if (voltage > kVoltageThreshold && previous_voltage_ < kVoltageThreshold) { count_++; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++count_

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix this, however can you remind me what the reason for this is

Comment on lines +26 to +28
if (voltage > kVoltageThreshold && previous_voltage_ < kVoltageThreshold) { count_++; }
previous_voltage_ = voltage;
return core::Result::kSuccess;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah these are our singular most accurate sensor I think. If these give faulty data, we'll only spot it if it's disagreeing with our other data but this data being unreliable could potentially leave us without a ground truth

@@ -0,0 +1,24 @@
#pragma once
#include <memory>
#include <optional>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <cstdint>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants