Skip to content

#KL25-17 モータを動かす#6

Merged
takahashitom merged 38 commits intomainfrom
ticket-KL25-17
May 22, 2025
Merged

#KL25-17 モータを動かす#6
takahashitom merged 38 commits intomainfrom
ticket-KL25-17

Conversation

@nishijima515
Copy link
Copy Markdown
Contributor

@nishijima515 nishijima515 commented May 19, 2025

チェックリスト

  • clang-format している
  • コーディング規約に準じている
  • チケットの完了条件を満たしている

変更点

  • spikeapiのモータラッパークラスmodules/API/Motor.hを追加
  • ポート関連の定義を行うmodules/API/Port.hを追加
  • モータを動かすためのクラスmodules/API/Controller.h,modules/API/Controller.cppを追加
  • buildを行うためにMakefile.incを変更
  • テストを行うためにCMakeLists.txtを変更
  • Controllerクラスのテストを行うtests/ControllerTest.cppを追加
  • Controllerクラスのテストを行うためのダミーファイルtests/dummy/pbio/port.h,tests/dummy/spike/pup/motor.h, tests/dummy/spikeapi.hを追加

動作テスト

Notionを参考

メモ

  • modules/API/Motor.hのisStalled(),setDutyLimit(),restoreDutyLimit(),はControllerクラスでは対応していません。必要に応じて今後追加していきます。
  • Makefile.incのincludeディレクトリを指定する部分に-I$(mkfile_path)../../common/library/libcpp-spike/includeを追記することで、このディレクトリ内にあるspikeapiラッパクラス群を参照可能。これを用いる場合は、modules/API/Motor.h,modules/API/Port.hは不要。
  • Controllerクラスに関しては、肥大化しているため、構造変更が必要かもしれない。
  • ControllerクラスのgetCount関数は、テストのために追加した。Controllerクラスはこれを持つかどうかは、要議論。

@notion-workspace
Copy link
Copy Markdown

モータを動かす

@nishijima515 nishijima515 requested review from a team and removed request for a team May 20, 2025 02:57
Copy link
Copy Markdown
Collaborator

@takuchi17 takuchi17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一周見た感じ,細かいところばっかり.実際に動いているところを見たし,コード観た感じも致命的なところは無さそう.

全体で気になったのは以下.

  • ファイル名がControllerでいいのかは気になる.個人的には何を制御するクラスなのかが分かった方がいい.MotorControllerとか.
  • モーターとモータが混在してるからどっちかに統一で.

@takahashitom takahashitom self-assigned this May 20, 2025
Copy link
Copy Markdown
Contributor

@aridome222 aridome222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいところだけちょっと回答お願いします。

Copy link
Copy Markdown
Contributor

@molpui0726 molpui0726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

けっこうあった

Copy link
Copy Markdown
Collaborator

@takahashitom takahashitom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いったん、メンバ変数に関する話だけして、他の部分のレビューはしていないのでコメントです。

メンバ変数の消去に関しては、他の人の意見も聞きたいところです。
よろしくお願いします。

Copy link
Copy Markdown
Collaborator

@takuchi17 takuchi17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あと一か所お願いします。名前変えたときの置換ミスかな?
これ終わったらapprove出そうと思います。

Copy link
Copy Markdown
Contributor

@aridome222 aridome222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setPowerの修正してくれてありがとう!お疲れ様!
LGTM

Copy link
Copy Markdown
Contributor

@molpui0726 molpui0726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

僕が出したところは全部いい気がするので、いっっっったんLGTM
LGTM113969

Copy link
Copy Markdown
Collaborator

@takahashitom takahashitom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正残しがあったのでおねがい

Copy link
Copy Markdown
Collaborator

@takahashitom takahashitom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おつカレー

Copy link
Copy Markdown
Collaborator

@takahashitom takahashitom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おつカレー2

Copy link
Copy Markdown
Collaborator

@takuchi17 takuchi17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自分が指摘した所は修正できてそうです.
かなりやること多かったと思うけど,よく書けていると思います.

実際に動くとこも見たし,さほど心配はしてないかな.動かしたところ見たときは速度を指定して途中で違う速度に設定してみたりをしていないから,一応確認はしておきたいですね.具体的には,昨年はモーターインスタンスを何回も生成してセットアップしていてフリーズやカクカク走行になっていたから,今回はどうなのかを,次イテレーションで確認したい.

一旦お疲れありがとうLGTM!!

@takahashitom takahashitom merged commit 35b5e28 into main May 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants