Skip to content

Conversation

@nycrat
Copy link
Member

@nycrat nycrat commented Dec 12, 2025

Description

Instead of the AngularVelocity and AngularAcceleration literally being an alias of Angle, this PR refactors them into child classes of Angle which has a few advantages:

  • As mentioned in the original issue, some methods of Angle do not make sense for AngularVelocity/Acceleration. So, we delete these methods in the child class to prevent their usage.
  • While debugging, I noticed there was a lot of incorrect usage of these three classes, for example, in er_force_simulator.cpp, there is a pair defined as std::pair<Vector, Angle> which is then passed to a function that uses std::pair<Vector, AngularVelocity>. These inaccuracies do not raise any error or warning with the original aliases, but now should enforce that there is a difference between the three classes.
  • In the future, we may want special functions for angle velocity or angle acceleration, so this should allow for that.

Testing Done

Ran thunderscope and the tests, everything seems to be fine.

Resolved Issues

resolves #3093

Length Justification and Key Files to Review

N/A

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

NOTE: I'm not sure if this is the best approach, it is possible to privately inherit from Angle and then avoid the delete statements so that may be cleaner instead. But it would be necessary to redefine inherited functions such as toRadians() that just calls the parent function.

Also I'm not sure exactly which methods should be included or not used by the angular velocity/acceleration classes. For example, does it really make sense to have a method half() to create an angular velocity of 180deg/s ?

@nycrat nycrat marked this pull request as draft December 12, 2025 10:14
@nycrat nycrat marked this pull request as ready for review December 12, 2025 10:22
@nycrat nycrat marked this pull request as draft December 12, 2025 20:43
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.

Add new AngularVelocity / Acceleration classes that wrap Angle class

1 participant