fix(crane_web_debugger): robot_testで存在しないロボットが表示される問題を修正#1350
Merged
fix(crane_web_debugger): robot_testで存在しないロボットが表示される問題を修正#1350
Conversation
## 背景 WorldModelは常にMAX_ROBOT_COUNT(16)スロット分のロボット情報を発行するが、 各スロットの`available_vision`/`available_tracker`フラグで検出状態を示す。 robot_test.jsではこのフラグを参照せずに全スロットを描画・クリック選択の対象と していたため、実際にはフィールドに存在しないロボットが表示されていた。 ## 変更内容 - 味方ロボットの描画ループに`available_vision || available_tracker`フィルタを追加 - 選択ハイライト(破線円)の描画条件を存在するロボットのみに変更 - `findRobotAtPosition()`のヒットテストに同フィルタを追加 viewer側(viewer/main.js:571)では既に同フィルタが実装済みであり、 それと一貫した挙動になる。なお同ファイル内の`_updateHover()`も既に フィルタ済みのため、今回の修正でロボットTest全体の挙動が統一される。
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.
概要
Robot Test ページでフィールド上に存在しない(Vision/Tracker 未検出の)味方ロボットが描画・選択できてしまう問題を修正する。
背景・根本原因
crane_world_model_publisherはrobot_info_oursを常にMAX_ROBOT_COUNT(=16)スロット分発行しており、検出状態は各スロットのavailable_vision/available_trackerフラグで示される。しかしrobot_test.jsはこのフラグを参照せず全スロットを描画・ヒットテスト対象としていたため、未検出ロボットが画面に出現していた。viewer(
viewer/main.js:571)では既に同フィルタが実装済みで、robot_test.js内の_updateHover()も実装済みだが、描画ループとクリック選択のみが抜けていた。変更内容
available_vision || available_trackerフィルタを追加findRobotAtPosition()のヒットテストに同フィルタを追加変更は
crane_web_debugger/web/robot_test.jsのみ(JS のみ、C++ ビルド不要)。