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

Add idyntree-model-simplify-shapes command line tool #941

Merged
merged 2 commits into from
Nov 22, 2021
Merged

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented Nov 13, 2021

This tool is useful to take in input a model, and return in output the same model, but with all the geometries of the model approximated with their axis aligned bounding boxes. This implements what was described in #933 . This tool is only available if iDynTree is compiled with assimp support.

The actual logic of the tool is contained in a function that can operate directly on iDynTree::Model instances that is called iDynTree::approximateSolidShapesWithPrimitiveShape and is contained in the iDynTree::idyntree-solid-shapes target. In this way, the same logic of the command line tool can be used also programatically in C++, MATLAB or Python (SWIG bindings).

At the moment, this header contains just the approximateSolidShapesWithPrimitiveShape
function, useful to approximate the solid shapes of a given iDynTree::Model to a series
of bounding boxes.
@traversaro
Copy link
Member Author

To give an example of this tool, if one runs it on the iCubGazeboV3 model installed by the icub-models, i.e.:

.\bin\idyntree-model-simplify-shapes.exe -m  %CONDA_PREFIX%\Library\share\iCub\robots\iCubGazeboV3\model.urdf -o iCubGazeboV3_simplified.urdf

This is the result. Before:
normal_icub3

After:
simplified_icub3

@traversaro traversaro requested a review from S-Dafarra November 13, 2021 17:55
@traversaro
Copy link
Member Author

traversaro commented Nov 13, 2021

FYI @fabiodinatale @VenusPasandi @valentino-razza @CarlottaSartore, as soon as this PR is merged (is targed toward master) I plan to release iDynTree v4.3.0 so that this feature is quickly available even in conda binary packages.

@traversaro
Copy link
Member Author

FYI @CarlottaSartore @Nicogene @GrmanRodriguez @akhilsathuluri This is not a tutorial like discussed in #935, but it is for sure a simple tool that show the possibility related to programatically modify URDF-like robot models, and also a tool that could be useful in general in co-design and in hardware/software design loops.

README.md Outdated Show resolved Hide resolved
src/tools/idyntree-model-simplify-shapes.cpp Show resolved Hide resolved
@traversaro traversaro requested a review from S-Dafarra November 21, 2021 17:25
CHANGELOG.md Outdated Show resolved Hide resolved
This tool is useful to take in input a model, and return in
output the same model, but with all the geometries of the model
approximated with their axis aligned bounding boxes.

Fix #933 .
@traversaro traversaro merged commit 380f967 into master Nov 22, 2021
@traversaro traversaro deleted the fix933 branch November 22, 2021 09:24
@traversaro
Copy link
Member Author

traversaro commented Nov 23, 2021

@fabiodinatale Just FYI, thanks to this PR, #945 and conda-forge/idyntree-feedstock#17 now this tool is part of the new release v4.3.0 of iDynTree, that is now part of conda-forge. So if you create a new environment, you will get the latest iDynTree with this tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants