6 #include <gtest/gtest.h> 35 body_a_id = model->addBody(0,
Xtrans(
Vector3d(0., 0., 0.)), joint_a, body_a);
40 body_b_id = model->addBody(1,
Xtrans(
Vector3d(1., 0., 0.)), joint_b, body_b);
45 body_c_id = model->addBody(2,
Xtrans(
Vector3d(0., 1., 0.)), joint_c, body_c);
47 Q = VectorNd::Constant((
size_t)model->dof_count, 0.);
48 QDot = VectorNd::Constant((
size_t)model->dof_count, 0.);
50 point_position = Vector3d::Zero(3);
51 point_velocity.setToZero();
78 point_position =
Vector3d(1., 0., 0.);
93 point_position =
Vector3d(1., 0., 0.);
107 point_position =
Vector3d(1., 0., 0.);
123 point_position =
Vector3d(1., -1., 0.);
137 point_position =
Vector3d(1., -1., 0.);
154 ref_body_id = body_b_id;
155 point_position =
Vector3d(0., 0., 0.);
222 int main(
int argc,
char** argv)
224 ::testing::InitGoogleTest(&argc, argv);
225 return RUN_ALL_TESTS();
Joint joint_rot_z(SpatialVector(0., 0., 1., 0., 0., 0.))
Describes all properties of a single body.
FrameVector point_velocity
int main(int argc, char **argv)
RdlModelVelocitiesFixture()
SpatialTransform Xtrans(const Vector3d &r)
Get pure translation transform.
Fixed joint which causes the inertial properties to be merged with.
unsigned int appendBody(const Math::SpatialTransform &joint_frame, const Joint &joint, const Body &body, std::string body_name="")
Adds a Body to the model such that the previously added Body is the Parent.
unsigned int addBody(const unsigned int parent_id, const Math::SpatialTransform &joint_frame, const Joint &joint, const Body &body, std::string body_name="")
Connects a given body to the model.
Math::FrameVector calcPointVelocity(Model &model, const Math::VectorNd &Q, const Math::VectorNd &QDot, unsigned int body_id, const Math::Vector3d &point_position, bool update_kinematics=true)
Computes the velocity of a point on a body.
TEST_F(RdlModelVelocitiesFixture, TestCalcPointSimple)
A FrameVector is a 3D vector with a ReferenceFrame, and all operations between FrameVectors and other...
Describes a joint relative to the predecessor body.
Contains all information about the rigid body model.
Math types such as vectors and matrices and utility functions.
static bool checkVector3dEpsilonClose(const RobotDynamics::Math::Vector3d &v1, const RobotDynamics::Math::Vector3d &v2, const double epsilon)
unsigned int dof_count
number of degrees of freedoms of the model
Namespace for all structures of the RobotDynamics library.