SpatialRigidBodyInertiaTests.cpp
Go to the documentation of this file.
1 //
2 // Created by jordan on 9/28/16.
3 //
4 
5 #include <gtest/gtest.h>
6 #include "Fixtures.h"
8 #include "UnitTestUtils.hpp"
9 
10 using namespace RobotDynamics::Math;
11 
12 class SpatialRigidBodyInertiaTests : public testing::Test
13 {
14  public:
16  {
17  }
18 
19  void SetUp()
20  {
21  }
22 
23  void TearDown()
24  {
25  }
26 };
27 
29 {
30  SpatialInertia Ibody = model->I[1];
31  SpatialInertia I_2(model->bodyFrames[1], 3.2, Vector3d(-0.4, 1., 0.1), 1.2, 0.1, 0.2, 0.3, 0.4, 0.5);
32 
33  SpatialMatrix I_expected = Ibody.toMatrix() + I_2.toMatrix();
34 
35  SpatialInertia I_added = Ibody + I_2;
36 
38 }
39 
40 TEST_F(FixedBase3DoFPlanar, ChangeFrameTest)
41 {
42  SpatialInertia Ibody = model->I[1];
43  SpatialInertia Ibody_c = model->Ib_c[1];
44 
45  Ibody.changeFrame(model->bodyCenteredFrames[1]);
46 
48 
49  Ibody = model->I[3];
50  Ibody_c = model->Ib_c[3];
51 
52  Ibody_c.changeFrame(model->bodyFrames[3]);
53 
55 }
56 
57 int main(int argc, char** argv)
58 {
59  ::testing::InitGoogleTest(&argc, argv);
60  return RUN_ALL_TESTS();
61 }
const double TEST_PREC
TEST_F(FixedBase3DoFPlanar, testAdd)
virtual void changeFrame(ReferenceFramePtr desiredFrame)
Change the ReferenceFrame this FrameObject is expressed in.
Definition: FrameObject.cpp:12
int main(int argc, char **argv)
A Math::SpatialInertia is a RigidBodyInertia explicitly expressed in a RobotDynamics::ReferenceFrame...
static bool checkSpatialMatrixEpsilonClose(const RobotDynamics::Math::SpatialMatrix &t1, const RobotDynamics::Math::SpatialMatrix &t2, const double epsilon)
Math types such as vectors and matrices and utility functions.
Definition: ForceVector.hpp:21


rdl_dynamics
Author(s):
autogenerated on Tue Apr 20 2021 02:25:28