Skip to content

Commit 433719e

Browse files
authored
Merge branch 'main' into issue/1096_float_equal
2 parents 235fc95 + 67c78d2 commit 433719e

24 files changed

+1526
-877
lines changed

.github/workflows/ci_macos.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
- name: Checkout
4747
uses: actions/checkout@v5
4848

49+
- name: Remove preinstalled pixi (if any)
50+
run: rm -f "$HOME/.pixi/bin/pixi"
51+
4952
- name: Setup pixi
5053
uses: prefix-dev/[email protected]
5154
with:
@@ -89,6 +92,9 @@ jobs:
8992
- name: Checkout
9093
uses: actions/checkout@v5
9194

95+
- name: Remove preinstalled pixi (if any)
96+
run: rm -f "$HOME/.pixi/bin/pixi"
97+
9298
- name: Setup pixi
9399
uses: prefix-dev/[email protected]
94100
with:

.github/workflows/ci_ubuntu.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
- name: Checkout
5252
uses: actions/checkout@v5
5353

54+
- name: Remove preinstalled pixi (if any)
55+
run: rm -f "$HOME/.pixi/bin/pixi"
56+
5457
- name: Setup pixi
5558
uses: prefix-dev/[email protected]
5659
with:
@@ -107,6 +110,9 @@ jobs:
107110
- name: Checkout
108111
uses: actions/checkout@v5
109112

113+
- name: Remove preinstalled pixi (if any)
114+
run: rm -f "$HOME/.pixi/bin/pixi"
115+
110116
- name: Setup pixi
111117
uses: prefix-dev/[email protected]
112118
with:
@@ -166,6 +172,9 @@ jobs:
166172
- name: Checkout
167173
uses: actions/checkout@v5
168174

175+
- name: Remove preinstalled pixi (if any)
176+
run: rm -f "$HOME/.pixi/bin/pixi"
177+
169178
- name: Setup pixi
170179
uses: prefix-dev/[email protected]
171180
with:

.github/workflows/ci_windows.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
uses: prefix-dev/[email protected]
5555
with:
5656
cache: true
57+
run-install: true
5758

5859
- name: Setup sccache
5960
uses: mozilla-actions/[email protected]
@@ -82,9 +83,4 @@ jobs:
8283
$env:BUILD_TYPE = "${{ matrix.build_type }}"
8384
pixi run test-no-plane OFF
8485
85-
- name: Install (dartpy disabled)
86-
run: |
87-
$ErrorActionPreference = "Stop"
88-
$env:BUILD_TYPE = "${{ matrix.build_type }}"
89-
$env:DART_VERBOSE = "ON"
90-
pixi run install OFF
86+
# Skip install on Windows to keep job runtimes within limits; Linux covers install path.

.github/workflows/publish_dartpy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
build_wheels:
4343
name: Wheels | ${{ matrix.os }} Py${{ matrix.python-version }}
4444
runs-on: ${{ matrix.os }}
45+
env:
46+
# Keep parallelism modest to avoid posix_spawn failures on hosted runners
47+
DART_PARALLEL_JOBS: 8
48+
CMAKE_BUILD_PARALLEL_LEVEL: 8
4549
# Note: No dedicated container image is used; all platforms rely on pixi environments.
4650
# Linux wheels: auditwheel derives the glibc compatibility tag from bundled symbols.
4751
# macOS wheels: delocate bundles dylibs. Windows wheels: delvewheel bundles DLLs.
@@ -72,6 +76,10 @@ jobs:
7276
- uses: actions/checkout@v5
7377
if: (matrix.skip-on-commit != true) || github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/v')
7478

79+
- name: Remove preinstalled pixi (if any)
80+
if: (matrix.skip-on-commit != true) || github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/v')
81+
run: rm -f "$HOME/.pixi/bin/pixi"
82+
7583
- uses: prefix-dev/[email protected]
7684
if: (matrix.skip-on-commit != true) || github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/v')
7785
with:

cmake/dart8_defs.cmake

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,34 @@ function(dart8_add_test TEST_NAME TEST_PATH)
406406
)
407407

408408
# Add to CTest with dart8 label for easy filtering
409-
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
410-
set_tests_properties(${TEST_NAME} PROPERTIES
411-
LABELS "dart8"
409+
add_test(NAME ${TEST_NAME} COMMAND $<TARGET_FILE:${TEST_NAME}>)
410+
set_tests_properties(
411+
${TEST_NAME}
412+
PROPERTIES
413+
LABELS "dart8"
412414
)
415+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22")
416+
set_tests_properties(
417+
${TEST_NAME}
418+
PROPERTIES
419+
ENVIRONMENT_MODIFICATION
420+
"PATH=path_list_prepend:$<TARGET_FILE_DIR:dart8>"
421+
)
422+
else()
423+
if(WIN32)
424+
# Escape the semicolon so CMake does not treat it as a list separator.
425+
set(_dart8_test_path_sep "\\;")
426+
else()
427+
set(_dart8_test_path_sep ":")
428+
endif()
429+
set_property(
430+
TEST ${TEST_NAME}
431+
PROPERTY
432+
ENVIRONMENT
433+
"PATH=$<TARGET_FILE_DIR:dart8>${_dart8_test_path_sep}$ENV{PATH}"
434+
)
435+
unset(_dart8_test_path_sep)
436+
endif()
413437

414438
# Set target properties
415439
set_target_properties(${TEST_NAME} PROPERTIES

dart/collision/CollisionOption.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ struct DART_API CollisionOption
5454

5555
/// Maximum number of contacts to detect. Once the contacts are found up to
5656
/// this number, the collision checking will terminate at that moment. Set
57-
/// this to 1 for binary check.
57+
/// this to 1 for binary check. A value of 0 short-circuits collision
58+
/// detection and returns false immediately.
5859
std::size_t maxNumContacts;
5960

6061
/// CollisionFilter

dart/collision/bullet/BulletCollisionDetector.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,12 @@ bool BulletCollisionDetector::collide(
229229
if (result)
230230
result->clear();
231231

232-
if (0u == option.maxNumContacts)
232+
if (0u == option.maxNumContacts) {
233+
DART_WARN(
234+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
235+
"Use maxNumContacts >= 1 for binary checks.");
233236
return false;
237+
}
234238

235239
// Check if 'this' is the collision engine of 'group'.
236240
if (!checkGroupValidity(this, group))
@@ -268,8 +272,12 @@ bool BulletCollisionDetector::collide(
268272
if (result)
269273
result->clear();
270274

271-
if (0u == option.maxNumContacts)
275+
if (0u == option.maxNumContacts) {
276+
DART_WARN(
277+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
278+
"Use maxNumContacts >= 1 for binary checks.");
272279
return false;
280+
}
273281

274282
if (!checkGroupValidity(this, group1))
275283
return false;

dart/collision/dart/DARTCollisionDetector.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "dart/collision/dart/DARTCollide.hpp"
3838
#include "dart/collision/dart/DARTCollisionGroup.hpp"
3939
#include "dart/collision/dart/DARTCollisionObject.hpp"
40+
#include "dart/common/Logging.hpp"
4041
#include "dart/dynamics/BoxShape.hpp"
4142
#include "dart/dynamics/EllipsoidShape.hpp"
4243
#include "dart/dynamics/ShapeFrame.hpp"
@@ -128,8 +129,12 @@ bool DARTCollisionDetector::collide(
128129
if (result)
129130
result->clear();
130131

131-
if (0u == option.maxNumContacts) [[unlikely]]
132+
if (0u == option.maxNumContacts) [[unlikely]] {
133+
DART_WARN(
134+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
135+
"Use maxNumContacts >= 1 for binary checks.");
132136
return false;
137+
}
133138

134139
if (!checkGroupValidity(this, group))
135140
return false;
@@ -179,8 +184,12 @@ bool DARTCollisionDetector::collide(
179184
if (result)
180185
result->clear();
181186

182-
if (0u == option.maxNumContacts)
187+
if (0u == option.maxNumContacts) {
188+
DART_WARN(
189+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
190+
"Use maxNumContacts >= 1 for binary checks.");
183191
return false;
192+
}
184193

185194
if (!checkGroupValidity(this, group1))
186195
return false;

dart/collision/fcl/FCLCollisionDetector.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,12 @@ bool FCLCollisionDetector::collide(
654654
if (result)
655655
result->clear();
656656

657-
if (0u == option.maxNumContacts)
657+
if (0u == option.maxNumContacts) {
658+
DART_WARN(
659+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
660+
"Use maxNumContacts >= 1 for binary checks.");
658661
return false;
662+
}
659663

660664
if (!checkGroupValidity(this, group))
661665
return false;
@@ -683,8 +687,12 @@ bool FCLCollisionDetector::collide(
683687
if (result)
684688
result->clear();
685689

686-
if (0u == option.maxNumContacts)
690+
if (0u == option.maxNumContacts) {
691+
DART_WARN(
692+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
693+
"Use maxNumContacts >= 1 for binary checks.");
687694
return false;
695+
}
688696

689697
if (!checkGroupValidity(this, group1))
690698
return false;

dart/collision/ode/OdeCollisionDetector.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "dart/collision/ode/OdeCollisionGroup.hpp"
3838
#include "dart/collision/ode/OdeCollisionObject.hpp"
3939
#include "dart/collision/ode/OdeTypes.hpp"
40+
#include "dart/common/Logging.hpp"
4041
#include "dart/common/Macros.hpp"
4142
#include "dart/dynamics/BoxShape.hpp"
4243
#include "dart/dynamics/CapsuleShape.hpp"
@@ -214,6 +215,13 @@ bool OdeCollisionDetector::collide(
214215
const CollisionOption& option,
215216
CollisionResult* result)
216217
{
218+
if (0u == option.maxNumContacts) {
219+
DART_WARN(
220+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
221+
"Use maxNumContacts >= 1 for binary checks.");
222+
return false;
223+
}
224+
217225
auto odeGroup = static_cast<OdeCollisionGroup*>(group);
218226
odeGroup->updateEngineData();
219227

@@ -237,6 +245,13 @@ bool OdeCollisionDetector::collide(
237245
const CollisionOption& option,
238246
CollisionResult* result)
239247
{
248+
if (0u == option.maxNumContacts) {
249+
DART_WARN(
250+
"CollisionOption::maxNumContacts is 0; skipping collision detection. "
251+
"Use maxNumContacts >= 1 for binary checks.");
252+
return false;
253+
}
254+
240255
auto odeGroup1 = static_cast<OdeCollisionGroup*>(group1);
241256
odeGroup1->updateEngineData();
242257

0 commit comments

Comments
 (0)