MicroMouse Control Module  v1.3.2-2-ge2c6882
公開メンバ関数 | 公開変数類 | フレンド | 全メンバ一覧
ctrl::Pose 構造体

位置姿勢の座標 [詳解]

#include <pose.h>

公開メンバ関数

constexpr Pose (const float x=0, const float y=0, const float th=0)
 
void clear ()
 
Pose mirror_x () const
 
Pose rotate (const float angle) const
 
Pose homogeneous (const Pose &offset) const
 
Poseoperator+= (const Pose &o)
 
Poseoperator-= (const Pose &o)
 
Pose operator+ (const Pose &o) const
 
Pose operator- (const Pose &o) const
 

公開変数類

float x
 x 成分 [m] [詳解]
 
float y
 y 成分 [m] [詳解]
 
float th
 theta 成分 [rad] [詳解]
 

フレンド

std::ostream & operator<< (std::ostream &os, const Pose &o)
 

詳解

位置姿勢の座標

構築子と解体子

◆ Pose()

constexpr ctrl::Pose::Pose ( const float  x = 0,
const float  y = 0,
const float  th = 0 
)
inlineconstexpr
25  : x(x), y(y), th(th) {}
float y
y 成分 [m]
Definition: pose.h:20
float x
x 成分 [m]
Definition: pose.h:19
float th
theta 成分 [rad]
Definition: pose.h:21

関数詳解

◆ clear()

void ctrl::Pose::clear ( )
inline
26 { x = y = th = 0; }

◆ homogeneous()

Pose ctrl::Pose::homogeneous ( const Pose offset) const
inline
33  {
34  return offset + this->rotate(offset.th);
35  }
Pose rotate(const float angle) const
Definition: pose.h:28
呼び出し関係図:

◆ mirror_x()

Pose ctrl::Pose::mirror_x ( ) const
inline
27 { return Pose(x, -y, -th); }
constexpr Pose(const float x=0, const float y=0, const float th=0)
Definition: pose.h:24
呼び出し関係図:

◆ operator+()

Pose ctrl::Pose::operator+ ( const Pose o) const
inline
42 { return {x + o.x, y + o.y, th + o.th}; }

◆ operator+=()

Pose& ctrl::Pose::operator+= ( const Pose o)
inline
36  {
37  return x += o.x, y += o.y, th += o.th, *this;
38  }

◆ operator-()

Pose ctrl::Pose::operator- ( const Pose o) const
inline
43 { return {x - o.x, y - o.y, th - o.th}; }

◆ operator-=()

Pose& ctrl::Pose::operator-= ( const Pose o)
inline
39  {
40  return x -= o.x, y -= o.y, th -= o.th, *this;
41  }

◆ rotate()

Pose ctrl::Pose::rotate ( const float  angle) const
inline
28  {
29  const float cos_angle = std::cos(angle);
30  const float sin_angle = std::sin(angle);
31  return {x * cos_angle - y * sin_angle, x * sin_angle + y * cos_angle, th};
32  }

フレンドと関連関数の詳解

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Pose o 
)
friend
44  {
45  return os << "(" << o.x << ", " << o.y << ", " << o.th << ")";
46  }

メンバ詳解

◆ th

float ctrl::Pose::th

theta 成分 [rad]

◆ x

float ctrl::Pose::x

x 成分 [m]

◆ y

float ctrl::Pose::y

y 成分 [m]


この構造体詳解は次のファイルから抽出されました: