color_detectionサンプルの追加#183
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Sciurus17向けに、特定色(デフォルト青)の物体を深度画像込みで検出し、TF(target_0)として配信してピッキングにつなぐ color_detection サンプル(C++/Python)を追加するPRです。既存の2D版 color_detection コンポーネントは color_detection_2d にリネームし、追従系launchから参照する構成に整理しています。
Changes:
- C++: 深度+CameraInfoを同期して3D位置を算出しTF配信する
color_detection実行ファイルを追加 - C++: 既存2D検出コンポーネントを
color_detection_2dに改名し、関連launchを更新 - Python:
color_detectionと、それに対応するpick_and_place_tfとカメラ例launchを追加
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| sciurus17_examples/src/color_detection.cpp | 深度/CameraInfo同期で3D位置を算出しTF配信する新しい実行ファイルノードを実装 |
| sciurus17_examples/src/color_detection_2d.cpp | 既存2D検出を ColorDetection2d としてコンポーネント化 |
| sciurus17_examples/include/sciurus17_examples/color_detection_2d.hpp | ColorDetection2d の新規ヘッダ/ガード名更新 |
| sciurus17_examples/CMakeLists.txt | color_detection_2d をコンポーネント登録、color_detection を実行ファイルとして追加、依存追加 |
| sciurus17_examples/package.xml | image_transport/message_filters/tf2_ros 依存追加 |
| sciurus17_examples/README.md | color_detection サンプル説明を追加 |
| sciurus17_examples/launch/head_camera_tracking.launch.py | 参照コンポーネントを color_detection_2d に更新 |
| sciurus17_examples/launch/chest_camera_tracking.launch.py | 参照コンポーネントを color_detection_2d に更新 |
| sciurus17_examples/launch/example.launch.py | 例示リスト文言を更新 |
| sciurus17_examples/launch/camera_example.launch.py | color_detection を例示リストに追加 |
| sciurus17_examples_py/setup.py | pick_and_place_tf と color_detection エントリポイント追加 |
| sciurus17_examples_py/sciurus17_examples_py/pick_and_place_tf.py | TFターゲットを見てピック&プレースするノードを新規追加 |
| sciurus17_examples_py/sciurus17_examples_py/color_detection.py | Python版の深度同期・3D算出・TF配信ノードを新規追加 |
| sciurus17_examples_py/launch/camera_example.launch.py | Python版のカメラ例launchを新規追加 |
| sciurus17_examples_py/package.xml | Pythonサンプル実行に必要な依存を追加 |
| sciurus17_examples_py/README.md | Python版 color_detection サンプル説明を追加 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
@Kuwamai レビューをお願いします。 |
Contributor
Author
|
@Kuwamai |
Kuwamai
requested changes
Jun 30, 2026
Kuwamai
left a comment
Contributor
There was a problem hiding this comment.
コメントだけ追記できたらあとは大丈夫そうです 🙇
Contributor
Author
|
コメントを追加しました。ご確認をお願いします。 |
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.
What does this implement/fix?
color_detectionサンプルを追加します。
crane_x7_rosの
color_detectionサンプルをベースに実装しています。移植に加えて、Sciurus17向けに以下の変更・修正を行っています。
sciurus17_examples/src/color_detection_2d.cppcolor_detectionコンポーネントをcolor_detection_2dにリネームしました。ColorDetection2Dに変更しています。head_camera_tracking.launch.py/chest_camera_tracking.launch.pyの component 名・plugin 名も更新しています。sciurus17_examples/src/color_detection.cppcolor_detectionとして、 Sciurus17 のカメラ構成に合わせて調整しました。/head_camera/color/image_raw、/head_camera/aligned_depth_to_color/image_raw、/head_camera/color/camera_infoに変更しています。target_0の TF として配信します。16UC1と32FC1の両方に対応しています。w=1.0を明示しました。cv::moments()の名前空間を明示しました。static_cast<int>にしました。sciurus17_examples/src/pick_and_place_tf.cpppick_and_place_tf.cppを実機/Gazeboでの動作に合わせて調整しました。0.03程度となって青色キューブが把持対象外となってしまうため、0.04から0.02に緩和しています。sciurus17_examples_py/sciurus17_examples_py/color_detection.pycolor_detectionサンプルとして追加しました。16UC1/32FC1の深度画像 encoding に対応しています。target_0の TF として配信します。w=1.0を明示しています。sciurus17_examples_py/sciurus17_examples_py/pick_and_place_tf.pypick_and_place_tf.pyを追加しました。その他
camera_example.launch.pyからcolor_detectionを起動できるようにしました。image_transport、message_filters、image_geometry、tf2_ros、cv_bridgeなど必要な依存関係を追加しています。color_detectionの実行方法と、配信される TF frame の説明を追記しました。Does this close any currently open issues?
しません。
How has this been tested?
実機とGazeboの両方で動作を確認しました。
Any other comments?
なし
Checklists