Skip to content

Vector2d Normalization#205

Merged
JIceberg merged 2 commits intodevfrom
feat-vector2d-normalize
Feb 19, 2022
Merged

Vector2d Normalization#205
JIceberg merged 2 commits intodevfrom
feat-vector2d-normalize

Conversation

@litehed
Copy link
Copy Markdown
Member

@litehed litehed commented Feb 10, 2022

Pull Requests

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 adds a function to normalize vectors within Vector2d.

Did this PR introduce a breaking change?

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

  • No

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

@litehed litehed changed the title fix readme Vector2d Normalization Feb 10, 2022
Comment on lines +163 to +165
public Vector2d normalize(double value) {
return scale(value / magnitude());
}
Copy link
Copy Markdown
Member

@JIceberg JIceberg Feb 13, 2022

Choose a reason for hiding this comment

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

Why is the normalization happening with an input?
Normalization is typically defined as scaling all elements of the vector such that the dot product with itself is 1.
I think that the method should be

public Vector2d norm() {
  return scale(1 / magnitude());
}

Can you explain further as to why there is a parameter here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The parameter is so you can normalize to different vector lengths rather than just doing the unit vector.

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.

That's not normalization.

@JIceberg JIceberg requested review from a team, Jaiming724, JarnaChao09 and Lunerwalker2 and removed request for a team February 13, 2022 01:38
@JIceberg JIceberg merged commit f2b8acb into dev Feb 19, 2022
@JIceberg JIceberg deleted the feat-vector2d-normalize branch February 21, 2022 06:44
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants