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

Function TEST

tests/integration/test_World.cpp:61–184  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

59
60//==============================================================================
61TEST(World, AddingAndRemovingSkeletons)
62{
63 // World
64 WorldPtr world = World::create();
65
66 //-------------------- Test World::removeSkeleton() ------------------------
67 SkeletonPtr skeleton1 = createThreeLinkRobot(
68 Eigen::Vector3d(1.0, 1.0, 1.0),
69 DOF_X,
70 Eigen::Vector3d(1.0, 1.0, 1.0),
71 DOF_Y,
72 Eigen::Vector3d(1.0, 1.0, 1.0),
73 DOF_Z,
74 false,
75 false);
76
77 SkeletonPtr skeleton2 = createThreeLinkRobot(
78 Eigen::Vector3d(1.0, 1.0, 1.0),
79 DOF_X,
80 Eigen::Vector3d(1.0, 1.0, 1.0),
81 DOF_Y,
82 Eigen::Vector3d(1.0, 1.0, 1.0),
83 DOF_Z,
84 false,
85 false);
86
87 SkeletonPtr skeleton3 = createThreeLinkRobot(
88 Eigen::Vector3d(1.0, 1.0, 1.0),
89 DOF_X,
90 Eigen::Vector3d(1.0, 1.0, 1.0),
91 DOF_Y,
92 Eigen::Vector3d(1.0, 1.0, 1.0),
93 DOF_Z,
94 false,
95 false);
96
97 SkeletonPtr skeleton4 = createThreeLinkRobot(
98 Eigen::Vector3d(1.0, 1.0, 1.0),
99 DOF_X,
100 Eigen::Vector3d(1.0, 1.0, 1.0),
101 DOF_Y,
102 Eigen::Vector3d(1.0, 1.0, 1.0),
103 DOF_Z,
104 false,
105 false);
106
107 int nSteps = 20;
108
109 // Empty world
110 for (int i = 0; i < nSteps; ++i)
111 world->step();
112
113 EXPECT_FALSE(world->hasSkeleton(skeleton1));
114 EXPECT_FALSE(world->hasSkeleton(skeleton2));
115 EXPECT_FALSE(world->hasSkeleton(skeleton3));
116 EXPECT_FALSE(world->hasSkeleton(skeleton4));
117
118 // Add skeleton1, skeleton2

Callers

nothing calls this directly

Calls 15

createThreeLinkRobotFunction · 0.85
stepMethod · 0.80
setCollisionDetectorMethod · 0.80
getConstraintSolverMethod · 0.80
setConstraintSolverMethod · 0.80
getIndexMethod · 0.80
readWorldFunction · 0.70
equalsFunction · 0.70
createWorldFunction · 0.70
hasSkeletonMethod · 0.45
addSkeletonMethod · 0.45
getNumSkeletonsMethod · 0.45

Tested by

no test coverage detected