YARP
Yet Another Robot Platform
FrameTransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_MATH_TRANSFORM_H
10 #define YARP_MATH_TRANSFORM_H
11 
12 #include <yarp/sig/Vector.h>
13 #include <yarp/sig/Matrix.h>
14 #include <yarp/math/api.h>
15 #include <yarp/math/Quaternion.h>
16 
17 namespace yarp {
18 namespace math {
19 
21 {
22 public:
25  double timestamp;
26 
28  {
29  double tX;
30  double tY;
31  double tZ;
32 
33  void set(double x, double y, double z)
34  {
35  tX = x;
36  tY = y;
37  tZ = z;
38  }
39  } translation;
40 
42 
44 
45  FrameTransform(const std::string& parent,
46  const std::string& child,
47  double inTX,
48  double inTY,
49  double inTZ,
50  double inRX,
51  double inRY,
52  double inRZ,
53  double inRW);
54 
56 
57  void transFromVec(double X, double Y, double Z);
58  void rotFromRPY(double R, double P, double Y);
59  yarp::sig::Vector getRPYRot() const;
60 
61  yarp::sig::Matrix toMatrix() const;
62  bool fromMatrix(const yarp::sig::Matrix& mat);
63 
65  {
66  rotation_as_quaternion=0,
67  rotation_as_matrix=1,
68  rotation_as_rpy=2
69  };
70  std::string toString(display_transform_mode_t format= rotation_as_quaternion) const;
71 };
72 
73 } // namespace sig
74 } // namespace yarp
75 
76 #endif // YARP_MATH_TRANSFORM_H
yarp::math::FrameTransform::Translation_t::tY
double tY
Definition: FrameTransform.h:30
yarp::math::FrameTransform
Definition: FrameTransform.h:21
Vector.h
contains the definition of a Vector type
yarp::math::FrameTransform::~FrameTransform
~FrameTransform()
YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)
Suppress MSVC C4251 warning for the declaration.
Definition: system.h:339
Matrix.h
contains the definition of a Matrix type
yarp::math::FrameTransform::Translation_t::tX
double tX
Definition: FrameTransform.h:29
Quaternion.h
yarp::sig::VectorOf< double >
yarp::math::FrameTransform::Translation_t
Definition: FrameTransform.h:28
yarp::math::Quaternion
Definition: Quaternion.h:27
yarp::math::FrameTransform::timestamp
double timestamp
Definition: FrameTransform.h:25
yarp::math::FrameTransform::dst_frame_id
std::string dst_frame_id
Definition: FrameTransform.h:24
toString
std::string toString(const T &value)
convert an arbitrary type to string.
Definition: fakeMotionControl.cpp:121
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::math::FrameTransform::src_frame_id
std::string src_frame_id
Definition: FrameTransform.h:23
yarp::math::FrameTransform::rotation
Quaternion rotation
Definition: FrameTransform.h:41
YARP_math_API
#define YARP_math_API
Definition: api.h:18
yarp::math::FrameTransform::Translation_t::tZ
double tZ
Definition: FrameTransform.h:31
yarp::math::FrameTransform::display_transform_mode_t
display_transform_mode_t
Definition: FrameTransform.h:65
yarp::math::FrameTransform::Translation_t::set
void set(double x, double y, double z)
Definition: FrameTransform.h:33
api.h
yarp::sig::Matrix
A class for a Matrix.
Definition: Matrix.h:46