5 #include <gtest/gtest.h> 41 X_st.
E = X_66_matrix.block<3, 3>(0, 0);
55 EXPECT_STREQ(
"Reference frames do not match!", e.
what());
70 SpatialInertia I(model->bodyFrames[1], 1.,
Vector3d(0.1, 1.1, 2.1), 0.1, 0.2, 0.3, 0.4, 0.5, 0.6);
100 for (
size_t i = 1; i < model->mBodies.size(); i++)
104 SpatialMotion m(bodyFrame, parentBodyFrame, bodyFrame, model->v[i]);
107 SpatialInertia I(bodyFrame, inertia(3, 3),
Vector3d(inertia(2, 4), inertia(0, 5), inertia(1, 3)), inertia(0, 0), inertia(0, 1), inertia(1, 1), inertia(0, 2),
108 inertia(1, 2), inertia(2, 2));
111 EXPECT_EQ(momentum * m, 0.5 * model->v[i].transpose() * (model->Ic[i] * model->v[i]));
125 X_st.
E = X_66_matrix.block<3, 3>(0, 0);
129 Momentum v(1.1, 2.1, 3.1, 4.1, 5.1, 6.1);
140 int main(
int argc,
char** argv)
142 ::testing::InitGoogleTest(&argc, argv);
143 return RUN_ALL_TESTS();
ReferenceFramePtr getReferenceFrame() const
Get a pointer to the reference frame this FrameObject is expressed in.
SpatialMatrix Xrotx_mat(const double &xrot)
Creates a rotational transformation around the X-axis.
A custom exception for frame operations.
SpatialMatrix Xtrans_mat(const Vector3d &displacement)
Creates a transformation of a linear displacement.
A ForceVector is a SpatialVector containing 3 moments and 3 linear forces.
static ReferenceFramePtr getWorldFrame()
Get a pointer to the world frame.
virtual const char * what() const
void transform(const SpatialTransform &X)
Performs the following in place transform .
A SpatialMomentum is a Momentum expressed in a RobotDynamics::ReferenceFrame. The angular portion of ...
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
Momentum is mass/inertia multiplied by velocity.
virtual void changeFrame(ReferenceFramePtr desiredFrame)
Change the ReferenceFrame this FrameObject is expressed in.
A SpatialMotion vector is a MotionVector with a RobotDynamics::ReferenceFrame it is expressed in...
int main(int argc, char **argv)
ReferenceFrame object used to tell what frame objects are expressed in. Every ReferenceFrame has a po...
A Math::SpatialInertia is a RigidBodyInertia explicitly expressed in a RobotDynamics::ReferenceFrame...
void updateKinematics(Model &model, const Math::VectorNd &Q, const Math::VectorNd &QDot, const Math::VectorNd &QDDot)
Updates and computes velocities and accelerations of the bodies.
SpatialMatrix Xroty_mat(const double &yrot)
Creates a rotational transformation around the Y-axis.
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.
static bool checkSpatialVectorsEpsilonClose(const RobotDynamics::Math::SpatialVector &v1, const RobotDynamics::Math::SpatialVector &v2, const double epsilon)
SpatialMatrix toMatrix() const
TEST_F(SpatialMomentumTests, testKineticEnergyFrameAssertion)
void setIncludingFrame(ReferenceFramePtr referenceFrame, const RigidBodyInertia &inertia, const MotionVector &vector)
Set a momentum by multiplying the supplied motion vector by the supplied inertia. Set the stored Robo...
SpatialMatrix Xrotz_mat(const double &zrot)
Creates a rotational transformation around the Z-axis.