Adding an example for high_level visual kick without ros using fastdds#34
Open
waqarsqureshi wants to merge 36 commits into
Open
Adding an example for high_level visual kick without ros using fastdds#34waqarsqureshi wants to merge 36 commits into
waqarsqureshi wants to merge 36 commits into
Conversation
Move high level example
…le-list Copilot/check cmake executable list
…er-again Remove examples folder
Author
|
Added an example for kick without using ros. This consider that the ball is in the front. Do no uses vision. just kick based on hard coded position |
There was a problem hiding this comment.
Pull request overview
Adds a new C++ example demonstrating how to run the B1 “visual kick” high-level behavior without ROS by directly publishing the Kick reference topic over Fast DDS, and updates the top-level build to compile this example and improve library discovery/linking.
Changes:
- Added
example/high_level/visual_kick_no_ros.cppto publishrt/kick_ballvia Fast DDS and enable/disableVisualKickthroughB1LocoClient. - Updated
CMakeLists.txtto detect architecture, add include/link search paths, locatetinyxml2, and build the newvisual_kick_no_rosexecutable. - Tightened CMake C++ standard requirements (
CMAKE_CXX_STANDARD_REQUIRED ON) and adjusted minimum CMake version.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| example/high_level/visual_kick_no_ros.cpp | New Fast DDS publisher example that enables VisualKick and publishes Kick references in a loop. |
| CMakeLists.txt | Adds arch-specific lib/include wiring, tinyxml2 discovery, and builds the new example target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+73
to
+75
| int mode_rc = loco.GetMode(mode); | ||
| std::cout << "[INFO] GetMode rc=" << mode_rc | ||
| << " mode=" << static_cast<int>(mode.ToJson()["mode"]) << "\n"; |
Comment on lines
+101
to
+112
| auto t0 = std::chrono::steady_clock::now(); | ||
| const double goal_x = 4.5; | ||
| const double goal_y = 0.0; | ||
| double power = 0.8; // start low; calibrate gradually | ||
|
|
||
| while (g_run.load()) { | ||
| auto now = std::chrono::steady_clock::now(); | ||
| double t = std::chrono::duration<double>(now - t0).count(); | ||
|
|
||
| // Example ball estimate in robot coordinates: | ||
| double ball_x = 0.35; | ||
| double ball_y = 0.03 * std::sin(2.0 * M_PI * 0.4 * t); |
Comment on lines
+49
to
+52
| if (!topic) { | ||
| std::cerr << "Failed to create topic\n"; | ||
| return 1; | ||
| } |
Comment on lines
+55
to
+58
| if (!publisher) { | ||
| std::cerr << "Failed to create publisher\n"; | ||
| return 1; | ||
| } |
Comment on lines
+61
to
+64
| if (!writer) { | ||
| std::cerr << "Failed to create writer\n"; | ||
| return 1; | ||
| } |
Comment on lines
+18
to
+22
| if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") | ||
| set(ARCH_DIR "aarch64") | ||
| else() | ||
| set(ARCH_DIR "x86_64") | ||
| endif() |
Comment on lines
+37
to
+41
| find_library(TINYXML2_LIB | ||
| NAMES tinyxml2 | ||
| HINTS "/usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu" | ||
| NO_DEFAULT_PATH | ||
| ) |
looks acceptable Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Author
|
all are reasonable suggestions |
Add visual_kick_ball_detect_dds_camera.cpp which: - Subscribes to sensor_msgs/CompressedImage (or /Image with --raw) via ChannelSubscriber - Decodes each DDS frame to cv::Mat in the callback thread - Runs YOLOv5/v8 ONNX detection (when a model is supplied) with HSV colour-segmentation as an automatic fallback - Drives the robot toward the ball using the same proportional approach controller and visual kick flow as the original example - Registers the executable in CMakeLists.txt with find_package(OpenCV)
feat: subscribe to RGB camera over DDS with YOLO + HSV colour fallback
…nt-code Make `visual_kick_ball_detect_no_ros` self-contained and buildable without `booster_vision`
…ss to first person seen
…timate-use Copilot/find calibration estimate use
…ball-detect-files Remove visual_kick_ball_detect example files
Added detailed pseudocode for robot behavior in visual pass ball to person.
Enhanced robustness of vision service and state transitions with retry mechanisms. Added brief retries and backoff for RPC calls to ensure smoother operation during failures.
…all-change Applying changes to visual pass ball logic
…-ball-to-person Restructure visual pass example for phased startup and KICK-scoped DDS publishing
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.
No description provided.