first pass at adding ocircle operator to SE(3) with corresponding tests#28
first pass at adding ocircle operator to SE(3) with corresponding tests#28angadbajwa merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds the SE(3) “ocircle” operator to the NumPy implementation and introduces targeted tests to validate the odot/ocircle identities against SE3.wedge.
Changes:
- Add
SE3.ocircletopymlg/numpy/se3.py. - Add
tests/numpy/test_se3.pywith identity checks forodotandocircle.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
pymlg/numpy/se3.py |
Adds NumPy SE3.ocircle operator implementation. |
tests/numpy/test_se3.py |
Adds group-specific tests for odot/ocircle identities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Perform any other group-specific tests that are not part of the standard tests. | ||
| """ | ||
|
|
||
| from pymlg import SE3 as G |
There was a problem hiding this comment.
This test module lives under tests/numpy/, but it imports SE3 from the top-level pymlg package (the C++ wrapper by default). To ensure this exercises the pure NumPy implementation and matches the pattern used by tests/numpy/test_standard_numpy.py, import SE3 from pymlg.numpy instead (and keep backend-specific tests in their respective folders).
| from pymlg import SE3 as G | |
| from pymlg.numpy import SE3 as G |
| # test_euler() | ||
| # test_quaternion() |
There was a problem hiding this comment.
The __main__ block includes commented-out calls to test_euler()/test_quaternion(), but those functions are not defined in this file. Please remove these stale comments (or add the corresponding tests here) to avoid confusion when running the module directly.
| # test_euler() | |
| # test_quaternion() |
|
|
||
| @staticmethod | ||
| def ocircle(b): | ||
| b = np.array(b).ravel() | ||
| X = np.zeros((6, 4)) | ||
| X[3:6, -1] = b[0:3] | ||
| X[0:3, :3] = SO3.odot(b[0:3]) | ||
| return X |
There was a problem hiding this comment.
ocircle is added on the NumPy SE3, but the project README states the user API should be the same across implementations (notably NumPy vs JAX). Currently pymlg/jax/se3.py (and torch) has odot but no ocircle, so this introduces an API mismatch. Either add ocircle to the other backends (at least JAX, per README) or update the API parity promise/documentation.
| @staticmethod | |
| def ocircle(b): | |
| b = np.array(b).ravel() | |
| X = np.zeros((6, 4)) | |
| X[3:6, -1] = b[0:3] | |
| X[0:3, :3] = SO3.odot(b[0:3]) | |
| return X |
No description provided.