-
Notifications
You must be signed in to change notification settings - Fork 7
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
✨ Arbitrary pose derivatives & bugfixes #12
Conversation
Everything looks good code wise. I'm not totally sure that Pose derivatives look all good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
OK so some bad news and some good news: The bad news: This problem applies to more than just operators. It actually applied to any function which takes >1 quantity values of the same type (eg.min, max, ceil, floor, round, mod) The good news: The issue lies in the fact that the a single type parameter is used for the function parameters. Template instantiation requires types to be strictly equal, not just convertible, and so no implicit conversion can happen. This is pretty easy to solve: We take a different quantity type for each parameter. This fixes the issue, but allows these functions to be instantiated with all different quantity types. This still errors, but not as nicely, as the template must be instantiated first. I think the best course of action here is to create some kind of type convertible trait/concept to restrict the parameters. template<typename Q, typename... Quantities>
concept Isomorphic = ((std::convertible_to<Q, Quantities> && std::convertible_to<Quantities, Q>) && ...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all good to me!
Refactors
Pose
to be an abstract class allowing for arbitrary time derivatives. In doing so, also makes the template header only again. Additionally, fix issues with+
or-
operators between a named quantity type (IE theLength
class) and the equivalentQuantity
failing, while at the same time improving error messages when using mismatched types in either of those operations.