gazebosim / gz-math

General purpose math library for robot applications.
https://gazebosim.org/libs/math
Apache License 2.0
54 stars 67 forks source link

Add Ruby interfaces to all classes #302

Open chapulina opened 2 years ago

chapulina commented 2 years ago

Desired behavior

We should complete our Ruby scripting support for all classes. Now that we have SWIG -based Python interfaces for all classes, it should be quick to migrate them to Ruby.

We should also add tests for all classes.

Alternatives considered

Abandoning Ruby in favor of Python?

Implementation suggestion

It should be quick to port the existing SWIG files to Ruby. Adding tests will take longer.

The files live here: https://github.com/ignitionrobotics/ign-math/tree/ign-math6/src/ruby

Here's the status:

  1. [x] Angle
  2. [ ] AxisAlignedBox
  3. [ ] Box
  4. [ ] Color
  5. [ ] Cylinder
  6. [ ] DiffDriveOdometry
  7. [ ] Filter
  8. [ ] Frustum
  9. [x] 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. [x] Matrix3
  23. [ ] Matrix4
  24. [ ] MovingWindowFilter
  25. [ ] OrientedBox
  26. [ ] PID
  27. [ ] Plane
  28. [ ] Pose3
  29. [ ] Quaternion
  30. [x] Rand
  31. [ ] RollingMean
  32. [ ] RotationSpline
  33. [ ] SemanticVersion
  34. [ ] SignalStats
  35. [ ] Sphere
  36. [ ] SphericalCoordiantes
  37. [ ] Spline
  38. [ ] Stopwatch
  39. [ ] Temperature
  40. [ ] Triangle3
  41. [ ] Triangle
  42. [x] Vector2
  43. [x] Vector3
  44. [ ] Vector3Stats
  45. [x] Vector4

Additional context

This was broken off #101.

chapulina commented 2 years ago

We're moving all the SWIG files that we had working for Python to the Ruby directory in https://github.com/ignitionrobotics/ign-math/pull/354, but we're not enabling them.

Now the work on this issue should consist of:

  1. Adding each file to:

    https://github.com/ignitionrobotics/ign-math/blob/5fa6f7858a873448c9fa09be23dafc99f0f8863d/src/ruby/CMakeLists.txt#L16-L23

  2. Porting the existing test from C++ / Python to Ruby

  3. Making any necessary adjustments to the SWIG file

azeey commented 7 months ago

I would be in favor of abandoning Ruby in favor of Python.