[クリーンアップ] crane_visualizer_wrapperの未使用描画APIを削除 - #1439
Merged
Merged
Conversation
HansRobo
force-pushed
the
feature/remove-unused-visualizer-wrapper-api
branch
from
September 13, 2026 08:30
8ab4c8e to
447bc8d
Compare
事前監査(git grepと全文Readによる2段階の実地検証)で、 crane_visualization_interfaces/crane_visualizer_wrapper.hpp/cppに 定義された高レベル描画APIの一部がリポジトリ全体で一度も呼び出されて いないことを確認したため、以下を削除した。 - SvgColors名前空間の色定数群(呼び出し側は生文字列を直書きしており未使用) - VisualizerMessageBuilder::asReplace/asAppend/asClear (operationメンバー自体とデフォルト値設定ロジックは flush() で 使われ続けるため維持し、直接代入 operation = "replace" 等に統一) - circleAt/lineFrom(2オーバーロード)の宣言+inline実装 - velocityArrowの宣言+実装 - drawTrajectory/drawFadingTrajectoryの宣言+実装 - SvgBuilderBase::raii()テンプレートメソッド (唯一の書き込み元だったため、以後常にfalseとなるauto_buildフラグ および到達不能になるデストラクタの分岐も合わせて削除) - SvgPolygonBuilder構造体丸ごと(前方宣言・polygon()宣言・実装含む。 エントリポイントのpolygon()自体が呼ばれていないため到達不能だった) - SvgPathBuilder::SvgPathDefinitionBuilderのhorizontalTo/verticalTo/ closePath/cubicBezierTo(2)/smoothCubicBezierTo(2)/quadraticBezierTo(2)/ smoothQuadraticBezierTo(2)/arcTo(2)の計11メソッド (moveTo/lineToはcrane_robot_skills/goal_kick.cppで実使用のため維持) doubleCircle/labeledCircle/arc/arrow/drawFilledCircle/drawFieldRect/ drawStyledCircle/drawRobotWithID/rectangle/moveTo/lineTo/fromSegment等、 実際に使われているメソッドは変更していない。 docs/visualizer.mdは削除したAPIを紹介したままだと実態と乖離するため、 該当する説明・コード例(RAIIセクション、軌跡描画セクション、 polygon()の表行、SvgColors使用箇所、asReplace/asAppend/asClearの コード例)を合わせて更新した。 ビルド確認: cwm ws build で crane_visualization_interfaces および 逆依存の全パッケージ(crane_msg_wrappers/crane_robot_skills/ crane_game_analyzer/crane_world_model_publisher/crane_local_planner/ crane_robot_receiver/crane_sender/crane_play_switcher/crane_sessions/ crane_session_coordinator/crane_web_debugger)が全てエラーなくビルド 成功することを確認済み。
HansRobo
force-pushed
the
feature/remove-unused-visualizer-wrapper-api
branch
from
September 13, 2026 10:01
447bc8d to
c8cfca5
Compare
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_visualization_interfaces/crane_visualizer_wrapper.hpp(834行)/.cpp(355行)に定義された高レベル描画APIのうち、リポジトリ全体で一度も呼び出されていないものを削除しました。未使用と確認した根拠
各項目について
git grep -n "メソッド名(" -- '*.cpp' '*.hpp' '*.py' '*.launch.py' '*.yaml' '*.msg' 'CMakeLists.txt'を実行し、定義元ファイル自身以外にヒットが無いことを確認した上で削除しています。削除した項目
SvgColors名前空間の色定数群(呼び出し側は "white" 等の生文字列を直書きしており未使用)VisualizerMessageBuilder::asReplace/asAppend/asClearの3メソッドoperationメンバー自体はflush()で使われ続けるため維持し、呼び出し箇所はoperation = "replace"のような直接代入に統一しましたcircleAt/lineFrom(2オーバーロード)の宣言+inline実装velocityArrowの宣言+実装drawTrajectoryの宣言+実装drawFadingTrajectoryの宣言+実装SvgBuilderBase::raii()テンプレートメソッドraii()が唯一の書き込み元だったauto_buildフラグ、およびそれに伴い到達不能になる~SvgBuilderBase()の分岐も合わせて削除し、= defaultに簡略化しましたSvgPolygonBuilder構造体丸ごと(前方宣言・polygon()宣言・実装含む。エントリポイントのpolygon()自体が呼ばれていないため到達不能でした)SvgPathBuilder::SvgPathDefinitionBuilderのhorizontalTo/verticalTo/closePath/cubicBezierTo(2) /smoothCubicBezierTo(2) /quadraticBezierTo(2) /smoothQuadraticBezierTo(2) /arcTo(2) の計11メソッドmoveTo/lineToはcrane_robot_skills/src/goal_kick.cppで実使用のため維持していますdoubleCircle/labeledCircle/arc/arrow/drawFilledCircle/drawFieldRect/drawStyledCircle/drawRobotWithID/rectangle/moveTo/lineTo/fromSegment等、実際に使われているAPIは変更していません。ドキュメント更新
docs/visualizer.mdは削除したAPIをそのまま紹介していると実態と乖離するため、以下を合わせて更新しました。.raii())セクションの削除drawTrajectory/drawFadingTrajectory)の削除polygon()の表行、高レベルヘルパー一覧のvelocityArrow行の削除path()の説明をdefinition.moveTo().lineTo()に修正(closePathは削除済みのため)asReplace()/asAppend()/asClear()を使ったコード例をoperation = "replace"等の直接代入に書き換えcrane::SvgColors::Yellow等の使用箇所を生文字列("yellow" 等)に書き換えビルド確認
cwm ws build -w feature/remove-unused-visualizer-wrapper-apiでcrane_visualization_interfacesおよび逆依存の以下パッケージが全てエラーなくビルド成功することを確認しました。出力された stderr はいずれも既存の
[[nodiscard]]警告や無関係なmatplotlib_cpp_17_vendorの CMake 警告のみで、エラーはありません。削除しなかった項目
事前に想定していた範囲(hpp/cppからの削除対象)はすべて予定通り削除できました。ただし、ドキュメント(
docs/visualizer.md)側は当初指示にあったvelocityArrow/drawTrajectory/drawFadingTrajectoryの3項目だけでなく、同じく削除したasReplace/asAppend/asClear/raii()/SvgColors/polygon()を参照しているコード例・表・セクションも実態との乖離を防ぐため合わせて更新しています。