Chassis v2.1.1
Chassisはロボコンでの足回り制御を行うためのC++ライブラリである。
Loading...
Searching...
No Matches
rct::Odom< N > Struct Template Reference

N個のエンコーダでオドメトリを行うクラス。 More...

#include <Odom.h>

Public Member Functions

 Odom (const Coordinate &pos={})
 コンストラクタ。現在位置を初期化する。
 
void integrate (const int(&dif_val)[N])
 エンコーダの変位の変化量を積分し、自己位置を計算する。
 
void set (const Coordinate &pos) noexcept
 自己位置を更新する。
 
const Coordinateget () const &noexcept
 推定された自己位置を返す。
 
Coordinate get () &&noexcept
 推定された自己位置を返す。
 

Static Public Member Functions

static constexpr int size () noexcept
 エンコーダ数を返す。
 

Detailed Description

template<int N>
struct rct::Odom< N >

N個のエンコーダでオドメトリを行うクラス。

Template Parameters
Nエンコーダ数。 N > 0 であること。

Definition at line 21 of file Odom.h.

Constructor & Destructor Documentation

◆ Odom()

template<int N>
rct::Odom< N >::Odom ( const Coordinate pos = {})

コンストラクタ。現在位置を初期化する。

Parameters
pos現在位置

Definition at line 26 of file Odom.h.

Member Function Documentation

◆ get() [1/2]

template<int N>
Coordinate rct::Odom< N >::get ( ) &&
noexcept

推定された自己位置を返す。

Returns
左辺値の文脈ではCoordinateのconst参照を返し、右辺値の文脈ではCoordinateをコピーして返す。

Definition at line 51 of file Odom.h.

◆ get() [2/2]

template<int N>
const Coordinate & rct::Odom< N >::get ( ) const &
noexcept

推定された自己位置を返す。

Returns
左辺値の文脈ではCoordinateのconst参照を返し、右辺値の文脈ではCoordinateをコピーして返す。

Definition at line 48 of file Odom.h.

◆ integrate()

template<int N>
void rct::Odom< N >::integrate ( const int(&)  dif_val[N])

エンコーダの変位の変化量を積分し、自己位置を計算する。

Parameters
dif_val変位の変化量

Definition at line 35 of file Odom.h.

◆ set()

template<int N>
void rct::Odom< N >::set ( const Coordinate pos)
noexcept

自己位置を更新する。

Parameters
posセットする自己位置。

Definition at line 58 of file Odom.h.

◆ size()

template<int N>
static constexpr int rct::Odom< N >::size ( )
staticconstexprnoexcept

エンコーダ数を返す。

Returns
Odom クラスの templateパラメータである N 定数を返す。

Definition at line 29 of file Odom.h.


The documentation for this struct was generated from the following file: