-
Notifications
You must be signed in to change notification settings - Fork 100
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
How to use a base unit that's not predefined? #390
Comments
If anyone else is confused about how to use it, or if you base as an example on this, this is what I did for now. (I noticed I need a smaller length resolution, not a smaller time resolution, to get a better speed resolution, duh, so it's decimillimeters, not decimilliseconds as in my previous post.)
|
@Anaphory Did you end up resolving all your issues or did you still have some questions? Setting up new type aliases with different base units is definitely not intuitive and probably not easy to discover. Any concrete suggestions, especially about documentation, based on your experience? For anyone coming to this issue in the future, examples/base.rs, gives a minimal example of setting up type aliases with different base units. The ISQ! macro is also documented. |
Bumping this thread. I for one would like a clearer example of defining custom unit systems with nonstandard base units such as mm or ms to avoid the use of floating point numbers. Thanks in advance |
A link to |
It took me a while, reading documentation and experimenting, to define my system of units as
I feel it is not particularly well stated that this is the way to do it.
The target I am aiming for wants to resolve location in centimeters, so the underlying model should use millimeters to avoid too many rounding artefacts. The velocities go up to 300 km/h, so I would ideally want time resolutions of 10^-4 seconds. This would also mean that I could still store a full day in i32, which would be an advantage over just using microseconds.
But I don't see how I can set the resolution to 10^-4 seconds. What's the best way to do it, and could it also go into the documentation somehow?
The text was updated successfully, but these errors were encountered: