feat: 実機ロボット制御挙動の再現機能を追加 #9
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
grSimシミュレータで実機ロボット(Orion)と同じ制御アルゴリズム・挙動を再現する機能を実装しました。
背景
チーム(Orion)の実機ロボットとgrSimシミュレータで、以下の差異がありました:
主な変更
1. RobotSettings構造体の拡張 (
include/configwidget.h)高度な制御パラメータを追加:
AccelDeccelRatio: 減速時加速度倍率(デフォルト: 1.0)AccelBackSideRatio: 後方加速時倍率(デフォルト: 1.0)SlipCorrectionX/Y: 滑り補正係数(デフォルト: 1.0)KinematicsMode: 逆運動学モード(0:標準, 1:Orion, デフォルト: 0)2. 設定読み込み処理 (
src/configwidget.cpp)AdvancedControlセクションから新パラメータを読み込み、デフォルト値で後方互換性を確保。3. Robot::setSpeed()の改修 (
src/robot.cpp)実機の
control_speed.cを参考に以下を実装:滑り補正
方向依存の加速度制御
vel_now[i] * accel[i] <= 0による減速判定で係数適用2つの逆運動学モード
(R*ω - vx*sin(α) + vy*cos(α)) / R_wheel(vy*sin(α) + vx*cos(α) + R*ω) / (π*D)4. Orion.ini設定ファイルの追加 (
config/Orion.ini)実機パラメータを設定:
実機コードとの整合性
実機(G474_Orion)の
Core/Src/control_speed.cの実装を参考に、以下を忠実に再現:後方互換性
✅ 既存の設定ファイル(
Parsian.ini等)は変更不要✅ 新パラメータはすべてデフォルト値で標準動作を維持
✅ 既存チームの動作に影響なし
テスト方法
Blue TeamまたはYellow TeamをOrionに設定検証結果
逆運動学の動作を検証プログラムで確認済み:
🤖 Generated with Claude Code