Skip to content

Introduce Rate Feature to Motor Encoders#196

Merged
JIceberg merged 2 commits intodevfrom
feature-better-motor-vel
Nov 29, 2021
Merged

Introduce Rate Feature to Motor Encoders#196
JIceberg merged 2 commits intodevfrom
feature-better-motor-vel

Conversation

@JIceberg
Copy link
Copy Markdown
Member

Introduce Rate Feature to Motor Encoders

Please note that we accept pull requests from anyone, but that does not mean it will be merged.

What kind of change does this PR introduce?

  • Feature

This PR improves upon the motor velocity obtained from the built-in encoder class. The inversion meaning of the MotorGroup class has been changed to better suit these changes. Motor.Encoder now offers a getRate() method which returns the velocity of the encoder in units of distance per second, which is dependent on the defined distance per pulse. By default this is 1, so the output is typically in ticks per second.

Did this PR introduce a breaking change?

A breaking change includes anything that breaks backwards compatibility either at compile or run time.

  • Yes, please list breaking changes

The breaking changes are:

  • change in inversion scheme for MotorGroup
  • changes the output of getVelocities() in MotorGroup to use getRate by default

Some questions I have: should getRate() internally call getCorrectedVelocity instead of getVelocity or even getRawVelocity? Would love to hear your opinions on this.

Please make sure your PR satisfies the requirements of the contributing page

@JIceberg JIceberg added feature New feature or request hardware An addition that adds wrappers or new features to hardware improvement Improves current features in FTCLib labels Oct 20, 2021
@JIceberg
Copy link
Copy Markdown
Member Author

JIceberg commented Oct 20, 2021

The who and the what token now? What just failed..

Comment thread core/src/main/java/com/arcrobotics/ftclib/hardware/motors/Motor.java Outdated
Copy link
Copy Markdown
Contributor

@Lunerwalker2 Lunerwalker2 left a comment

Choose a reason for hiding this comment

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

Other than the one spelling issue, it looks good to me.

*Edit just saw your question in the PR description; I'm not really sure which one it should call, but if getCorrectedVelocity() doesn't return anything different even when there's no correction to do, then it should be fine to use it.

Copy link
Copy Markdown
Contributor

@JarnaChao09 JarnaChao09 left a comment

Choose a reason for hiding this comment

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

looks good to me, just fix the typo man cmon

I feel like it should either use corrected or raw, depending on if I'm interpreting the names right. I feel like raw would be the best bet as it is most accurate to the actual readings of the rate but again, not sure, have to look into that more

Comment thread core/src/main/java/com/arcrobotics/ftclib/hardware/motors/Motor.java Outdated
@JIceberg JIceberg merged commit 2632005 into dev Nov 29, 2021
@JIceberg JIceberg deleted the feature-better-motor-vel branch November 29, 2021 23:55
JIceberg added a commit that referenced this pull request Feb 21, 2022
* fix readme

* fix: contributing guidelines outdated errors

* update PR template

* Add Upgraded Motor Groups (#164)

* feat: upgraded motor groups

* fix: add stop motor when button is released

* fix: missing follower logic in set()

* change x on L106 to motor to be more descriptive

Co-authored-by: dansman805 <[email protected]>

* change x on L113 to motor to be more descriptive

Co-authored-by: dansman805 <[email protected]>

* feat: verbose comments on flywheel sample

* fix: change NotNull JB annotation to NonNull from androidx

* fix: missing comment for clearing the bulk cache in sample

Co-authored-by: Purav Datta <[email protected]>
Co-authored-by: dansman805 <[email protected]>

* add: new method to directly power mecanum drive wheels (#186)

* Update Mecanum Sample (#187)

* fix: mecanum sample to be readable and useful

* add: drawings and descriptions throughout sample

* fix: model of robot frame

* feat: update SDK dependencies

* fix: Bumped eocv to 1.5.0 and fixed openCameraDeviceAsync Impls (#193)

* fix: Bumped eocv to 1.5.0 and fixed breaking changes

* fix: Changed the vision release version to 2.0.0

* fix: Better error handling of camera opening

* fix: Surrounded the callback with the lock

* fix: issues with reset in RevIMU (#195)

* fix: issues with ramsete controller ending before command runs (#194)

* Min and Max flipped. Clarify AngleUnit type in parameter name (#201)

min and max arguments flipped on call to constructor. Consider renaming parameter to minDegree and maxDegree to clarify to caller that AngleUnit.DEGREES is assumed.

* Introduce Rate Feature to Motor Encoders (#196)

* feat: clean up motor group inversion and add encoder rate

* fix: typo in javadoc comment

* fix: set last state before current state (#204)

* Capstone Vision for 2021 Season (#200)

* Added capstone detector and pipeline

* Updated values on lines 119 and 117 of Capstone Detector

* Added setters to tune area of detection

* Released hierarchy Mat and now gives definition of contour

* Released all matrices and fully tested pipeline

Should be ready for release

* Vector2d Normalization (#205)

* fix: updated issue templates (#203)

* feat: modify README and dependencies for v2.0 release (#206)

Co-authored-by: Purav Datta <[email protected]>
Co-authored-by: dansman805 <[email protected]>
Co-authored-by: Lunerwalker2 <[email protected]>
Co-authored-by: Kevin Sheck <[email protected]>
Co-authored-by: Dolphin2Point1 <[email protected]>
Co-authored-by: Ethan Leitner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request hardware An addition that adds wrappers or new features to hardware improvement Improves current features in FTCLib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants