File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 66
77#include " Mileage.h"
88
9- double Mileage::calculateWheelMileage (int angle)
9+ // MotorController でモーターの角位置を int32_t 型で取得しているため、double ではなく int32_t
10+ // 型を使用する
11+ double Mileage::calculateWheelMileage (int32_t angle)
1012{
1113 // タイヤの累計走行距離 = 2 * π * タイヤの半径 * (タイヤの回転角度 / 360[deg])
1214 return 2.0 * M_PI * RADIUS * static_cast <double >(angle) / 360.0 ;
1315}
1416
15- double Mileage::calculateMileage (int rightAngle, int leftAngle)
17+ double Mileage::calculateMileage (int32_t rightAngle, int32_t leftAngle)
1618{
1719 // 右タイヤの累計走行距離を計算
1820 double rightWheelMileage = calculateWheelMileage (rightAngle);
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Mileage {
1717 ** @param angle タイヤの回転角度[deg]
1818 ** @return タイヤの累計走行距離[mm]
1919 **/
20- static double calculateWheelMileage (int angle);
20+ static double calculateWheelMileage (int32_t angle);
2121
2222 /* *
2323 ** @brief 走行体全体の累計走行距離を計算する
You can’t perform that action at this time.
0 commit comments