etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
MotorAngle.h
[詳解]
1 
6 #ifndef MOTOR_ANGLE_H
7 #define MOTOR_ANGLE_H
8 #include <cstdint>
9 
10 class MotorAngle {
11  private:
12  std::int32_t pre_left_motor;
13  std::int32_t pre_right_motor;
14 
15  public:
16  MotorAngle() : pre_left_motor(0), pre_right_motor(0) {}
18  void update(std::int32_t left_motor, std::int32_t right_motor);
20  void reset();
22  float absoluteAngleMean(std::int32_t left_motor, std::int32_t right_motor);
24  float relativeAngleMean(std::int32_t current_left_motor, std::int32_t current_right_motor);
26  float angularDifference(std::int32_t left_motor, std::int32_t right_motor);
28  std::int32_t absoluteValueOfAngle(std::int32_t motor);
29 };
30 
31 #endif
float relativeAngleMean(std::int32_t current_left_motor, std::int32_t current_right_motor)
左右モータの相対角度の平均値を計算する
Definition: MotorAngle.cpp:51
void reset()
左右モータ角度の過去値を0にリセットする
Definition: MotorAngle.cpp:26
float angularDifference(std::int32_t left_motor, std::int32_t right_motor)
左右モータ角度の差を計算する(右手系/反時計回りが正)
Definition: MotorAngle.cpp:72
std::int32_t absoluteValueOfAngle(std::int32_t motor)
モータ角度の絶対値を計算する
Definition: MotorAngle.cpp:83
float absoluteAngleMean(std::int32_t left_motor, std::int32_t right_motor)
左右モータの絶対角度の平均値を計算する
Definition: MotorAngle.cpp:39
MotorAngle()
右モータ角度の過去値
Definition: MotorAngle.h:16
void update(std::int32_t left_motor, std::int32_t right_motor)
左右モータ角度の過去値を現在値へ更新する
Definition: MotorAngle.cpp:14