mirs_esp_pio
Toggle main menu visibility
読み取り中…
検索中…
一致する文字列を見つけられません
VelocityCalculator.hpp
[詳解]
1
7
8
#ifndef VELOCITY_CALCULATOR_HPP
9
#define VELOCITY_CALCULATOR_HPP
10
11
#include <stdint.h>
12
14
class
VelocityCalculator
{
15
public
:
22
VelocityCalculator
(
double
counts_per_rev,
double
wheel_radius,
double
dt_sec);
23
28
void
setWheelRadius
(
double
radius);
29
34
void
setDeltaTime
(
double
dt_sec);
35
42
double
calculate
(int32_t current_count, int32_t &prev_count);
43
52
static
int64_t
wrapDelta
(int32_t current_count, int32_t last_count);
53
60
double
calculate
(int64_t current_count, int64_t &prev_count);
61
71
void
calculateBothWheels
(
72
int32_t current_count_l, int32_t current_count_r,
73
int32_t &prev_count_l, int32_t &prev_count_r,
74
double
&vel_l,
double
&vel_r
75
);
76
86
void
calculateBothWheels
(
87
int64_t current_count_l, int64_t current_count_r,
88
int64_t &prev_count_l, int64_t &prev_count_r,
89
double
&vel_l,
double
&vel_r
90
);
91
92
private
:
93
double
counts_per_rev_;
94
double
wheel_radius_;
95
double
dt_sec_;
96
};
97
98
#endif
// VELOCITY_CALCULATOR_HPP
VelocityCalculator::VelocityCalculator
VelocityCalculator(double counts_per_rev, double wheel_radius, double dt_sec)
コンストラクタ
定義
VelocityCalculator.cpp:12
VelocityCalculator::setWheelRadius
void setWheelRadius(double radius)
車輪半径を設定
定義
VelocityCalculator.cpp:19
VelocityCalculator::calculate
double calculate(int32_t current_count, int32_t &prev_count)
現在のエンコーダーカウントから速度を計算
定義
VelocityCalculator.cpp:51
VelocityCalculator::setDeltaTime
void setDeltaTime(double dt_sec)
サンプリング周期を設定
定義
VelocityCalculator.cpp:23
VelocityCalculator::calculateBothWheels
void calculateBothWheels(int32_t current_count_l, int32_t current_count_r, int32_t &prev_count_l, int32_t &prev_count_r, double &vel_l, double &vel_r)
左右両輪の速度を計算
定義
VelocityCalculator.cpp:67
VelocityCalculator::wrapDelta
static int64_t wrapDelta(int32_t current_count, int32_t last_count)
int32境界のラップを吸収したカウント差分を返す
定義
VelocityCalculator.cpp:27
lib
VelocityCalc
VelocityCalculator.hpp
構築:
1.18.0