Skip to content

README.md

Machine-translated by Robotheca from the original in Chinese (opens in a new tab). License: MIT (opens in a new tab).

HomeBot

(opens in a new tab) (opens in a new tab)

HomeBot is a lightweight robot project designed for home scenarios. It adopts a layered modular architecture and the ZeroMQ communication bus, supporting various applications such as mobile remote control, voice interaction, imitation learning, and human following.

Effect diagram

Changelog

Latest Versions
Upcoming Releases
  • SLAM Navigation Module (in development, see homebot-navi (opens in a new tab) branch): LiDAR SLAM mapping and localization, occupancy grid maps, A* global path planning, local obstacle avoidance, odometry/depth estimation services, AprilTag perception, map editor and simulation environment, supporting switching between mapping mode and navigation mode

๐Ÿ“‹ View full update log

System Architecture

Picture: ๆ•ดไฝ“ๆžถๆž„.jpg

Project Structure

homebot/
โ”œโ”€โ”€ docs/                      # Documentation (Chinese)
โ”œโ”€โ”€ hardware/                  # Hardware design files (STEP, STL)
โ”‚   โ””โ”€โ”€ structure/
โ”œโ”€โ”€ software/                  # Software code
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ common/            # Common utilities, message definitions, configuration classes
โ”‚   โ”‚   โ”œโ”€โ”€ configs/           # Runtime configurations (config.py)
โ”‚   โ”‚   โ”œโ”€โ”€ applications/      # Application layer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ remote_control/    # Web remote control (including video stream)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gamepad_control/   # Gamepad control (Xbox controller)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ human_follow/      # Human following (YOLO + visual servoing)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ speech_interaction/ # Speech interaction
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ imitation_learning/ # Imitation learning
โ”‚   โ”‚   โ”œโ”€โ”€ services/          # Service layer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ motion_service/    # Chassis control service
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ chassis_arbiter/  # Arbiter core
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ vision_service/    # Vision service (image capture and publishing)
โ”‚   โ”‚   โ”œโ”€โ”€ hal/               # Hardware Abstraction Layer (HAL)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ camera/        # Camera driver
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chassis/       # Chassis driver
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gamepad/       # Xbox controller driver
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ftservo_driver.py  # Feetech servo motor low-level driver
โ”‚   โ”‚   โ”œโ”€โ”€ examples/          # Example code
โ”‚   โ”‚   โ””โ”€โ”€ tests/             # Test code
โ”‚   โ”œโ”€โ”€ models/                # Machine learning models (e.g., YOLOv8)
โ”‚   โ”œโ”€โ”€ tools/                 # Helper scripts (device inspection, calibration, model download, etc.)
โ”‚   โ”œโ”€โ”€ start_system.py        # Cross-platform system launcher
โ”‚   โ”œโ”€โ”€ start_human_follow.py  # Launch human following
โ”‚   โ””โ”€โ”€ start_chassis_service.py
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ pyproject.toml             # Build system configuration
โ”œโ”€โ”€ setup.py                   # Package installation configuration
โ””โ”€โ”€ README.md                  # Project description

Features

  • Pure Python implementation, easily cross-platform (Windows, Linux, Mac, Raspberry Pi)
  • ZeroMQ communication bus, low latency, low resource consumption
  • Web-based remote control, supports mobile/tablet/PC, real-time video streaming
  • Gamepad control, Xbox controller simultaneously controls the chassis and robotic arm
  • Human following, vision servo auto-following based on YOLO26
  • Emergency stop lock, requires manual reset after triggering for safety
  • One-click startup script, automatically checks for port conflicts and starts all services
  • Hardware abstraction layer, adaptable to different sensors and actuators
  • Layered modular design, easy to extend new functions

Installation

# In the project root directory
python -m pip install -e .

Or install dependencies manually:

pip install -r requirements.txt

Quick Start

Basic Configuration

Robot-related configurations are uniformly stored in software/src/config/configs.py.

Required configurations: chassis and robotic arm serial port settings.

@dataclass
class ArmConfig:
    """Robotic arm configuration"""
    serial_port: str = "/dev/tty.usbmodem5AE60527771"  # Default shared with chassis, can also be configured independently
    baudrate: int = 1000000
    # Remaining configuration omitted

@dataclass
class ChassisConfig:
    """Chassis configuration - read from robot configuration file"""
    # Serial port configuration (Windows: COM3, Linux: /dev/ttyUSB0)
    serial_port: str = "/dev/tty.usbmodem5AE60527771" # Default shared with robotic arm, can also be configured independently
    baudrate: int = 1000000
    # Remaining configuration omitted

For more configuration options, see Configuration Modification Guide.

Device Information Viewer

Quickly view available serial ports, cameras, and microphones in the system to facilitate configuration changes:

cd software
python tools/list_devices.py

Example output:

๐Ÿ“Ÿ Serial port: COM15
   Description: USB-SERIAL CH340

๐Ÿ“ท Camera index: 0
   Resolution: 1920x1080

๐ŸŽค Microphone index: 1
   Name: Microphone (Realtek(R) Audio)

For more tool scripts (robotic arm calibration, model downloading, etc.), see ๐Ÿ‘‰ Tool Script Usage Guide

Robotic Arm Calibration (First Use)

For first-time use or after replacing the robotic arm's servos, zero-point calibration is required:

cd software
python tools/calibrate_arm.py

Follow the prompts to move each joint of the robotic arm to the zero position. After completion, the calibration data will be automatically saved.

๐Ÿ‘‰ For detailed instructions, see the Tool Script Usage Guide

One-click Service Startup
cd software
python start_system.py

This will start three services:

  • Chassis Service & Robotic Arm Service (ZeroMQ: tcp://127.0.0.1:5556 & tcp://127.0.0.1:5557)
  • Vision Service (Camera PUB: tcp://127.0.0.1:5560)
  • Web Control End (Flask: http://0.0.0.0:5000 (opens in a new tab))

During startup, port occupancy will be checked, and prompts will be provided if any ports are occupied.

Control Method 1: Accessing the Web Control Interface

Open a mobile phone or computer browser on the local area network and visit:

http://<robot-ip>:5000

The interface includes:

  • Real-time video stream (camera feed)
  • Virtual joystick (left side for controlling chassis movement)
  • Emergency stop button (red, locks the chassis when triggered)
  • Return-to-home button (blue, unlocks the emergency stop)
Control Method 2: Gamepad Control

Use an Xbox gamepad to control both the chassis and the robotic arm simultaneously:

# 1. Start the chassis service
cd software/src
python -m services.motion_service.chassis_service

# 2. Start the arm service
python -m services.motion_service.arm_service

# 3. Start the gamepad control
python -m applications.gamepad_control

Control Mapping:

  • Chassis: Left stick (movement/rotation) + LT/RT (translation)
  • Arm: Right stick (base/extension) + D-pad (lifting/rotation) + Y/A/B (wrist flip) + RB/LB (gripper)
  • System: Back (emergency stop) / Start (reset)

For detailed instructions ๐Ÿ‘‰ Gamepad Control User Guide

Control Method 3: AI Assistant Control (Picoclaw)

Control via the Picoclaw AI assistant using natural language:

"Make the robot move forward 20 centimeters"
"Turn right 90 degrees"
"What does the robot see?"

Picoclaw automatically parses commands and controls the robot, supporting chassis movement, robotic arm control, visual queries, and more.

For details, see ๐Ÿ‘‰ Complete Guide to Controlling HomeBot with Picoclaw

Human Following Function

HomeBot provides real-time human following based on YOLO26, supporting visual servo control to enable the robot to automatically follow the target human.

Technical Features
FeatureDescription
Detection ModelYOLO26-nano (~2.4MB)
Detection SpeedCPU 38ms/frame, 43% faster than YOLO11
Tracking AlgorithmIoU matching + Kalman filter
Control AlgorithmVisual Servoing
Control Priorityauto=3 (can be preempted by emergency)
Quick Experience

After starting the system service, simply click the human-following button on the web page. It takes about 5-10 seconds to start (loading the model).

Operating Modes
  • FOLLOWING: Normal following of the target
  • SEARCHING: Target lost, spinning in place to search
  • IDLE: Idle state
  • PAUSED: Paused state
Control Logic
  • Horizontal Control: Target on the left side of the screen โ†’ turn left, right side โ†’ turn right
  • Distance Control: Target too small (too far) โ†’ move forward, too large (too close) โ†’ move backward
  • Loss Handling: Rotate to search when briefly lost, stop when completely lost
Configuration Parameters

Edit software/src/configs/config.py:

@dataclass
class HumanFollowConfig:
    model_path: str = "models/yolo26n.pt"
    target_distance: float = 1.0        # Target distance (meters)
    kp_linear: float = 0.001            # Linear velocity P coefficient
    kp_angular: float = 0.003           # Angular velocity P coefficient
    max_linear_speed: float = 0.3       # Maximum linear speed
    max_angular_speed: float = 0.8      # Maximum angular speed
    max_tracking_age: int = 30          # Maximum lost frames

For more details, please refer to the Human Following User Guide.

Web Remote Control Functions

Video Stream Display
  • Automatically connects to VisionService to obtain camera footage
  • Supports real-time MJPEG streaming playback
  • Automatic offline detection, displays offline status
Emergency Stop Mechanism
  • Click Emergency Stop โ†’ the chassis stops immediately and enters locked state
  • During locking:
    • Joystick operations are ignored
    • The chassis rejects all movement commands
    • The button displays "Locked"
  • Click Reset โ†’ unlock and restore normal control
Status Indicators
  • WebSocket Status โ€“ Connection status indicator
  • Arbitrator Status โ€“ Chassis service connection status
  • Video Status โ€“ LIVE / OFFLINE
  • FPS Display โ€“ Joystick command transmission frequency

Development Standards

Start Service Modules
# Chassis service
python -m services.motion_service.chassis_service [--port COM3]

# Arm service
python -m services.motion_service.arm_service

# Vision service
python -m services.vision_service [--display]

# Web control end
python -m applications.remote_control [--host 0.0.0.0] [--port 5000]

# Human body following
python -m applications.human_follow [--display]

# Gamepad control
python -m applications.gamepad_control [--controller 0] [--verbose]
Subscribe to Image Stream
from services.vision_service import VisionSubscriber
import cv2

sub = VisionSubscriber("tcp://localhost:5560")
frame_id, frame = sub.read_frame()  # Read a single frame

# Or read continuously
sub.read_loop(callback=process_frame)
Message Format

Chassis control command:

{
    "source": "web",        # Control source: web/voice/auto/emergency/home
    "vx": 0.5,              # Linear velocity X (m/s)
    "vy": 0.0,              # Linear velocity Y (m/s)
    "vz": 0.3,              # Angular velocity Z (rad/s)
    "priority": 1           # Priority: 1=web, 2=voice, 3=auto, 4=emergency
}
Custom Application Development

HomeBot New Application Development Guide

Extensions

  • AI assistant control โ€“ Control the robot using natural language via Picoclaw
  • Gamepad control โ€“ Directly control the robot using an Xbox gamepad; see the Gamepad Control Guide

Possible additions in future iterations:

  • MQTT bridge โ€“ Remote control via the cloud
  • Multi-robot coordination โ€“ Distributed task execution
  • SLAM navigation โ€“ Autonomous mapping and localization
  • Voice interaction โ€“ Integration with large language models
  • Imitation learning โ€“ Compatible with the LeRobot framework

Last updated: 2026-07-09

Files by @choco-robot, at commit 7c17ed6, read from GitHub in your browser. Hardware license: MIT; software license: MIT. Robotheca doesn't review code: read it before running it.