yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
ROSMASTER M1 PRO📖
0.Robot Configuration and Operation Guidelines
  • 0.Unboxing and Review
  • 1.Assembly Videos
  • 2.User Manual
  • 3.Enter Docker (For Raspberry Pi)
  • 4.FAQ
  • 5.RobotManager User Guide
1.Chassis Control Course
  • 1.Robot Information Publishing
  • 2.Robot Handle Control
  • 3.Robot Keyboard Control
  • 4.Linear Velocity Calibration
  • 5.Angular Velocity Calibration
  • 6.Robot URDF Model
  • 7.Robot EKF State Estimation
2.Lidar Course
  • 1.Lidar Introduction And Use
  • 2.Lidar Obstacle Avoidance
  • 3.Lidar Following
  • 4.Lidar Guard
  • 5.Lidar Patrol
  • 6.GMapping-SLAM Mapping
  • 7.Cartographer-SLAM Mapping
  • 8.Slam-Toolbox Mapping
  • 9.Lifelong Mode Mapping
  • 10.Navigation2 Single Point Navigation
  • 11.Navigation2 Multi Point Navigation
  • 12.Cartographer Relocalization Navigation
  • 13.Slam-Toolbox Localization Navigation
  • 14.Synchronous Mapping And Navigation
  • 15.Aruco Visual Relocalization Navigation
  • 16.Mobile App Mapping And Navigation
3.USB Camera-Depth Camera Course
  • 1.USB Camera Introduction
  • 2.USB Camera Intrinsic Calibration
  • 3.Nuwa-HP60C Camera Introduction (Depth Camera Only)
  • 4.Depth Pseudo Color Image (Depth Camera Only)
  • 5.Depth Camera Distance Measurement (Depth Camera Only)
  • 6.Block Volume Calculation (Depth Camera Only)
  • 7.Edge Detection (Depth Camera Only)
  • 8.RTAB-Map SLAM Mapping (Depth Camera Only)
  • 9.RTAB-Map Navigation (Depth Camera Only)
4.Robotic Arm and 3D Space Gripping Course
  • 1.Robotic Arm Basic Usage
  • 2.Robotic Arm Kinematics
  • 3.Robotic Arm Chassis Coordination Control
  • 4.AprilTag ID Sorting
  • 5.AprilTag Height Anomaly Sorting
  • 6.AprilTag Tracking and Grasping
  • 7.Color Block Sorting
  • 8.Color Block Height Anomaly Sorting
  • 9.Color Block Tracking and Grasping
  • 10.Wood Block Shape Sorting
  • 11.KCF Tracking and Grasping Objects
  • 12.Mediapipe Gesture ID Sorting AprilTag
  • 13.Mediapipe Gesture Height Sorting AprilTag
  • 14.Desktop Tracking and Grasping AprilTag
  • 15.3D Spatial Tracking AprilTag
  • 16.Transformer Model Tracking Algorithm
  • 17.Line Following Obstacle Clearing
5.Road network planning and navigation
  • 1.Introduction To Road Network Planning
  • 2.Road Network Annotation
  • 3.Planning And Navigation Between Waypoints
  • 4.Road Network Navigation In Any Pose
  • 5.Path Re-planning
6.OpenClaw Basic Course
  • 1.Introduction to OpenClaw
  • 2.OpenClaw Core Concepts
  • 3.OpenClaw API-KEY Configuration
  • 4.OpenClaw Switch Models
  • 5.OpenClaw System Prompt Words
  • 6.OpenClaw Common CLI Commands
7.OpenClaw Interaction Method
  • 1.OpenClaw Webchat Interaction
  • 2.OpenClaw Tui Interaction
  • 3.OpenClaw Voice Dialogue Interaction
  • 4.OpenClaw WhatsApp Interaction
8.OpenClaw Development
  • 1.OpenClaw Connecting to Robot MCP Service
  • 2.Robot CLI Command Tool
  • 3.robot-control Plugin Tool
  • 4.reply-bridge Plugin Tool
  • 5.OpenClaw Multimodal Vision
  • 6.OpenClaw Chassis Control
  • 7.OpenClaw Robotic Arm Control
  • 8.OpenClaw Skills Development
  • 9.OpenClaw Scheduled Tasks
  • 10.OpenClaw Multi-Agent Intelligent Agent
  • 11.OpenClaw Active Interaction
  • 12.OpenClaw Vector Memory
9.OpenClaw Embodied intelligent application
  • 1.OpenClaw Target Tracking
  • 2.OpenClaw Arm Tracking And Grasping
  • 3.OpenClaw Arm Fixed-point Placement
  • 4.OpenClaw Waste Sorting
  • 5.OpenClaw SLAM Mapping And Navigation
  • 6.OpenClaw Navigation Transport
  • 7.OpenClaw AprilTag Grasping
  • 8.OpenClaw Color Line Patrol
  • 9.OpenClaw Visual Distance Measurement
10.OpenClaw scenario sandbox
  • 1.Map Description and Props Placement
  • 2.Building the Sandbox Map
  • 3.Visual Relocalization Marker
  • 4.Map Mapping Marker
  • 5.Sandbox Scenario Comprehensive Case
11.AI Large Model Basics
  • 1.AI Large Model Types and Principles
  • 2.RAG Retrieval Enhancement and Model Training Samples
  • 3.Embodied Intelligent Robot System Architecture
  • 4.Embodied Intelligent Functions Core Source Code
12.AI large Model Development
  • 1.Register a Model Service Provider Account
  • 2.Configuring API-KEY
  • 3.Introduction to Dify
  • 4.Basic Dify Features
  • 5.AI Large Model Development - Chatbot
  • 6.Deploy the RAG Knowledge Base
  • 7.RAG Knowledge Base + Chatbot
  • 8.AI Agent Workflow
  • 9.Custom Wake-up Response
13.AI Model - Voice Version
  • 1.Semantic Understanding and Command Following
  • 2.Multimodal Visual Understanding
  • 3.Multimodal Visual Understanding and Robotic Arm Gripping
  • 4.Multimodal Visual Understanding and SLAM Navigation
  • 5.Robotic arm gripping+Multimodal visual understand+SLAM navigation
  • 6.Intention Understanding
14.AI Model - Text Version
  • 1.Semantic Understanding and Command Following
  • 2.Multimodal Visual Understanding
  • 3.Multimodal Visual Understanding and Robotic Arm Gripping
  • 4.Multimodal Visual Understanding and SLAM Navigation
  • 5.Robotic arm gripping+Multimodal visual understand+SLAM navigation
  • 6.Intention estimation
15.Mediapipe Visual Course
  • 1.Hand detection
  • 2.Posture detection
  • 3.Overall detection
  • 4.Facial Landmark Detection
  • 5.Face detection
  • 6.Face special effects
  • 7.3D object recognition
  • 8.Brush
  • 9.Finger control
  • 10.Palm target positioning
  • 11.Fingertip trajectory recognition
  • 12.Fingertip gesture control robotic arm
  • 13.Gesture grabbing and releasing objects
  • 14.Finger control robotic arm
  • 15.Medipipe gesture control robotic arm action group
16.MoveIt2 Simulation Course
  • 1.MovelT2 configuration
  • 2.MovelT2 simulation-reality linkage
  • 3.Random movement
  • 4.Forward kinematics design
  • 5.Inverse kinematics design
  • 6.Cartesian path
  • 7.Trajectory Planning
  • 8.Collision Detection
  • 9.Scene Design
  • 10.3D perception obstacle‑avoidance
17.Multi-vehicle Course
  • 1.Multi-vehicle Control
  • 2.Multi-vehicle Navigation
  • 3.Multi-vehicle Formation
18.YOLO26 Development
  • 1.CLI Use
  • 2.Object Detection
  • 3.Instance Segmentation
  • 4.Pose Estimation
  • 5.Image Classification
  • 6.Oriented Object Detection
  • 7.YOLOv26 + DeepSORT Tracking
  • 8.Monocular Depth Estimation
19.Control Board STM32 Driver Course
  • 0.Notes (Must Read)
  • 1.About Expansion Board
  • 2.STM32 Development Environment
  • 3.Button Control
  • 4.FreeRTOS Application
  • 5.Serial Communication
  • 6.SBUS Model Aircraft Remote Control
  • 7.CAN Bus Communication
  • 8.RGB Colorful Light Bar
  • 9.Timer Interrupt to Control PWM Servo
  • 10.Control Serial Port Servos
  • 11.Nine-axis Attitude Sensor to Obtain Data
  • 12.Control Motor
  • 13.Timer Captures the Encoder Data
  • 14.1 Kinematic Analysis of Mecanum Wheel
  • 14.2 Kinematic Analysis of Ackerman
  • 14.3 Kinematic Analysis of 4WD
  • 15.PID Control Robot Movement
20.Docker Course
  • 1.Docker Introduction and Installation
  • 2.Docker Basic Commands
  • 3.Docker Submission and Multi-Terminal Access
  • 4. Docker Startup Script
  • 5.Docker-Vscode Environment Construction
21.Image Processing Basics Course
  • 1. Introduction to Open Source CV
  • 2. Image reading and display
  • 3. Image writing
  • 4. Image quality
  • 5. Pixel Operation
  • 6. Image zoom
  • 7. Image cutting
  • 8. Image translation
  • 9. Image Mirroring
  • 10. Affine Transformation
  • 11. Image Rotation
  • 12. Perspective Transformation
  • 13. Grayscale processing
  • 14. Image Binarization
  • 15. Edge Detection
  • 16. Line drawing
  • 17. Rectangle and circle drawing
  • 18. Drawing text and pictures
22.Linux System Course
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Static IP and hotspot mode
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
23.ROS2 Basic Course
  • 1.Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
24.Main Control Course
Jetson Orin Nano_NX
  • 1.Jetson Orin board introduction
  • 2.Restore the factory image system
  • 3.Backup SSD system
  • 4.SSD expansion
  • 5.Network configuration
  • 6.SSH remote login
  • 7.VNC remote control
  • 8.Remote file transfer
  • 9.Jtop tool
  • 10.Exchange space expansion
Raspberry Pi
  • 1. Introduction to Raspberry PI 5
  • 2. Raspberry PI system installation and backup
  • 3. Powering the Raspberry PI 5
  • 4. Startup of Raspberry PI 5
  • 5. Update and upgrade operating system
  • 6. Introduction to raspi-config tool
  • 7. config.txt file description
  • 8. Network Configuration
  • 9. remote access
  • 10. Transfer files remotely
  • 11. Set display resolution and rotation
  • 12. Set screen to sleep
  • 13. Play audio and video
  • 14. Using USB camera
  • 15. Using MIPI camera
  • 16. Get real-time temperature of Raspberry Pi
RDKX5
  • 1.Introduction to RDK X5 board
  • 2.Write system file
  • 3.Hardware interface description
  • 4.Install case and other accessories
  • 5.Network configuration
  • 6.Remote login
  • 7.Update system
  • 8.srpi-config user guide
  • 9.config. txt configuration file
  • 10.Self-startup setting
  • 11.RDK exclusive command usage
  • 12.Linux command usage
  • 13.GPIO readwrite operation
  • 14.Image classification algorithm
  • 15.Use USB camera
  • 16.Use MIPI camera
  • 17.Binocular camera depth algorithm
  • 18. Controlling RGB Cooling Fans
Download
  • System File
  • Code
  • 3D Model File
  • Software Tools
  • Hardware_Info
  • Deb function package
  • Dify AI Agent
Download ZIP

Welcome to ROSMASTER M1 PRO repository

1.OpenClaw Target Tracking

OpenClaw Target Tracking

OpenClaw Target Tracking1. Course ContentCourse OverviewLearning Objectives2. Preparation3. Target Tracking Case4. Source Code Analysis4.1 TargetTrack() — Entry point for starting/canceling tracking4.2 IBVS_tracker.py Tracking Server5. Parameter Debugging6. Common Problems and Solutions

1. Course Content

Course Overview

  • OpenClaw target tracking is a core function of the robot's visual servo control. It tracks the target object in real time through the camera and controls the robotic arm joints to adjust the camera's viewing angle, so that the target always stays in the center of the frame.

  • The target tracking function relies on the preceding GetBbox (object detection) to obtain the initial ROI bounding box, and then starts a tracking thread to continuously correct the joint angles of the robotic arm.

Learning Objectives

  1. Master the operation method for starting and canceling target tracking through OpenClaw.

2. Preparation

  • Start the MCP service. If you need voice replies, you must add the use_tts parameter: use_tts:=true, otherwise it can be omitted.

ros2 launch yahboomcar_bringup mcp_service.launch.py use_camera:=true

 

3. Target Tracking Case

  • Choose any one of the ways to interact with OpenClaw. The demonstration below uses WebChat.

image-20260904100157188.png

  • Move the target object, and the robotic arm will adjust its joint angles to keep the camera always pointed at the target object.

image-20260430174115279

  • If the target's confidence is too low or the target is lost from view, the robotic arm will stop moving.

image-20260430174844339

  • When the target reappears in view, the tracker will automatically search for the target. Once the confidence is greater than 0.1, the robotic arm will re-enter the tracking state.

image-20260430175033132

  • When you need to stop tracking the target, you can give OpenClaw the instruction again.

image-20260904100411814.png

  • The MCP server will print a log indicating that the tracking state for the target has been released.

image-20260430175535755

Important

  • In [OpenClaw Arm Tracking And Grasping], OpenClaw must first track the target before it can grasp it.

4. Source Code Analysis

  • Source code path

xxxxxxxxxx
~/yahboomcar_ros2_ws/yahboomcar_ws/src/multi_brains_pre/multi_brains_pre/action_controller.py

The following is an explanation of the source code of the core target tracking functions in the ActionController class (TargetTrack and the internal functions it calls).


4.1 TargetTrack() — Entry point for starting/canceling tracking

​x
    def TargetTrack(self, x1_or_cmd, y1:int=None, x2:int=None, y2:int=None):
        '''Track the target object by its bounding box, use 'cancel' to stop tracking'''
        # Cancel tracking mode
        if isinstance(x1_or_cmd, str) and str(x1_or_cmd).strip().strip("'\"") == "cancel":
            #step 1: stop arm tracking first (visual_track service)
            if self.visual_track_client.wait_for_service(timeout_sec=5.0):
                response: SetBool.Response = self.visual_track_client.call(SetBool.Request(data=False))
                if not response.success:
                    self.get_logger().warn(f"Failed to stop arm tracking: {response.message}")
            else:
                self.get_logger().warn("visual_track service not available, skip stopping arm tracking")

            #step 2: cancel tracking target
            if not self.cancel_track_client.wait_for_service(timeout_sec=5.0):
                self.get_logger().error("CancelTrack service not available")
                return [False, "CancelTrack service not available"]
            self.cancel_track_client.call(CancelTrack.Request())
            self.get_logger().info("Tracking cancelled")

            #step 3: reset arm to initial pose
            self._reset_joints()
            self.InitArmPose()
            return [True, "Tracking cancelled and arm reset"]

        # Start tracking mode: x1_or_cmd must be a numeric bounding box coordinate
        try:
            x1: int = int(str(x1_or_cmd).strip().strip("'\""))
        except (TypeError, ValueError):
            error_msg = f"Invalid command for TargetTrack: '{x1_or_cmd}'. Use x1,y1,x2,y2 to start or 'cancel' to stop tracking."
            self.get_logger().error(error_msg)
            return [False, error_msg]
        if None in (y1, x2, y2):
            self.get_logger().error("TargetTrack: x1, y1, x2, y2 are all required to start tracking")
            return [False, "Missing bounding box parameters"]
        try:
            y1, x2, y2 = int(str(y1)), int(str(x2)), int(str(y2))
        except (TypeError, ValueError):
            error_msg = f"TargetTrack: invalid bounding box values x1={x1}, y1={y1}, x2={x2}, y2={y2}, must be integers"
            self.get_logger().error(error_msg)
            return [False, error_msg]

        #step 1: request start_track service to initialize the tracking target
        if not self.start_track_client.wait_for_service(timeout_sec=5.0):
            self.get_logger().error("StartTrack service not available")
            return [False, "Tracking service not available"]
        response: StartTrack.Response = self.start_track_client.call(
            StartTrack.Request(x1=x1, y1=y1, x2=x2, y2=y2))
        if not response.success:
            self.get_logger().error("Failed to initialize tracking target")
            return [False, "Failed to initialize tracking target"]
        time.sleep(1.0)

        #step 2: request visual_track service to make the arm track the target
        if not self.visual_track_client.wait_for_service(timeout_sec=5.0):
            self.cancel_track_client.call(CancelTrack.Request())
            self.get_logger().error("visual_track service not available")
            return [False, "visual_track service not available"]
        response: SetBool.Response = self.visual_track_client.call(SetBool.Request(data=True))
        if not response.success:
            self.cancel_track_client.call(CancelTrack.Request())
            self.get_logger().error(f"Failed to start arm tracking: {response.message}")
            return [False, f"Failed to start arm tracking: {response.message}"]
        self.get_logger().info("Tracking started, arm is tracking the target")
        return [True, "Tracking started"]

Code Explanation:

  1. Cancel tracking: If the passed-in parameter is the string "cancel", execute in sequence: stop the gaze thread → cancel the tracking service → restore the robotic arm to its initial pose.

  2. Start tracking: Call start_track_client (a ROS2 service client) to start the target tracking service, passing in the target ROI bounding box coordinates (x1,y1,x2,y2).

  3. Background thread: Start an independent thread _gaze_track_loop to continuously perform visual servo control, without affecting the main thread's response to other instructions.

  4. Parameter validation: The start mode requires complete coordinate parameters; a missing coordinate returns an error.


4.2 IBVS_tracker.py Tracking Server

Code Explanation:

  • _visual_track_callback: The callback function of the visual_track service, which receives a SetBool request and controls the start and stop of tracking.

  • request.data == True branch: If tracking is already in progress, return success directly; otherwise, call _get_joints() to check the availability of the robotic arm service. If it passes, set _tracking_enabled to True and start the daemon thread _track_loop to perform continuous tracking.

  • request.data == False branch: Call _stop_tracking() to stop tracking and release joint resources.

  • _stop_tracking: The core logic for stopping tracking. It sets _tracking_enabled to False to notify the tracking thread to exit, waits for the thread to finish through join(timeout=2.0), and finally calls _reset_joints() to restore the robotic arm to its initial pose.

  • _track_loop: The main loop of visual servo tracking, running continuously at about 4Hz in an independent daemon thread.

  • _get_bbox(): Gets the bbox result of the target detection in the current frame. box[2] is the confidence; when it is lower than 0.08, skip this round of tracking.

  • error_x / error_y: Computes the pixel offset between the target center point and the image center (320, 240).

  • gaze_threshold: The offset threshold. When the offsets in both the x and y directions are less than the threshold, the target is considered centered and no adjustment is needed.

  • _gaze_control(error_x, error_y): Adjusts the robotic arm joint angles according to the pixel offset, so that the target returns to the center of the frame.

xxxxxxxxxx
    def _visual_track_callback(self, request: SetBool.Request, response: SetBool.Response):
        '''Service callback: enable/disable arm-only tracking (no chassis movement)'''
        if request.data:
            if self._tracking_enabled:
                response.success = True
                response.message = "Arm tracking is already running"
                return response
            if not self._get_joints():
                response.success = False
                response.message = "Arm service not available"
                return response
            self._tracking_enabled = True
            self._track_thread = threading.Thread(target=self._track_loop, daemon=True)
            self._track_thread.start()
            self.get_logger().info("visual_track enabled, arm starts tracking target")
            response.success = True
            response.message = "Arm tracking started"
        else:
            self._stop_tracking()
            self.get_logger().info("visual_track disabled, arm stops tracking target")
            response.success = True
            response.message = "Arm tracking stopped"
        return response

    def _stop_tracking(self):
        '''Stop the arm-only tracking loop and release joint resources'''
        self._tracking_enabled = False
        if self._track_thread is not None and self._track_thread.is_alive():
            self._track_thread.join(timeout=2.0)
        self._track_thread = None
        self._reset_joints()

    def _track_loop(self):
        '''Arm-only tracking loop: gaze follows the target without chassis movement'''
        while rclpy.ok() and self._tracking_enabled:
            box = self._get_bbox()
            if box[2] < 0.08:
                self.get_logger().debug("bbox confidence too low, skipping tracking")
                time.sleep(0.2)
                continue

            error_x = box[0] - 320
            error_y = box[1] - 240
            if abs(error_x) <= self.gaze_threshold and abs(error_y) <= self.gaze_threshold:
                self.get_logger().debug("Target centered in view, holding gaze")
            else:
                self._gaze_control(error_x, error_y)
            time.sleep(0.25)

 

5. Parameter Debugging

  • Parameter file path:

xxxxxxxxxx
~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/param/common.yaml
  • Parameters related to the tracking function

xxxxxxxxxx
...
#gaze control
IBVS_tracker:
  ros__parameters:        
    gaze_threshold: 50.0          
    gaze_step: 2                          
...

 

ParameterEffect of increasingEffect of decreasing
gaze_thresholdAllows a larger offset and looser adjustment; below this value no adjustment is madeRequires more precise alignment and more frequent adjustment; too small a value may cause steady-state oscillation of the robotic arm
gaze_stepLarger adjustment stepSmoother adjustment, but prone to overshoot

 

6. Common Problems and Solutions

  • The target ROI box is inaccurate when tracking the target

    • Check whether the ROI box selection of the first frame is accurate when GetBbox selects the target object. For detailed steps, refer to 【OpenClaw Development】—【OpenClaw Multimodal Vision】—【Get Target Bounding Box Coordinates】

    • Verify that the image path is: ~/yahboomcar_ros2_ws/yahboomcar_ws/cache/verify_image.png

      image-20260430180413630

       

OpenClaw Vector Memory
OpenClaw Arm Tracking And Grasping

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文