ARGoS  3
A parallel, multi-engine simulator for swarm robotics
transformationmatrix2.cpp
Go to the documentation of this file.
1 
10 #include "rotationmatrix2.h"
11 #include <argos3/core/utility/math/vector2.h>
12 
13 namespace argos {
14 
15  void CTransformationMatrix2::SetFromComponents(const CRotationMatrix2& c_rotation, const CVector2& c_translation) {
16  /* Set the rotation elements */
17  SetRotationMatrix(c_rotation);
18 
19  /* Set the translation elements */
20  SetTranslationVector(c_translation);
21 
22  /* Set the bottom row elements */
23  m_pfValues[6] = 0.0f; m_pfValues[7] = 0.0f; m_pfValues[8] = 1.0f;
24  }
25 
27  m_pfValues[0] = c_matrix.m_pfValues[0];
28  m_pfValues[1] = c_matrix.m_pfValues[1];
29  m_pfValues[2] = c_matrix.m_pfValues[2];
30  m_pfValues[3] = c_matrix.m_pfValues[3];
31  m_pfValues[4] = c_matrix.m_pfValues[4];
32  m_pfValues[5] = c_matrix.m_pfValues[5];
33  m_pfValues[6] = c_matrix.m_pfValues[6];
34  m_pfValues[7] = c_matrix.m_pfValues[7];
35  m_pfValues[8] = c_matrix.m_pfValues[8];
36  }
37 
38  void CTransformationMatrix2::SetFromValues(Real f_value0, Real f_value1, Real f_value2,
39  Real f_value3, Real f_value4, Real f_value5,
40  Real f_value6, Real f_value7, Real f_value8) {
41  m_pfValues[0] = f_value0;
42  m_pfValues[1] = f_value1;
43  m_pfValues[2] = f_value2;
44  m_pfValues[3] = f_value3;
45  m_pfValues[4] = f_value4;
46  m_pfValues[5] = f_value5;
47  m_pfValues[6] = f_value6;
48  m_pfValues[7] = f_value7;
49  m_pfValues[8] = f_value8;
50  }
51 
53  m_pfValues[0] = c_rotation.m_pfValues[0]; m_pfValues[1] = c_rotation.m_pfValues[1];
54  m_pfValues[3] = c_rotation.m_pfValues[2]; m_pfValues[4] = c_rotation.m_pfValues[3];
55  }
56 
59  m_pfValues[3], m_pfValues[4]);
60  }
61 
63  m_pfValues[2] = c_translation.m_fX;
64  m_pfValues[5] = c_translation.m_fY;
65  }
66 
68  return CVector2(m_pfValues[2], m_pfValues[5]);
69  }
70 
71  /****************************************/
72  /****************************************/
73 }
argos::CRotationMatrix2
Definition: rotationmatrix2.h:21
argos::CTransformationMatrix2::GetTranslationVector
const CVector2 GetTranslationVector() const
Definition: transformationmatrix2.cpp:67
transformationmatrix2.h
argos::CTransformationMatrix2::SetTranslationVector
void SetTranslationVector(const CVector2 &c_translation)
Definition: transformationmatrix2.cpp:62
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CTransformationMatrix2::GetRotationMatrix
const CRotationMatrix2 GetRotationMatrix() const
Definition: transformationmatrix2.cpp:57
argos::CVector2
A 2D vector class.
Definition: vector2.h:25
argos::CMatrix< DIM, DIM >::m_pfValues
Real m_pfValues[ROWS *COLS]
Definition: matrix.h:214
argos::CTransformationMatrix2::SetFromComponents
void SetFromComponents(const CRotationMatrix2 &c_rotation, const CVector2 &c_translation)
Definition: transformationmatrix2.cpp:15
argos::CMatrix
Definition: matrix.h:20
argos::CTransformationMatrix2::SetFromValues
void SetFromValues(Real f_value0, Real f_value1, Real f_value2, Real f_value3, Real f_value4, Real f_value5, Real f_value6, Real f_value7, Real f_value8)
Definition: transformationmatrix2.cpp:38
rotationmatrix2.h
argos::CTransformationMatrix2::SetRotationMatrix
void SetRotationMatrix(const CRotationMatrix2 &c_rotation)
Definition: transformationmatrix2.cpp:52
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
argos::CMatrix< DIM, DIM >::CRotationMatrix2
friend class CRotationMatrix2
Definition: matrix.h:26
argos::CTransformationMatrix2::SetFromMatrix
void SetFromMatrix(const CMatrix< 3, 3 > &c_matrix)
Definition: transformationmatrix2.cpp:26