Skip to content

Adding an example for high_level visual kick without ros using fastdds#34

Open
waqarsqureshi wants to merge 36 commits into
BoosterRobotics:mainfrom
waqarsqureshi:main
Open

Adding an example for high_level visual kick without ros using fastdds#34
waqarsqureshi wants to merge 36 commits into
BoosterRobotics:mainfrom
waqarsqureshi:main

Conversation

@waqarsqureshi

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings July 6, 2026 15:32
@waqarsqureshi

Copy link
Copy Markdown
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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cpp to publish rt/kick_ball via Fast DDS and enable/disable VisualKick through B1LocoClient.
  • Updated CMakeLists.txt to detect architecture, add include/link search paths, locate tinyxml2, and build the new visual_kick_no_ros executable.
  • 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 thread example/high_level/visual_kick_no_ros.cpp Outdated
Comment thread example/high_level/visual_kick_no_ros.cpp
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 thread CMakeLists.txt
Comment on lines +18 to +22
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(ARCH_DIR "aarch64")
else()
set(ARCH_DIR "x86_64")
endif()
Comment thread CMakeLists.txt
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>
@waqarsqureshi

Copy link
Copy Markdown
Author

all are reasonable suggestions

waqarsqureshi and others added 14 commits July 6, 2026 19:38
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`
…timate-use

Copilot/find calibration estimate use
…ball-detect-files

Remove visual_kick_ball_detect example files
waqarsqureshi and others added 11 commits July 7, 2026 14:14
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants