Skip to content

Commit

Permalink
Merge pull request #111 from rogy-AquaLab/clang-titdy-magic-number
Browse files Browse the repository at this point in the history
0.5F を定数に変更
  • Loading branch information
rein0925 authored Apr 6, 2024
2 parents 193cc71 + 2227d86 commit bf81539
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/schneider_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ constexpr float a = 0.1; // NOLINT: FIXME
*/
constexpr int trial_num = 1000;

/**
* @brief volumeの閾値
*/
constexpr float volumeThreshold = 0.5F;

/**
* @brief モータへの出力を計算するクラス
*/
Expand Down
2 changes: 1 addition & 1 deletion src/schneider_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void Schneider::set_q() {
void Schneider::rotate() {
fet_1 = 0.5F;
fet_2 = 0.5F;
if (volume_ < 0.5F) {
if (volume_ < volumeThreshold) {
servo_1.pulsewidth_us(550);
servo_2.pulsewidth_us(2350);
} else {
Expand Down

0 comments on commit bf81539

Please sign in to comment.