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

Changed SysID methods to allow logging in custom units #7172

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Daniel1464
Copy link

Resolves #6285.

@Daniel1464 Daniel1464 requested a review from a team as a code owner October 7, 2024 00:52
@Daniel1464
Copy link
Author

/format

Comment on lines +64 to +66
* The value is recorded in volts by default;
* to change this, specify your target unit as a generic bound.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* The value is recorded in volts by default;
* to change this, specify your target unit as a generic bound.
*
* @tparam U The unit to log in. Defaults to volts.

Specifying a target unit as a generic bound doesn't make sense- First, generic bound is a Java term, while in C++ the closest equivalent would be constraint. Second, a generic bound would be specified by the method, not something specified at the call site. Also, I think we require documentation for template parameters anyways, so there isn't as much of a need for a separate description.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think instead of using a generic it makes more sense to just change the unit in the function signature eg for lengths units::length_unit auto which should alllow passing in any length

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe? Remember that the goal isn't to be able to pass in any type (which could be done already via implicit conversions), it's to output in any type. Logging in whatever unit is passed in is possible, but I'm not sure if that'd necessarily be what users expect.

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.

SysID MotorLog Overloads or Reworks
3 participants