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

Support colcon workspace with bullet and ode #1389

Merged
merged 3 commits into from
Aug 16, 2019

Conversation

scpeters
Copy link
Collaborator

@scpeters scpeters commented Aug 14, 2019

We have been using colcon to build gazebo and ignition packages from source in a workspace, similar to using catkin-tools with a catkin workspace. A cool feature of colcon is that it can automatically identify cmake dependencies based on the cmake project name and build packages in the workspace in the correct order without creating package.xml files.

If a package.xml file is present in a package, it will use that instead of the automatic detection, so you can build a mixed workspace of plain cmake and ROS1 or ROS2 packages.

When attempting to use colcon in a workspace with ign-physics, dartsim, bullet, and ODE, it was not properly identifying the dependencies. I believe the following two steps are necessary:

I'm not sure if there are cpack / rosdistro / rosdep implications of changing these things, but I think it helps with colcon. Here's a workspace file for testing:

cc @mxgrey @jslee02 @azeey


Before creating a pull request

  • Document new methods and classes
  • Format new code files using clang-format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@scpeters scpeters changed the title Colcon bullet ode Support colcon workspace with bullet and ode Aug 14, 2019
package.xml Outdated Show resolved Hide resolved
package.xml Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@jslee02 jslee02 added this to the DART 6.10.0 milestone Aug 14, 2019
@mxgrey
Copy link
Member

mxgrey commented Aug 14, 2019

Unfortunately there are some breaking changes that would be required for DART/dartsim to comply with the assumptions made by colcon's package information inference rules. I think it'll make sense to put these changes into dartsim-7, but the changes could pose significant problems for current users of DART/dartsim-6.

Instead of relying on colcon's inference rules, maybe we should explicitly put a colcon.pkg file into the DART codebase? Obviously this would be annoying as it would introduce a third source of package metadata into the source code (the other two being cmake and package.xml), but we would only use it as a stop-gap measure until dartsim-7, at which point we can make our cmake fully compliant with colcon's assumptions, and then delete the colcon.pkg file altogether.

@scpeters
Copy link
Collaborator Author

a colcon.pkg file sounds like the right thing to do, at least in the short term. I'll experiment with that tomorrow.

@mjcarroll
Copy link

Colcon also has a mechanism for providing metadata so that you don't necessarily have to add colcon.pkg files to the packages.

It would be reasonable to add the information there as well: https://github.com/colcon/colcon-metadata-repository

@scpeters
Copy link
Collaborator Author

Here is the content of an equivalent colcon.pkg file:

{
  "name": "DART",
  "dependencies": ["BULLET_PHYSICS", "ODE"],
}

@scpeters
Copy link
Collaborator Author

I reverted the changes to CMakeLists.txt and package.xml and added a colcon.pkg file instead.

@scpeters scpeters marked this pull request as ready for review August 14, 2019 22:40
@scpeters
Copy link
Collaborator Author

@mjcarroll wrote:

Colcon also has a mechanism for providing metadata so that you don't necessarily have to add colcon.pkg files to the packages.

It would be reasonable to add the information there as well: https://github.com/colcon/colcon-metadata-repository

I guess we could add the "dependencies": ["BULLET_PHYSICS", "ODE"], line to the metadata repository, but I think we would still need the colcon.pkg here if we want to change the project name used by colcon so that downstream cmake software that uses find_package(DART) will recognize this dependency automatically.

@@ -0,0 +1,4 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Does this file support comments in the file? If so, it'd be great to leave a brief comment how this file is used for.

Choose a reason for hiding this comment

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

It's YAML, so comments prefixed with # are acceptable here.

CMakeLists.txt Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 15, 2019

Codecov Report

Merging #1389 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1389   +/-   ##
=======================================
  Coverage   57.27%   57.27%           
=======================================
  Files         366      366           
  Lines       27432    27432           
=======================================
  Hits        15711    15711           
  Misses      11721    11721

@jslee02 jslee02 merged commit b74e97a into dartsim:master Aug 16, 2019
@scpeters scpeters deleted the colcon_bullet_ode branch August 16, 2019 21:04
scpeters added a commit to gazebo-forks/dart that referenced this pull request Jun 24, 2020
* colcon.pkg: DART depend on ODE, BULLET_PHYSICS

* Add file header to colcon.pkg
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.

4 participants