Conversation
grSimシミュレータで実機ロボット(Orion)と同じ制御アルゴリズム・挙動を再現する機能を実装。 ## 主な変更 ### RobotSettings構造体の拡張 (include/configwidget.h) - AccelDeccelRatio: 減速時加速度倍率(デフォルト: 1.0) - AccelBackSideRatio: 後方加速時倍率(デフォルト: 1.0) - SlipCorrectionX/Y: 滑り補正係数(デフォルト: 1.0) - KinematicsMode: 逆運動学モード(0:標準, 1:Orion, デフォルト: 0) ### 設定読み込み処理の追加 (src/configwidget.cpp) - AdvancedControlセクションから新パラメータを読み込み - デフォルト値で後方互換性を確保 ### Robot::setSpeed()の改修 (src/robot.cpp) - 滑り補正の適用 - 実機に基づく方向依存の加速度制御 - 減速時: AccelDeccelRatio倍(実機: 1.8倍) - 後方加速時: 上限クリップ処理(実機: 0.7倍) - 2つの逆運動学モードをサポート - モード0(標準): (R*ω - vx*sin(α) + vy*cos(α)) / R_wheel - モード1(Orion): (vy*sin(α) + vx*cos(α) + R*ω) / (π*D) ### Orion.ini設定ファイルの追加 (config/Orion.ini) - 実機パラメータの設定 - ホイール角度: 30°, 315°, 225°, 150° - ホイール半径: 0.028m - ロボット半径: 0.08m - 最大速度: 7.0 m/s - 高度な制御パラメータ - AccelDeccelRatio: 1.8 - AccelBackSideRatio: 0.7 - SlipCorrectionX: 1.1 - SlipCorrectionY: 1.3 - KinematicsMode: 1 ## 実機コードとの整合性 実機(G474_Orion)のcontrol_speed.cの実装を参考に、以下を忠実に再現: - 後方加速時の上限クリップ処理 - 速度と加速度の符号による減速判定 - X/Y方向それぞれでの減速判定 ## 後方互換性 既存の設定ファイル(Parsian.ini等)は変更不要。 新パラメータはすべてデフォルト値で標準動作を維持。 🤖 Generated with [Claude Code](https://claude.ai/code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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