-
Notifications
You must be signed in to change notification settings - Fork 138
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
Support <gazebo_ros>
in package.xml
exports
#492
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think that one of the most frustrating issue for newcomers and people dealing with Gazebo + ROS integration is to badly configure the asset directories assuming random paths that are not the ones really processed here. I would like to use the PR to improve this situation.
How about adding a bit of sanity checks before the
.append(
calls in this file that can emit warning/errors for the user to check/fix, some ideas:xml_path
in a vast majority of the cases needs to be an existing non empty directory.gazebo_model_path
, we can probably scan for the expected subdirectory structure with at least one .sdf and one .config.gazebo_plugin_path
we can probably expect that the user hosts at least one .so or one binary file.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.
I looked at doing this but the way this works, it's actually looking at all the packages in the system, not just the individual package the user might be interested in. And would have to do the checks for all packages every time this file is launched. Aside from the performance implications, a user launching this file would see errors/warnings coming from other packages they have no control over.
An alternative is to create a tool that can be used to search for a particular model/resource by it's URI. For example, if I wanted to check that the URI
model://my_awesome_pkg/models/cool_robot
is valid, I would run this tool and it would search all exported model paths and give me some diagnostic messages if the model couldn't be found.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.
@j-rivero any thoughts? I'd like to unblock ros/urdf_sim_tutorial#16 soon if possible.
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.
I was thinking on limiting the directories to inspect to the ones added via:
Why do we need to check all the packages in the system?
I agree that there is a performance implication that can be bad.
That would be really useful indeed. Another approach would be to enable a launch argument or environment flag that enable this debug behavior.
Given the situation, I'm not blocking the PR, thought it was easier to add the checks.
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.
The code
for package_name in get_package_names():
iterates through all the packages available. Then we'd need to check if any package that exportsgazebo_ros
meets the sanity requirements you described.