60 mrpt::math::CArrayDouble<2> m_coords;
70 CPose2D(const
double x,const
double y,const
double phi);
76 explicit CPose2D(const
CPose3D &);
79 CPose2D(const mrpt::math::TPose2D &);
88 inline const double &
phi()
const {
return m_phi; }
90 inline double &
phi() {
return m_phi; }
93 inline void phi(
double angle) { m_phi=angle; }
95 inline void phi_incr(
const double Aphi) { m_phi+=Aphi; }
114 void composeFrom(
const CPose2D &A,
const CPose2D &B);
125 void composePoint(
double lx,
double ly,
double &gx,
double &gy)
const;
135 void inverseComposeFrom(
const CPose2D& A,
const CPose2D& B );
148 void AddComponents(CPose2D &p);
157 composeFrom(*
this,b);
177 if (!m.fromMatlabStringFormat(s))
THROW_EXCEPTION(
"Malformed expression in ::fromString");
179 x( m.get_unsafe(0,0) );
180 y( m.get_unsafe(0,1) );
181 phi(
DEG2RAD(m.get_unsafe(0,2)) );
184 inline const double &operator[](
unsigned int i)
const
188 case 0:
return m_coords[0];
189 case 1:
return m_coords[1];
192 throw std::runtime_error(
"CPose2D::operator[]: Index of bounds.");
195 inline double &operator[](
unsigned int i)
199 case 0:
return m_coords[0];
200 case 1:
return m_coords[1];
203 throw std::runtime_error(
"CPose2D::operator[]: Index of bounds.");
211 enum { is_3D_val = 0 };
212 static inline bool is_3D() {
return is_3D_val!=0; }
213 enum { rotation_dimensions = 2 };
214 enum { is_PDF_val = 0 };
215 static inline bool is_PDF() {
return is_PDF_val!=0; }
231 static inline bool empty() {
return false; }
233 static inline void resize(
const size_t n) {
if (n!=
static_size)
throw std::logic_error(
format(
"Try to change the size of CPose2D to %u.",static_cast<unsigned>(n))); }