MCPcopy Create free account
hub / github.com/dartsim/dart / TEST

Function TEST

tests/integration/test_Issue719.cpp:194–213  ·  view source on GitHub ↗

============================================================================== Exercises PART A: the default World solver is a BoxedLcpConstraintSolver with the Dantzig primary and the PGS secondary solver. Stepping a non-axis-aligned closed loop must not produce NaN/Inf or abort.

Source from the content-addressed store, hash-verified

192// the Dantzig primary and the PGS secondary solver. Stepping a non-axis-aligned
193// closed loop must not produce NaN/Inf or abort.
194TEST(Issue719, NonAxisAlignedClosedLoopDefaultSolver)
195{
196 BodyNode* base = nullptr;
197 BodyNode* lastLink = nullptr;
198 Eigen::Vector3d loopAnchor = Eigen::Vector3d::Zero();
199 SkeletonPtr skel = createNonAxisAlignedFourBar(&base, &lastLink, loopAnchor);
200
201 WorldPtr world = World::create();
202 world->setGravity(Eigen::Vector3d(0.0, 0.0, -9.81));
203 world->addSkeleton(skel);
204
205 // Close the kinematic loop with a ball joint constraint between the last
206 // link and the base. This is what makes the chain a closed loop.
207 auto loopConstraint = std::make_shared<constraint::BallJointConstraint>(
208 lastLink, base, loopAnchor);
209 world->getConstraintSolver()->addConstraint(loopConstraint);
210
211 EXPECT_NO_FATAL_FAILURE(
212 stepAndCheckLoopClosed(world, skel, base, lastLink, loopAnchor));
213}
214
215//==============================================================================
216// Exercises PART B: with the secondary solver explicitly disabled (nullptr)

Callers

nothing calls this directly

Calls 8

stepAndCheckLoopClosedFunction · 0.85
getConstraintSolverMethod · 0.80
setConstraintSolverMethod · 0.80
setGravityMethod · 0.45
addSkeletonMethod · 0.45
addConstraintMethod · 0.45

Tested by

no test coverage detected