27 #include <boost/test/unit_test.hpp>
29 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
37 model.gravity.linear(Eigen::Vector3d(0, 0, -9.8));
40 Eigen::VectorXd
q = Eigen::VectorXd::Zero(
model.nq);
41 Eigen::VectorXd
v = Eigen::VectorXd::Zero(
model.nv);
42 Eigen::VectorXd
a = Eigen::VectorXd::Zero(
model.nv);
44 std::cout << std::setprecision(10);
46 Eigen::VectorXd expected(
model.nv);
47 expected << 0, 0, 1281.84, 0, -40.5132, 0, 4.4492, -1.5386, 0, -1.5386, -1.5386, 0, -4.4492,
48 -1.5386, 0, -1.5386, -1.5386, 0, -37.436, 0, 0, -2.548, 0, 0, 0.392, 0, 0.392, 0, -2.548, 0, 0,
50 q = Eigen::VectorXd::Zero(
model.nq);
51 v = Eigen::VectorXd::Zero(
model.nv);
52 a = Eigen::VectorXd::Zero(
model.nv);
54 BOOST_CHECK(expected.isApprox(
data.tau, 1e-12));
63 model.gravity.linear(Eigen::Vector3d(0, 0, -9.8));
66 Eigen::VectorXd
q = Eigen::VectorXd::Zero(
model.nq);
67 Eigen::VectorXd
v = Eigen::VectorXd::Zero(
model.nv);
68 Eigen::VectorXd
a = Eigen::VectorXd::Zero(
model.nv);
70 std::cout << std::setprecision(10);
72 Eigen::VectorXd expected(
model.nv);
73 expected << -48.10636, -73.218816, 1384.901025, -7.2292939, -186.342371, -20.6685852, -0.78887946,
74 -1.869651075, 1.8889752, -2.036768175, -2.105948175, -1.023232, -18.3738505, -4.133954895,
75 9.0456456, -4.276615035, -4.143427035, -2.534896, -180.338765, 15.71570676, -29.8639164,
76 -59.917862, -2.3307916, -2.7648728, -45.76782776, 3.4151272, -18.4320456, -4.5768072,
77 -76.60945104, -0.5897908, -2.640844, -63.93417064, 5.359156, -25.8309196, -6.976116;
78 q = Eigen::VectorXd::Zero(
model.nq);
81 a = Eigen::VectorXd::Zero(
model.nv);
84 BOOST_CHECK(expected.isApprox(
data.tau, 1e-7));
93 model.gravity.linear(Eigen::Vector3d(0, 0, -9.8));
96 Eigen::VectorXd
q = Eigen::VectorXd::Zero(
model.nq);
97 Eigen::VectorXd
v = Eigen::VectorXd::Zero(
model.nv);
98 Eigen::VectorXd
a = Eigen::VectorXd::Zero(
model.nv);
100 std::cout << std::setprecision(10);
101 Eigen::VectorXd expected(
model.nv);
102 expected << -15.3331636, -0.67891816, 1273.80521, 102.9435113, 110.3509945, 81.52296995,
103 13.31476408, 14.26606068, 3.682505252, 9.048274318, 4.663303518, 2.05308568, 12.54347834,
104 25.92680911, 6.327105656, 16.71123385, 8.96650473, 3.54200704, 70.15812475, 77.02410963,
105 73.81994844, 41.73185754, 28.75786872, 28.94251127, 31.65847724, 20.40431127, 18.18579154,
106 6.838471928, 50.44193173, 34.07362801, 34.53507156, 38.33983417, 24.61507156, 22.2842788,
108 q = Eigen::VectorXd::Zero(
model.nq);
114 BOOST_CHECK(expected.isApprox(
data.tau, 1e-6));
123 model.gravity.linear(Eigen::Vector3d(0, 0, -9.8));
126 Eigen::VectorXd
q = Eigen::VectorXd::Zero(
model.nq);
127 Eigen::VectorXd
v = Eigen::VectorXd::Zero(
model.nv);
128 Eigen::VectorXd
a = Eigen::VectorXd::Zero(
model.nv);
130 std::cout << std::setprecision(10);
132 Eigen::VectorXd expected(
model.nv);
133 expected << 5.367234435e-15, -2.587860481e-14, 1281.84, -133.3062501, 198.975587,
134 -7.120345979e-16, 15.06850407, 58.39287139, -22.14971864, 17.14327289, 1.291543104,
135 0.7402017048, -4.386231387, 22.73949408, -19.01681794, 0.8839600793, -0.3197599308,
136 -0.466827706, 65.47086697, 32.71449398, -4.250622066, -0.7937685568, -0.15349648, -1.070480752,
137 -3.066302263, -0.3557903212, -0.2183951073, 0.182684221, -0.6648425468, -2.902772493,
138 0.1250340934, 0.4402877138, -0.3158584741, -0.0865162794, 0.3918733239;
140 q[
i] = (
i - 1) / 10.;
141 v = Eigen::VectorXd::Zero(
model.nv);
142 a = Eigen::VectorXd::Zero(
model.nv);
147 BOOST_CHECK(expected.isApprox(
data.tau, 1e-6));
156 model.gravity.linear(Eigen::Vector3d(0, 0, -9.8));
159 Eigen::VectorXd
q = Eigen::VectorXd::Zero(
model.nq);
160 Eigen::VectorXd
v = Eigen::VectorXd::Zero(
model.nv);
161 Eigen::VectorXd
a = Eigen::VectorXd::Zero(
model.nv);
163 std::cout << std::setprecision(10);
164 Eigen::VectorXd expected(
model.nv);
165 expected << -1.911650826, 1.250211406, 1284.82058, -139.0188156, 201.744449, 1.554847332,
166 15.1910084, 59.27339983, -21.70753738, 17.84339797, 1.754639468, 0.670280632, -2.968778954,
167 23.0776205, -17.56870284, 1.765761886, 0.2889992363, -0.392159764, 68.83598707, 34.59002827,
168 -4.604435817, -0.3832225891, 1.085231916, -0.348635267, -2.831371037, -1.047616506,
169 -0.228384161, 0.5656880079, 1.302869049, 0.8481280783, 0.7042182131, 1.554751317, -0.3908790552,
170 -0.1294643218, 1.421077555;
172 q[
i] = (
i - 1) / 10.;
178 BOOST_CHECK(expected.isApprox(
data.tau, 1e-7));
181 BOOST_AUTO_TEST_SUITE_END()