Skip to content

Conversation

@traversaro
Copy link
Member

Fix #140 .
Fix robotology/idyntree#1201 .

This PR has as a breaking change, but I think it is a useful one based on user feedback. Historically, iDynTree URDF exporter has the iDynTree::ModelExporterOptions::exportFirstBaseLinkAdditionalFrameAsFakeURDFBase options that automatically exports the first additional frame attached to the link base as the actual base link of the URDF model, as a workaround for a long standing issue ROS issue ( ros/robot_model#6 ). However, this behaviour seems confusing, so this PR:

  • Changes the default value set of iDynTree::ModelExporterOptions::exportFirstBaseLinkAdditionalFrameAsFakeURDFBase from true to false
  • Exposes the exportFirstBaseLinkAdditionalFrameAsFakeURDFBase argument as a parameter, to permit users that want to set it (or continue to use the default behavior of creo2urdf<=0.5.11 .

@FabioBergonti @pillai-s do you know how to compile this extension from source? It would be great to be able to quickly test this PR before merging and/or doing a release.

…eAsFakeURDFBase to false by default and expose it as a parameter
@traversaro traversaro requested review from Nicogene and mfussi66 and removed request for mfussi66 June 20, 2025 10:37
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @traversaro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the URDF export process by modifying the default behavior of a specific iDynTree option and making it user-configurable. The primary goal is to enhance clarity and provide more control over how the base link is handled during URDF generation, resolving previously reported issues related to unexpected base link assignments.

Highlights

  • Default Behavior Change: I've changed the default value of iDynTree::ModelExporterOptions::exportFirstBaseLinkAdditionalFrameAsFakeURDFBase from true to false. This addresses user feedback regarding confusing behavior where the first additional frame attached to the base link was automatically exported as the URDF model's base link.
  • New Configuration Parameter: I've exposed exportFirstBaseLinkAdditionalFrameAsFakeURDFBase as a configurable parameter in the creo2urdf configuration. Users can now explicitly set this option to true if they wish to revert to the previous behavior (pre-v0.5.11) or false to use the new default.
  • Documentation Update: I've updated the README.md to document the new exportFirstBaseLinkAdditionalFrameAsFakeURDFBase parameter, including its default value and a brief explanation of its purpose and historical context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@traversaro
Copy link
Member Author

fyi @xela-95

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a breaking change by altering the default behavior of how the base link is determined during URDF export. The iDynTree::ModelExporterOptions::exportFirstBaseLinkAdditionalFrameAsFakeURDFBase option now defaults to false within creo2urdf, aiming to reduce user confusion. The PR also exposes this option as a YAML parameter, allowing users to revert to the previous behavior if necessary. The changes include updating the Creo2Urdf class to handle this new parameter, modifying the OnCommand logic to read it from the configuration, and updating README.md to document the new parameter and its default value.

The implementation of the core logic appears correct and aligns with the stated goals. My primary feedback concerns the clarity of the documentation for this new parameter in README.md, given its nature as a breaking change.

No specific style guide was provided for this review. The submitted code changes are consistent with the established style observed in the surrounding codebase (e.g., naming conventions like camelCase for variables, PascalCase for classes, and brace styling for control flow statements).

@traversaro
Copy link
Member Author

@Nicogene @mfussi66 I see the CI is failing, let me know if I should push the branch to the actual repo instead of pushing to a fork.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@traversaro
Copy link
Member Author

traversaro commented Jun 20, 2025

@FabioBergonti @pillai-s do you know how to compile this extension from source? It would be great to be able to quickly test this PR before merging and/or doing a release.

If you do not know how to compile locally the extension I can show you how to do it, it is relatively straightforward (see https://github.com/icub-tech-iit/creo2urdf?tab=readme-ov-file#installation-from-sources), but if you never used vcpkg it may not be super-intuitive.

GitHub
Generate URDF models from CREO mechanisms. Contribute to icub-tech-iit/creo2urdf development by creating an account on GitHub.

@Nicogene
Copy link
Member

@Nicogene @mfussi66 I see the CI is failing, let me know if I should push the branch to the actual repo instead of pushing to a fork.

Nevermind for the fail, it is failing the dispatch to the private runner CI, we can merge as soon as we have confirmation by @pillai-s and/or @FabioBergonti

@Nicogene Nicogene merged commit 23478a1 into icub-tech-iit:master Jun 20, 2025
1 of 2 checks passed
@Nicogene
Copy link
Member

I am going to merge it and tag it in this way @FabioBergonti and @pillai-s have a binary that is easier to install it, because next week I will be on vacation
In casi this is not resolutive I can do another tag or change the existing one

@Nicogene
Copy link
Member

Nicogene commented Jun 20, 2025

Enjoy:

GitHub
What's Changed

Add vcpkg version in the documentation by @Nicogene in #144
Set iDynTree::ModelExporterOptions::exportFirstBaseLinkAdditionalFrameAsFakeURDFBase to false by default and expose it as...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants