3 #include <gtest/gtest.h> 35 EXPECT_EQ(orientation.
x(), 1.);
36 EXPECT_EQ(orientation.
y(), 2.);
37 EXPECT_EQ(orientation.
z(), 3.);
38 EXPECT_EQ(orientation.
w(), 4.);
98 std::shared_ptr<ReferenceFrame> f2(
new ReferenceFrame(
"f2", f1, X2,
true, 1));
100 std::shared_ptr<ReferenceFrame> f3(
new ReferenceFrame(
"f3", f2, X3,
true, 1));
110 orientation = orientation_copy;
115 EXPECT_STREQ(orientation.getReferenceFrame()->getName().c_str(),
"f1");
118 orientation = orientation_copy;
122 EXPECT_STREQ(orientation.getReferenceFrame()->getName().c_str(),
"world");
161 int main(
int argc,
char** argv)
163 ::testing::InitGoogleTest(&argc, argv);
164 ::testing::FLAGS_gtest_death_test_style =
"threadsafe";
165 return RUN_ALL_TESTS();
EIGEN_STRONG_INLINE double & w()
ReferenceFramePtr getReferenceFrame() const
Get a pointer to the reference frame this FrameObject is expressed in.
Describes all properties of a single body.
void SetQuaternion(unsigned int i, const Math::Quaternion &quat, Math::VectorNd &Q) const
Sets the quaternion for body i (only valid if body i is connected by a JointTypeSpherical joint) ...
SpatialTransform Xroty(const double &yrot)
Get transform with zero translation and pure rotation about y axis.
Fixed joint which causes the inertial properties to be merged with.
static Quaternion toQuaternion(const Vector3d &axis, double angle_rad)
Get quaternion representation of axis and angle.
static bool checkVector4dEpsilonClose(const RobotDynamics::Math::Vector4d &v1, const RobotDynamics::Math::Vector4d &v2, const double epsilon)
static ReferenceFramePtr getWorldFrame()
Get a pointer to the world frame.
Math::MotionVector gravity
the cartesian vector of the gravity
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.
ReferenceFramePtr worldFrame
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.
ReferenceFramePtr getReferenceFrame(const std::string &frameName) const
Get a fixed or moveable body's reference frame.
SpatialTransform Xrotz(const double &zrot)
Get transform with zero translation and pure rotation about z axis.
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
unsigned int q_size
The size of the -vector. For models without spherical joints the value is the same as Model::dof_coun...
virtual void changeFrame(ReferenceFramePtr desiredFrame)
Change the ReferenceFrame this FrameObject is expressed in.
EIGEN_STRONG_INLINE double & y()
Describes a joint relative to the predecessor body.
ReferenceFrame object used to tell what frame objects are expressed in. Every ReferenceFrame has a po...
Quaternion that are used for singularity free joints.
Contains all information about the rigid body model.
A 6-DoF joint for floating-base (or freeflyer) systems.
void updateKinematicsCustom(Model &model, const Math::VectorNd *Q, const Math::VectorNd *QDot=nullptr, const Math::VectorNd *QDDot=nullptr)
Selectively updates model internal states of body positions, velocities and/or accelerations.
EIGEN_STRONG_INLINE double & x()
Math types such as vectors and matrices and utility functions.
EIGEN_STRONG_INLINE double & z()
A Frame object that represents an orientation(quaternion) relative to a reference frame...
TEST_F(FrameOrientationTest, setters)
void set(double x, double y, double z, double w)
FrameOrientation changeFrameAndCopy(ReferenceFramePtr referenceFrame) const
int main(int argc, char **argv)
Eigen::AngleAxisd AxisAngle
static Matrix3d toMatrix(const Quaternion &q)
Convert quaternion to rotation matrix.
Namespace for all structures of the RobotDynamics library.
unsigned int qdot_size
The size of the.
static AxisAngle toAxisAngle(Quaternion q)
Get axis angle representation of a quaternion.