-
Notifications
You must be signed in to change notification settings - Fork 70
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
Definition of math::clock #436
Labels
Breaking change
Breaks API, ABI or behavior. Must target unstable version.
bug
Something isn't working
🏛️ ionic
Gazebo Ionic
Comments
2 tasks
it's probably better to encourage people to use @nkoenig you have touched this code in the past; does that seem reasonable? |
scpeters
added a commit
to gazebosim/gz-sim
that referenced
this issue
Jun 8, 2022
Part of gazebosim/gz-math#436. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
chapulina
pushed a commit
to gazebosim/gz-sim
that referenced
this issue
Jun 8, 2022
Part of gazebosim/gz-math#436. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
looks like some |
scpeters
added a commit
that referenced
this issue
Jul 1, 2024
Recommend using std::chrono::steady_clock directly instead of this alias. Part of #436. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters
added a commit
that referenced
this issue
Jul 1, 2024
Recommend using std::chrono::steady_clock directly instead of this alias. Fixes #436. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
deprecating math::clock in #600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Breaking change
Breaks API, ABI or behavior. Must target unstable version.
bug
Something isn't working
🏛️ ionic
Gazebo Ionic
Environment
Description
Expected behavior
Maybe it's just me, but I was surprised when I noticed that there's an
ignition::math::clock
class, defined here:gz-math/include/ignition/math/Stopwatch.hh
Line 31 in 49c3915
and used for example here:
gz-math/src/Stopwatch_TEST.cc
Lines 45 to 46 in 49c3915
I think it's dangerous to define a clock directly under the
math
namespace in a specific public header like this. It can collide with other clocks defined in other headers.Actual behavior:
I'd expect that alias to be either:
StopWatch
class and not visible through the public headerHelpers.hh
if we want that to be the default clock type used throughout allgz-math
classes.Steps to reproduce
Example on how to cause a compilation error:
Suggestion
At this point, removing that definition would break API. Considering that
steady_clock
is the only clock type used throughout the library (so far), we could consider moving that alias toHelper.hh
so that it can be used by classes other thanStopWatch
, i.e.SpeedLimiter
,DiffDriveOdometry
,GaussMarkovProcess
...Alternatively, we could deprecate
ignition::math::clock
from version 7 and encourage downstream users to usestd::chrono
or define their own aliases as they see fit.The text was updated successfully, but these errors were encountered: