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

Function createTwoLinkSkeleton

tests/integration/test_InvalidDynamicsInputs.cpp:48–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46namespace {
47
48SkeletonPtr createTwoLinkSkeleton(double childMass, double childInertia)
49{
50 auto skeleton = Skeleton::create("invalid_dynamics_skeleton");
51
52 auto rootPair = skeleton->createJointAndBodyNodePair<RevoluteJoint>();
53 auto* rootBody = rootPair.second;
54 rootBody->setMass(1.0);
55 rootBody->setMomentOfInertia(1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
56
57 auto childPair
58 = skeleton->createJointAndBodyNodePair<RevoluteJoint>(rootBody);
59 auto* childBody = childPair.second;
60 childBody->setMass(childMass);
61 childBody->setMomentOfInertia(
62 childInertia, childInertia, childInertia, 0.0, 0.0, 0.0);
63
64 return skeleton;
65}
66
67SkeletonPtr createBoxSkeleton(
68 const std::string& name,

Callers 1

TESTFunction · 0.85

Calls 2

setMomentOfInertiaMethod · 0.80
setMassMethod · 0.45

Tested by

no test coverage detected