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

Function createBoxSkeleton

tests/integration/test_InvalidDynamicsInputs.cpp:67–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67SkeletonPtr createBoxSkeleton(
68 const std::string& name,
69 const Eigen::Vector3d& size,
70 const Eigen::Vector3d& position,
71 double mass,
72 double inertia)
73{
74 auto skeleton = Skeleton::create(name);
75 auto pair = skeleton->createJointAndBodyNodePair<FreeJoint>();
76 auto* body = pair.second;
77
78 body->setMass(mass);
79 body->setMomentOfInertia(inertia, inertia, inertia, 0.0, 0.0, 0.0);
80
81 auto shape = std::make_shared<BoxShape>(size);
82 body->createShapeNodeWith<VisualAspect, CollisionAspect, DynamicsAspect>(
83 shape);
84
85 Eigen::Vector6d positions = Eigen::Vector6d::Zero();
86 positions.tail<3>() = position;
87 skeleton->setPositions(positions);
88
89 return skeleton;
90}
91
92} // namespace
93

Callers 1

TESTFunction · 0.85

Calls 3

setMomentOfInertiaMethod · 0.80
setMassMethod · 0.45
setPositionsMethod · 0.45

Tested by

no test coverage detected