fix(crane_play_switcher): レフェリータイムアウト復帰後のSTOP固着を修正 - #1383
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.
概要
crane_play_switcherにおいて、レフェリーメッセージのタイムアウトで安全のため STOP に強制遷移した後、同一の RAW コマンドでレフェリーが復帰すると INPLAY 等へ戻れず STOP に固着する不具合を修正します。問題
check_referee_timeout()はタイムアウト検出時にplay_situation_msg.commandを STOP へ強制遷移させますが、その際latest_raw_refereeを更新しません。このため、レフェリーが直前と同一の RAW コマンドで復帰した場合、referee_callback()の差分判定latest_raw_referee.command.value != msg.command.valueが偽となり、コマンド更新ブロックに入れません。結果として INPLAY などへ復帰できず STOP に張り付いたままとなり、復帰時の警告も出ませんでした。原因
タイムアウトでの STOP 強制遷移時に
latest_raw_refereeを据え置いたため、復帰時の差分検出をすり抜けます。STOP からの復帰経路はreferee_callback()の差分判定ゲート配下のみであり、それ以外に状況を再評価する機構が存在しないことが根本原因です。修正内容
referee_callback()の冒頭、タイムアウト復帰を検出する箇所(referee_timeout_active_をfalseに戻す箇所)で、latest_raw_referee.command.valueを実在しない sentinel 値(-1)へ無効化します。RefereeCommand.valueはint32で有効値は 0 以上のため、-1は決して実コマンドと一致しません。これにより、復帰後の最初のreferee_callback()で差分判定が必ず成立し、最新の referee コマンドに基づいて状況が再評価され、STOP が正しく上書きされることを保証します。crane_play_switcher/src/play_switcher.cpp検証
cwm の独立オーバーレイ worktree 上で
colcon build(--no-rdeps)を実行し、crane_play_switcherパッケージが警告・エラーなくコンパイル完了することを確認しました(Build complete.)。レビュー観点
ステートマシンの変更です。レフェリー瞬断 → 同一コマンドでの復帰シナリオにおける動作(STOP からの正常な復帰、復帰警告の出力、sentinel 値が後段判定に悪影響を与えないこと)を重点的にレビューしてください。
本PRはソースコード監査ワークフローで検出・敵対的検証されたバグに対する単一修正です。