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

Example showing usage of resource from an external ROS package in Drake #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

azeey
Copy link

@azeey azeey commented Apr 20, 2021

Reopening RobotLocomotion/drake-external-examples#194 here.

This adds an example of loading a URDF from an external ROS package. The URDF contains a mesh with a package:// type URI. For this to be found, I populate the package map from AMENT_PREFIX_PATH as described in #170.

In addition to the pendulum related packages, I copied the scripts directory from https://github.com/RobotLocomotion/drake-external-examples for the convenient installation scripts that were referenced in the README.

Closes RobotLocomotion/drake-external-examples#170

cc @IanTheEngineer , @EricCousineau-TRI


This change is Reviewable

Signed-off-by: Addisu Z. Taddese <[email protected]>

target_link_libraries(${PROJECT_NAME} drake::drake)

install(FILES LICENSE
Copy link
Collaborator

Choose a reason for hiding this comment

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

this install() fails for me because there's no LICENSE file in drake_example_pendulum

Copy link
Author

Choose a reason for hiding this comment

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

I've removed this since there's only one LICENSE file at the top directory of this repo. 5747a7c

<url type="bugtracker">https://github.com/RobotLocomotion/drake-ros/issues</url>
<url type="repository">https://github.com/RobotLocomotion/drake-ros</url>
<buildtool_depend>ament_cmake</buildtool_depend>
<exec_depend>drake_example_pendulum_description</exec_depend>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mind adding <depend>drake</depend>? With that I'm able to build this together with RobotLocomotion/drake in an isolated colcon workspace.

Copy link
Author

Choose a reason for hiding this comment

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

Sure. 5747a7c

Signed-off-by: Addisu Z. Taddese <[email protected]>

// Populate from AMENT_PREFIX_PATH environment variable to find URDF files and
// their resources, such as meshes.
parser.package_map().PopulateFromEnvironment("AMENT_PREFIX_PATH");
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IanTheEngineer @EricCousineau-TRI any interest in in this example?

A lot has changed since this PR opened. I think now we'd put this in a folder in drake_ros_examples. The key piece of information appears to be calling PackageMap::PopuldateFromEnvironment with AMENT_PREFIX_PATH.

Copy link
Member

Choose a reason for hiding this comment

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

I think that's a very reasonable approach. Let's make this a simple example populating the Drake package_map from the local ROS environment inside drake_ros_examples.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, let's revive this once #207 lands!

@jwnimmer-tri
Copy link
Contributor

nit See also drake::parsing::PackageMap::PopulateFromRosPackagePath(). That function obeys AMENT_IGNORE, whereas PopulateFromEnvironment("AMENT_PACKAGE_PATH") does not.

Possibly we should extend/amend that Drake function for this purpose, instead of using PopulateFromEnvironment.

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.

Add example on how to load external URDF or SDF model and their resources
5 participants