fix(crane_sender): SSLシミュレータのkick_angleを度単位で送信するよう修正 - #1380
Open
HansRobo wants to merge 1 commit into
Open
Conversation
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.
概要
SSL シミュレータ(ssl_simulation_robot_control.proto 経路)へ送信する
kick_angleの単位が誤っていたため、チップキックがほぼ機能していなかった問題を修正します。問題
ssl_simulation_robot_control.protoのkick_angleフィールドは度単位を要求します。しかしcrane_sender/src/ibis_sender_node.cppのsendSSLでは、computeKickが返すラジアン値(angle_rad)をそのままcmd->set_kick_angle()に渡していました。その結果、30 度のチップキックが約 0.52(度として解釈)となり、チップキックがほぼ平面キックとして扱われ機能しませんでした。
原因
computeKickはchip_angle_deg_ * M_PI / 180.0によりチップ角度をラジアンで返します。sendGrSim)ではkick.angle_radをcos/sinに渡してkickspeedx/kickspeedzを算出するため、ラジアンのままで正しい。sendSSL)では proto が度単位を要求するにもかかわらず、変換せずラジアン値を渡していた。修正内容
sendSSLのset_kick_angle呼び出しでラジアン→度へ変換するよう修正しました。computeKickの戻り値はラジアンのまま維持し、grSim 経路の挙動は一切変更していません。SSL 経路のみ単位変換を追加する最小限の修正です。検証
cwm の独立オーバーレイ worktree 上で、対象パッケージ
crane_senderの colcon build(--no-rdeps)を実行し、コンパイルが正常に完了することを確認しました(Build complete.、ビルドエラーなし)。レビュー観点
本PRはソースコード監査ワークフローで検出・敵対的検証されたバグに対する単一修正です。