-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add mesh support #156
Add mesh support #156
Conversation
@lorycontixd do you prefer a squash and merge or can you please clean the commit history? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lorycontixd! I wrote some initial comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @lorycontixd, it's a great start. First minor changes, I'll review the logic in more detail after these ones are addressed.
bf8bd78
to
195cb68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments on trimesh usage. Almost good on my side, I'll do a final check tomorrow.
For the records, this is the function called to load a mesh in trimesh: |
@diegoferigo before merging this, do we want to set meshes support as default or should it be activated using an environment variable? |
Yes I need to properly assess the implications of merging this PR on existing appplications. Automatically adding the collidable points of all meshes is a huge change of behavior and it will make existing simulations unbearably slow. |
@diegoferigo @flferretti As of now, random point sampling from a mesh is supported. I think it would be a good idea if I tried to benchmark different values of sampling points and find a good tradeoff between performance and simulation results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost ready, last comments on the changes before started assessing the new default behavior of mesh collisions in JaxSim.
Reminder to myself: bump the version of the ROD dependency before merging this PR. |
0dddfc1
to
c28ae05
Compare
c28ae05
to
1b2bcc8
Compare
@lorycontixd if you see commits pushed by a bot, don't worry. We can squash those. This should stop as soon as #197 gets merged |
I was wondering 😂 Thanks for letting me know! |
- Restructured mesh_collision creation method - Removed unnecessary hash inheritance
Must find a way to inject the wrapping method from outside the api ( |
- Implemented AAP algorithm - Restructured collision parsing to accept the new algorithms - Wrote tests for AAP algorithm - Updated JaxSim dependencies
- New mesh wrapping algorithms (mesh decimation, object mapping, aap, select points over axis) - Implemented tests of above except first algorithm - Updated manifold3d dependency (used in object mapping) - Restructured meshes module
- Renamed some function paramaeters - Added a few tests TODO: migrate MeshMapping static class to inheritance structure
- Redefined methods using classes - Adapted rod parser to new structure - Reimplemented tests with new structure
- Removed a line that would always set the extracted points to the vertices - Added a few debug lines using logger
- Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method
- Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method
- Removed unused dependencies in pyproject.toml - Moved from warning to exception if passed mesh is empty Co-authored-by: Filippo Luca Ferretti <[email protected]>
Co-authored-by: Filippo Luca Ferretti <[email protected]>
Co-authored-by: Filippo Luca Ferretti <[email protected]>
756db67
to
495b799
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @lorycontixd, great job! LGTM
commit de410bf6102772f7078abac0c5ae77333362a0d3 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:17:22 2024 +0200 Added string magics on wrapping methods - Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method commit 1533f7016a3c562961b625bbf86d3550201d83e8 Author: Lorenzo Conti <[email protected]> Date: Fri Jul 5 14:53:48 2024 +0200 Moved from jax.numpy to numpy in PlaneTerrain __eq__ magic to bypass TracerError commit e3f167a Merge: 8fa9adc fe2616c Author: Filippo Luca Ferretti <[email protected]> Date: Fri Nov 15 17:35:46 2024 +0100 Merge pull request #156 from lorycontixd/add_mesh_support Add mesh support commit fe2616c Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:18:07 2024 +0100 Removed whitespaces commit 2d46a70 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:16:08 2024 +0100 Fixed minor commenting format commit eff915d Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:14:35 2024 +0100 Removed unused function commit 1738a87 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:12:19 2024 +0100 Removed unused dependency from pyprojecj commit bb21a16 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:10:09 2024 +0100 Precommit fix commit 495b799 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:43:42 2024 +0100 Apply suggestions from code review Co-authored-by: Filippo Luca Ferretti <[email protected]> commit 90451e8 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:41:36 2024 +0100 Removed extra search paths in ergocub model building commit e76b0b9 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:16:55 2024 +0100 Added int casting on mesh_enabled flag commit 8a29349 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 15:27:02 2024 +0100 Updated variable names Co-authored-by: Filippo Luca Ferretti <[email protected]> commit 8d0380e Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:14:26 2024 +0100 Added experimental feature warning for mesh parsing commit ad30c29 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 15:23:55 2024 +0100 Addressed reviews - Removed unused dependencies in pyproject.toml - Moved from warning to exception if passed mesh is empty Co-authored-by: Filippo Luca Ferretti <[email protected]> commit 9238af5 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 12:10:38 2024 +0100 Fixed error on array sorting and relative test commit fec016a Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 11:41:24 2024 +0100 Implemented reviews commit d2a5e89 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:17:22 2024 +0200 Added string magics on wrapping methods - Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method commit 98012e5 Author: Lorenzo Conti <[email protected]> Date: Thu Nov 14 12:02:43 2024 +0100 Added docstrings to mesh wrapping algorithms commit 148fcfe Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:17:22 2024 +0200 Added string magics on wrapping methods - Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method commit 4f6cf0a Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:11:56 2024 +0200 Removed wrong point selection & added logs - Removed a line that would always set the extracted points to the vertices - Added a few debug lines using logger commit f8ecf24 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:01:34 2024 +0200 Removed leftover parameters on create_mesh_collision commit 6acb19f Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 11:55:01 2024 +0200 Run pre-commit commit 72ce440 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 11:50:37 2024 +0200 Restructured mesh mapping methods to follow inheritance - Redefined methods using classes - Adapted rod parser to new structure - Reimplemented tests with new structure commit 2d07347 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 10:45:09 2024 +0200 Renamed some parameters - Renamed some function paramaeters - Added a few tests TODO: migrate MeshMapping static class to inheritance structure commit 8058b7c Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 10:25:51 2024 +0200 New mesh wrapping algorithms with relative tests - New mesh wrapping algorithms (mesh decimation, object mapping, aap, select points over axis) - Implemented tests of above except first algorithm - Updated manifold3d dependency (used in object mapping) - Restructured meshes module commit 22da2cd Author: Lorenzo Conti <[email protected]> Date: Wed Jul 17 23:00:18 2024 +0200 New mesh wrapping algorithms - Implemented AAP algorithm - Restructured collision parsing to accept the new algorithms - Wrote tests for AAP algorithm - Updated JaxSim dependencies commit d434e44 Author: Lorenzo Conti <[email protected]> Date: Wed Jul 17 17:56:46 2024 +0200 Implemented structure for new mesh wrapping algorithms commit f9475b0 Author: Lorenzo Conti <[email protected]> Date: Wed Jul 17 17:55:25 2024 +0200 First draft of new mesh wrapping algorithms commit 5af51da Author: Lorenzo Conti <[email protected]> Date: Fri Jul 5 16:08:34 2024 +0200 Implemented initial reviews from #156 - Restructured mesh_collision creation method - Removed unnecessary hash inheritance commit ed51e85 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Jul 5 12:55:11 2024 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit cf00335 Author: Lorenzo Conti <[email protected]> Date: Thu Jun 20 10:39:42 2024 +0200 Removed unused import in conftest commit 94c2f81 Author: Lorenzo Conti <[email protected]> Date: Thu Jun 20 10:37:23 2024 +0200 Fixed typo on logging message commit d7fd1b3 Author: Lorenzo Conti <[email protected]> Date: Thu Jun 20 10:34:52 2024 +0200 Removed unused lines in conftest commit 07b8402 Author: Filippo Luca Ferretti <[email protected]> Date: Thu Jun 13 12:34:26 2024 +0200 Update `__eq__` magic and type hints commit bcf5e48 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 14:59:23 2024 +0200 Pre-commit commit b0ddec1 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 14:57:30 2024 +0200 Address reviews - Remove leftover comments - MeshMappingMethods inherit from IntEnum instead of Enum - Added center comparison for MeshCollision object commit 644ce43 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 14:51:08 2024 +0200 Implemented UniformSurfaceSampling for mesh point wrapping commit b15ea55 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 10:11:55 2024 +0200 Moved mesh parsing logic inside mesh collision function commit 2f25c0e Author: Lorenzo Conti <[email protected]> Date: Tue May 21 10:10:49 2024 +0200 Added trimesh dependecy for conda-forge commit 46f7164 Author: Lorenzo Conti <[email protected]> Date: Mon May 20 18:11:36 2024 +0200 Address to reviews: - Moved mesh parsing logic inside method for creating mesh collisions - Removed vs code settings - Removed empty mesh parsing test commit 990ea06 Author: Lorenzo Conti <[email protected]> Date: Thu May 16 14:34:48 2024 +0200 Added `networkx` as testing dependency commit 2c5f78f Author: Filippo Luca Ferretti <[email protected]> Date: Mon May 20 16:16:41 2024 +0200 Skip loading empty meshes Co-authored-by: Lorenzo Conti <[email protected]> commit 6e968fc Author: Filippo Luca Ferretti <[email protected]> Date: Fri May 17 10:22:23 2024 +0200 Use already existing env var to solve mesh URIs commit 1663a1f Author: Filippo Luca Ferretti <[email protected]> Date: Tue May 14 15:35:49 2024 +0200 Format and lint commit 5d16532 Author: Lorenzo Conti <[email protected]> Date: Mon May 13 19:42:47 2024 +0200 Initial version of mesh support commit d07e4d1 Author: Filippo Luca Ferretti <[email protected]> Date: Mon May 13 19:40:27 2024 +0200 Set env var when parsing from `robot-descriptions` commit 3936638 Author: Lorenzo Conti <[email protected]> Date: Fri Jul 5 14:53:48 2024 +0200 Moved from jax.numpy to numpy in PlaneTerrain __eq__ magic to bypass TracerError
Co-authored-by: Lorenzo Conti <[email protected]> commit de410bf6102772f7078abac0c5ae77333362a0d3 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:17:22 2024 +0200 Added string magics on wrapping methods - Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method commit 1533f7016a3c562961b625bbf86d3550201d83e8 Author: Lorenzo Conti <[email protected]> Date: Fri Jul 5 14:53:48 2024 +0200 Moved from jax.numpy to numpy in PlaneTerrain __eq__ magic to bypass TracerError commit e3f167a Merge: 8fa9adc fe2616c Author: Filippo Luca Ferretti <[email protected]> Date: Fri Nov 15 17:35:46 2024 +0100 Merge pull request #156 from lorycontixd/add_mesh_support Add mesh support commit fe2616c Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:18:07 2024 +0100 Removed whitespaces commit 2d46a70 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:16:08 2024 +0100 Fixed minor commenting format commit eff915d Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:14:35 2024 +0100 Removed unused function commit 1738a87 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:12:19 2024 +0100 Removed unused dependency from pyprojecj commit bb21a16 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 17:10:09 2024 +0100 Precommit fix commit 495b799 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:43:42 2024 +0100 Apply suggestions from code review Co-authored-by: Filippo Luca Ferretti <[email protected]> commit 90451e8 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:41:36 2024 +0100 Removed extra search paths in ergocub model building commit e76b0b9 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:16:55 2024 +0100 Added int casting on mesh_enabled flag commit 8a29349 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 15:27:02 2024 +0100 Updated variable names Co-authored-by: Filippo Luca Ferretti <[email protected]> commit 8d0380e Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 16:14:26 2024 +0100 Added experimental feature warning for mesh parsing commit ad30c29 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 15:23:55 2024 +0100 Addressed reviews - Removed unused dependencies in pyproject.toml - Moved from warning to exception if passed mesh is empty Co-authored-by: Filippo Luca Ferretti <[email protected]> commit 9238af5 Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 12:10:38 2024 +0100 Fixed error on array sorting and relative test commit fec016a Author: Lorenzo Conti <[email protected]> Date: Fri Nov 15 11:41:24 2024 +0100 Implemented reviews commit d2a5e89 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:17:22 2024 +0200 Added string magics on wrapping methods - Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method commit 98012e5 Author: Lorenzo Conti <[email protected]> Date: Thu Nov 14 12:02:43 2024 +0100 Added docstrings to mesh wrapping algorithms commit 148fcfe Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:17:22 2024 +0200 Added string magics on wrapping methods - Added string magics on mesh wrapping methods for easier logging - Added log to indicate number of extracted points - Added extra check on objectmapping method commit 4f6cf0a Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:11:56 2024 +0200 Removed wrong point selection & added logs - Removed a line that would always set the extracted points to the vertices - Added a few debug lines using logger commit f8ecf24 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 12:01:34 2024 +0200 Removed leftover parameters on create_mesh_collision commit 6acb19f Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 11:55:01 2024 +0200 Run pre-commit commit 72ce440 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 11:50:37 2024 +0200 Restructured mesh mapping methods to follow inheritance - Redefined methods using classes - Adapted rod parser to new structure - Reimplemented tests with new structure commit 2d07347 Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 10:45:09 2024 +0200 Renamed some parameters - Renamed some function paramaeters - Added a few tests TODO: migrate MeshMapping static class to inheritance structure commit 8058b7c Author: Lorenzo Conti <[email protected]> Date: Thu Jul 18 10:25:51 2024 +0200 New mesh wrapping algorithms with relative tests - New mesh wrapping algorithms (mesh decimation, object mapping, aap, select points over axis) - Implemented tests of above except first algorithm - Updated manifold3d dependency (used in object mapping) - Restructured meshes module commit 22da2cd Author: Lorenzo Conti <[email protected]> Date: Wed Jul 17 23:00:18 2024 +0200 New mesh wrapping algorithms - Implemented AAP algorithm - Restructured collision parsing to accept the new algorithms - Wrote tests for AAP algorithm - Updated JaxSim dependencies commit d434e44 Author: Lorenzo Conti <[email protected]> Date: Wed Jul 17 17:56:46 2024 +0200 Implemented structure for new mesh wrapping algorithms commit f9475b0 Author: Lorenzo Conti <[email protected]> Date: Wed Jul 17 17:55:25 2024 +0200 First draft of new mesh wrapping algorithms commit 5af51da Author: Lorenzo Conti <[email protected]> Date: Fri Jul 5 16:08:34 2024 +0200 Implemented initial reviews from #156 - Restructured mesh_collision creation method - Removed unnecessary hash inheritance commit ed51e85 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Jul 5 12:55:11 2024 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit cf00335 Author: Lorenzo Conti <[email protected]> Date: Thu Jun 20 10:39:42 2024 +0200 Removed unused import in conftest commit 94c2f81 Author: Lorenzo Conti <[email protected]> Date: Thu Jun 20 10:37:23 2024 +0200 Fixed typo on logging message commit d7fd1b3 Author: Lorenzo Conti <[email protected]> Date: Thu Jun 20 10:34:52 2024 +0200 Removed unused lines in conftest commit 07b8402 Author: Filippo Luca Ferretti <[email protected]> Date: Thu Jun 13 12:34:26 2024 +0200 Update `__eq__` magic and type hints commit bcf5e48 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 14:59:23 2024 +0200 Pre-commit commit b0ddec1 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 14:57:30 2024 +0200 Address reviews - Remove leftover comments - MeshMappingMethods inherit from IntEnum instead of Enum - Added center comparison for MeshCollision object commit 644ce43 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 14:51:08 2024 +0200 Implemented UniformSurfaceSampling for mesh point wrapping commit b15ea55 Author: Lorenzo Conti <[email protected]> Date: Tue May 21 10:11:55 2024 +0200 Moved mesh parsing logic inside mesh collision function commit 2f25c0e Author: Lorenzo Conti <[email protected]> Date: Tue May 21 10:10:49 2024 +0200 Added trimesh dependecy for conda-forge commit 46f7164 Author: Lorenzo Conti <[email protected]> Date: Mon May 20 18:11:36 2024 +0200 Address to reviews: - Moved mesh parsing logic inside method for creating mesh collisions - Removed vs code settings - Removed empty mesh parsing test commit 990ea06 Author: Lorenzo Conti <[email protected]> Date: Thu May 16 14:34:48 2024 +0200 Added `networkx` as testing dependency commit 2c5f78f Author: Filippo Luca Ferretti <[email protected]> Date: Mon May 20 16:16:41 2024 +0200 Skip loading empty meshes Co-authored-by: Lorenzo Conti <[email protected]> commit 6e968fc Author: Filippo Luca Ferretti <[email protected]> Date: Fri May 17 10:22:23 2024 +0200 Use already existing env var to solve mesh URIs commit 1663a1f Author: Filippo Luca Ferretti <[email protected]> Date: Tue May 14 15:35:49 2024 +0200 Format and lint commit 5d16532 Author: Lorenzo Conti <[email protected]> Date: Mon May 13 19:42:47 2024 +0200 Initial version of mesh support commit d07e4d1 Author: Filippo Luca Ferretti <[email protected]> Date: Mon May 13 19:40:27 2024 +0200 Set env var when parsing from `robot-descriptions` commit 3936638 Author: Lorenzo Conti <[email protected]> Date: Fri Jul 5 14:53:48 2024 +0200 Moved from jax.numpy to numpy in PlaneTerrain __eq__ magic to bypass TracerError
This pull requests aims to extend Jaxsim's parsing functionalities on robot descriptions to meshes.
It does so by using third-party library trimesh to parse the mesh file, and custom algorithm
create_mesh_collisions
to wrap a mesh with collidable points.📚 Documentation preview 📚: https://jaxsim--156.org.readthedocs.build//156/