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

added setSensorValue to customEncoder #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NikhilSuresh24
Copy link
Member

did that ^. Also renamed resetViaOffset to setSensorValue

@@ -11,15 +11,21 @@
protected PIDSourceType pidSource;
protected double distancePerPulse;
protected boolean reverseDirection;
protected double offset ;
Copy link
Contributor

Choose a reason for hiding this comment

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

white space

custom/sensors/CANEncoder.java Show resolved Hide resolved
@Override
public int getSafely() throws InvalidSensorException {
return (int) Math.round(((double) (encoders[0].getSafely() - offset[0]) + (double) (encoders[1].getSafely() - offset[1])) / 2.0);
return (int) Math
.round(((double) (encoders[0].getSafely() - offset[0]) + (double) (encoders[1].getSafely() - offset[1])) / 2.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Set offsets inside the encoders

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.

2 participants