Skip to content

Embed optional collision backends in core dart#2194

Merged
jslee02 merged 13 commits intomainfrom
dart_coll_targets
Nov 18, 2025
Merged

Embed optional collision backends in core dart#2194
jslee02 merged 13 commits intomainfrom
dart_coll_targets

Conversation

@jslee02
Copy link
Member

@jslee02 jslee02 commented Nov 16, 2025

Purpose

  • Stop shipping separate dart-collision-* components so the optional Bullet and ODE detectors behave like first-class features of the dart library.
  • Make the build configuration fail fast when those detectors are requested but their dependencies are missing, eliminating silent feature drops in CI and downstream packages.
  • Expose the new behavior through the generated CMake/package metadata so integrators immediately know which collision engines were compiled in.
  • Start the larger effort to remove per-dependency component targets (e.g., dart-optimizer-*) so future follow-up PRs can apply the same pattern across the rest of the tree.

Changes

  1. Add cache flags DART_BUILD_COLLISION_BULLET / DART_BUILD_COLLISION_ODE (default ON in Pixi) and teach the Bullet/ODE subdirectories to
    • bail out early when the option is OFF,
    • emit FATAL_ERROR when dependencies are missing while the option is ON, and
    • cmake_language(DEFER ...) their sources/includes/link flags directly onto the dart target so there are no standalone collision libraries.
  2. Update the generated DARTConfig.cmake, pkg-config hints, examples, tutorials, benchmarks, tests, and dartpy bindings to link only against dart/dart-utils* while conditionally enabling Bullet/ODE-specific executables based on the new flags.
  3. Refresh docs/onboarding, CHANGELOG, and AGENTS.md to document the embedded backends, the new options, and the libsdformat requirement.

Implications

  • Build behavior: Turning either option ON without the corresponding dependency now stops configuration instead of producing a partially featured build. Users who need Bullet/ODE simply enable the option (default ON in Pixi) and install libbullet-dev ≥3.25 or libode-dev ≥0.13; everyone else can set the option OFF to skip the backend entirely.
  • Package managers: The main dart artifact now carries Bullet/ODE when the options are enabled, so there is no need to produce or ship extra dart-collision-* packages. Downstream projects discover the availability via DART_BUILD_COLLISION_* cache exports or the existing HAVE_BULLET/HAVE_ODE config defines.
  • Users: Project code and CMake files no longer reference dart-collision-* targets; linking against dart is sufficient. Tests/examples guard Bullet/ODE-specific binaries with the new CMake options, so developers running partial builds receive clear skip/failure messages instead of link errors.
  • Follow-up work: Optimizer plugins and other optional integrations still produce component targets today; those will be cleaned up in subsequent PRs using the same approach as soon as their dependencies are audited.

Milestone: DART 7.0


Before creating a pull request

  • Run pixi run test-all to lint, build, and test your changes (not run in this environment)
  • Add unit tests for new functionality (covered by existing collision suites; no new APIs added)
  • Document new methods and classes
  • Add Python bindings (dartpy) if applicable (not applicable beyond the linking cleanup already in this change)

@jslee02 jslee02 added this to the DART 7.0 milestone Nov 16, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 16, 2025

@codex review

@chatgpt-codex-connector
Copy link

💡 Codex Review

dart_add_core_headers(${hdrs} ${detail_hdrs})
dart_add_core_sources(${srcs} ${detail_srcs})
if(NOT BULLET_LIBRARIES)
message(FATAL_ERROR "Bullet was found but did not report BULLET_LIBRARIES.")
endif()
set(_dart_bullet_link_items ${BULLET_LIBRARIES})
set(_dart_bullet_include_dirs ${BULLET_INCLUDE_DIRS})
get_filename_component(_dart_collision_binary_dir ${CMAKE_CURRENT_BINARY_DIR} DIRECTORY)
get_filename_component(_dart_binary_dir ${_dart_collision_binary_dir} DIRECTORY)
cmake_language(
DEFER
DIRECTORY ${_dart_binary_dir}
CALL target_link_libraries dart PUBLIC ${_dart_bullet_link_items}
)

P1 Badge pkg-config omits Bullet/ODE libs after embedding them in dart

These lines wire Bullet directly into the core dart target, and the ODE file applies the same pattern. However cmake/dart.pc.in still exports only assimp, ccd, eigen3, fcl, octomap in Requires: and -ldart in Libs:. When a build enables Bullet or ODE (the default in Pixi), pkg-config --libs dart will not emit -lBullet or -lODE, so downstream projects that rely on pkg-config rather than CMake will fail to link due to missing symbols. The pkg-config template needs to append the conditional collision backends whenever they are compiled into dart.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 16, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 16, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

# Add target
dart_add_library(${target_name} ${hdrs} ${srcs})
target_link_libraries(${target_name} PUBLIC dart IPOPT::ipopt)

P1 Badge Restore Ipopt version macros used by conditional includes

The Ipopt component no longer defines IPOPT_VERSION_MAJOR/MINOR/PATCH for the dart-optimizer-ipopt target. IpoptSolver.hpp still evaluates #if IPOPT_VERSION_GE(3, 13, 0) to choose between <IpIpoptApplication.hpp> and <coin/IpIpoptApplication.hpp>. Without these compile definitions the macros evaluate to zero, so any build against Ipopt ≥ 3.13 always goes down the legacy coin/... include path and fails because those headers no longer exist. Please reinstate the target_compile_definitions that populate the version macros or include IpoptConfig.h before the version check so modern Ipopt releases can compile.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02 jslee02 force-pushed the dart_coll_targets branch 2 times, most recently from 4df3d6d to 6d5bb22 Compare November 17, 2025 05:01
@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02 jslee02 enabled auto-merge (squash) November 17, 2025 14:37
@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02
Copy link
Member Author

jslee02 commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jslee02 jslee02 marked this pull request as draft November 17, 2025 17:46
auto-merge was automatically disabled November 17, 2025 17:46

Pull request was converted to draft

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.29%. Comparing base (827dd87) to head (4edfeae).
⚠️ Report is 321 commits behind head on main.

Files with missing lines Patch % Lines
dart/optimizer/ipopt/IpoptSolver.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2194      +/-   ##
==========================================
- Coverage   61.75%   61.29%   -0.47%     
==========================================
  Files         388      363      -25     
  Lines       33216    32043    -1173     
  Branches     4214     4090     -124     
==========================================
- Hits        20512    19640     -872     
+ Misses      12704    12403     -301     
Flag Coverage Δ
unittests 61.29% <0.00%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dart/optimizer/ipopt/IpoptSolver.cpp 74.24% <0.00%> (ø)

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jslee02 jslee02 marked this pull request as ready for review November 18, 2025 03:34
@jslee02 jslee02 merged commit 3668a90 into main Nov 18, 2025
25 of 33 checks passed
@jslee02 jslee02 deleted the dart_coll_targets branch November 18, 2025 03:34
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.

1 participant