etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
WheelOdometry.h
[詳解]
1 
6 #ifndef WHEEL_ODOMETRY_H
7 #define WHEEL_ODOMETRY_H
8 #include "MotorAngle.h"
9 #include "RobotProperty.h"
10 #include <cmath>
11 #include <cstdint>
12 
16 struct Coordinate {
17  float radius; // [極座標] 走行体の移動半径(走行体の移動距離で近似)
18  float arg; // [極座標] 走行体の移動角度
19  float x; // [直交座標] 走行体の位置(x座標)
20  float y; // [直交座標] 走行体の位置(y座標)
21  Coordinate() : radius(0.0f), arg(0.0f), x(0.0f), y(0.0f) {}
23  void update(float distance, float angle);
25  void reset();
26 };
27 
29  private:
30  MotorAngle motor_angle; // モータ角度の情報
31  RobotProperty property; // 走行体の情報
32  Coordinate coordinate; // 走行体の現在位置の情報
33 
34  public:
35  WheelOdometry(float diameter = 99.0, float tread = 147.5, float cycle = 0.04)
36  : motor_angle(), property(diameter, tread, cycle), coordinate()
37  {
38  }
40  float velocity(std::int32_t left_motor, std::int32_t right_motor);
42  float angularVelocity(std::int32_t left_motor, std::int32_t right_motor);
44  const Coordinate& reset();
46  const Coordinate& update(std::int32_t left_motor, std::int32_t right_motor);
48  float getRotationAngle(std::int32_t left_motor, std::int32_t right_motor);
50  const Coordinate& getCoordinate();
52  float getPointX();
54  float getPointY();
55 };
56 
57 #endif
float getPointX()
走行体の位置x座標を返す
float angularVelocity(std::int32_t left_motor, std::int32_t right_motor)
走行体の旋回角速度を求める
const Coordinate & getCoordinate()
走行体の位置情報を返す
float getRotationAngle(std::int32_t left_motor, std::int32_t right_motor)
走行体の回転角度を返す
float radius
Definition: WheelOdometry.h:17
void reset()
走行体の位置情報を初期化する
const Coordinate & update(std::int32_t left_motor, std::int32_t right_motor)
走行体の位置情報を更新する
float velocity(std::int32_t left_motor, std::int32_t right_motor)
走行体の旋回速度を求める
const Coordinate & reset()
走行体の位置情報を初期化する
左右モータの回転角に関するクラス(旧Distance.h, SelfLocalization内のMotorAngle)
void update(float distance, float angle)
走行体の位置情報を更新する
走行体の車輪半径やトレッド幅等をまとめた構造体
float getPointY()
走行体の位置y座標を返す
WheelOdometry(float diameter=99.0, float tread=147.5, float cycle=0.04)
Definition: WheelOdometry.h:35
走行体の位置情報をまとめた構造体
Definition: WheelOdometry.h:16