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

Make API consistent #301

Open
7 of 45 tasks
chapulina opened this issue Dec 10, 2021 · 6 comments
Open
7 of 45 tasks

Make API consistent #301

chapulina opened this issue Dec 10, 2021 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@chapulina
Copy link
Contributor

chapulina commented Dec 10, 2021

Desired behavior

Some things that we should double-check:

  • setters should start with Set
  • POD arguments don't need to be declared const
  • getters should be const
  • see more on our style guide

Alternatives considered

Have users memorize what classes have what API styles.

Implementation suggestion

New functions can be added to ign-math6, modifications need to target main. We've been deprecating the old functions on main, for example:

https://github.com/ignitionrobotics/ign-math/blob/931d058e7a9ffb8a123017d255fb876f6724630d/include/ignition/math/Quaternion.hh#L369-L378

But we could consider postponing these deprecation warnings, considering that they will impact lots of users. The goal is to provide users a nice consistent API, and we can accomplish this without adding migration burden.

Here's the status:

  1. Angle
  2. AxisAlignedBox
  3. Box
  4. Color
  5. Cylinder
  6. DiffDriveOdometry
  7. Filter
  8. Frustum
  9. GaussMarkovProcess
  10. graph/Edge
  11. graph/GraphAlgorithms
  12. graph/Graph
  13. graph/Vertex
  14. Helpers
  15. Inertial
  16. Kmeans
  17. Line2
  18. Line3
  19. MassMatrix3
  20. Material
  21. MaterialType
  22. Matrix3
  23. Matrix4
  24. MovingWindowFilter
  25. OrientedBox
  26. PID
  27. Plane
  28. Pose3
  29. Quaternion. See pull request #327.
  30. Rand
  31. RollingMean
  32. RotationSpline
  33. SemanticVersion
  34. SignalStats
  35. Sphere
  36. SphericalCoordiantes
  37. Spline
  38. Stopwatch
  39. Temperature
  40. Triangle3
  41. Triangle
  42. Vector2
  43. Vector3
  44. Vector3Stats
  45. Vector4

Additional context

This was broken off #101.

@akshatpandya
Copy link
Contributor

I'd like to take up this issue. Any update to the above list or I can just start?

@chapulina
Copy link
Contributor Author

Thanks for the help, @akshatpandya ! I think the list is up-to-date, but it's possible that some classes there don't need any changes. If you notice that a class doesn't need changes, please comment here and we can check if off.

@akshatpandya
Copy link
Contributor

akshatpandya commented Dec 17, 2021

@chapulina Should I branch off from main or ign-math6?

@akshatpandya
Copy link
Contributor

@chapulina The following classes doesn't need changes:

  1. AxisAlignedBox
  2. Box
  3. Color
  4. Cylinder

I've made changes for the following classes:

  1. Angle
  2. DiffDriveOdometry

Working on the remaining ones.

akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 17, 2021
1. Angle.cc

fix gazebosim#301

Signed-off-by: Akshat Pandya <[email protected]>
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 17, 2021
1. DiffDriveOdometry.cc
2. DiffDriveOdometry.hh

fix gazebosim#301

Signed-off-by: Akshat Pandya <[email protected]>
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 17, 2021
@chapulina
Copy link
Contributor Author

Should I branch off from main or ign-math6?

You can target ign-math6 if you just need to add functions. If you're changing any function signatures then target main 👍

The following classes doesn't need changes:

Thanks! Updated the ticket.

I've made changes for the following classes:

Did you mean to close the PRs? Let us know if you have any questions. I noticed you added const to the double parameters, but we should be removing const from "plain old data" (POD) like double, see the style guide:

For a function parameter passed by value, const has no effect on the caller, thus is not recommended in function declarations.

akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
1. Angle.cc

fix gazebosim#301

Signed-off-by: Akshat Pandya <[email protected]>
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
1. DiffDriveOdometry.cc
2. DiffDriveOdometry.hh

fix gazebosim#301

Signed-off-by: Akshat Pandya <[email protected]>
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 24, 2021
@akshatpandya
Copy link
Contributor

@chapulina I've opened a PR for the following updated classes:

Angle
DiffDriveOdometry
Filter
Frustum
GaussMarkovProcess
graph/Edge
graph/GraphAlgorithms
graph/Graph
graph/Vertex

akshatpandya added a commit to akshatpandya/ign-math that referenced this issue Dec 28, 2021
@azeey azeey added the good first issue Good for newcomers label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants