Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Racing Robot ROS 2 Workspace

Field Content
Team Name 粉壳橙芯队 (Pink Shell Orange Core)
School 安徽建筑大学 (Anhui Jianzhu University)
Captain 李明濠
RDK Model RDK X5
Competition Mode Fully Autonomous

1. System Architecture Overview

This repository is a ROS 2 Humble colcon workspace for a three-stage racing-robot competition running on an RDK X5. The system is divided into three stages, managed by a central launch entry:

competition_total.launch.py
├── Stage 1: QR scan + corridor navigation
├── Stage 2: Inertial race track (clockwise / counterclockwise)
└── Stage 3: Visual search + P-marker detection + stop
  • Stage 1 (racing_stage1): Blind drive, QR code scanning, path reversal, corridor navigation.
  • Stage 2 (racing_stage2): Inertial navigation along a rectangular track. QR result determines clockwise or counterclockwise direction.
  • Stage 3 (racing_stage3): Return to the visual-search goal, detect the P marker, and stop using marker-region depth.

Full production behavior, state transitions, coordinate conventions, and safety rules are documented in RACING_OVERVIEW.md.


2. Hardware Selection & Connections

Component Model / Description
Main Board RDK X5 (Horizon Robotics)
Lidar LSLIDAR N10
Camera Depth camera
Chassis Origincar base with differential drive
Voice Module Voice broadcast module

Connection overview:

  • Lidar: USB serial → /scan topic
  • IMU: I2C → /imu/data topic
  • Camera: USB Video → vision processing pipeline
  • Voice: Serial → audio feedback during competition

3. Software System Design

3.1 Framework

  • ROS 2 Humble with colcon build system
  • Python nodes for all competition logic

3.2 Key Principles

  • Odometry (/odom) provides XY position and distance only.
  • IMU (/imu/data) is the sole source for yaw heading and turn calculations.
  • /cmd_vel is the final base command, published by the Stage 1 supervisor.
  • Stage 2 and Stage 3 publish candidate commands to /stage2_cmd_vel and /stage3_cmd_vel respectively.

3.3 Core Topics

Topic Role
/cmd_vel Final base command
/stage2_cmd_vel, /stage3_cmd_vel Candidate commands from later stages
/imu/data Yaw source for all navigation
/odom_combined XY position and distance source
/scan Lidar input for obstacle avoidance
competition_phase Phase signal: 1 -> 2 -> 3
competition_qr_task QR direction: clockwise or counterclockwise

4. Key Task Implementation Strategies

4.1 QR Code Scanning (Stage 1)

  • Blind drive forward until QR is detected.
  • Parse QR content to determine direction (clockwise / counterclockwise).
  • Reverse along recorded path, then navigate the corridor to the Stage 2 entry point.

4.2 Inertial Navigation (Stage 2)

  • Use IMU yaw for straight-line driving and 90-degree turns.
  • Waypoints defined in field_track_*.yaml (CW / CCW).
  • Segment completion based on distance to target end point.
  • Local obstacle avoidance via lidar (/scan) during straight segments.

4.3 Visual Search & Stop (Stage 3)

  • Return to the visual-search goal area.
  • Detect the P marker using vision model.
  • Stop based on depth estimation from the P-marker bounding box region.

4.4 Voice Broadcast

  • QR code and image-to-text reading.
  • Chinese TTS support.

5. Competition Rule Adaptation

Rule Requirement Implementation
QR task determines direction competition_qr_task → parse_direction() → selects CW/CCW YAML
Fully autonomous operation No remote control; all stages run via launch pipeline
Stage transition competition_phase topic coordinates handover
Obstacle avoidance Lidar-based local avoidance during straight segments
Return to start Stage 3 visual search + P-marker detection

6. Build & Launch

source /opt/ros/humble/setup.bash
colcon build --symlink-install --packages-select racing_bringup
source install/setup.bash
ros2 launch racing_bringup competition_total.launch.py

Stage-specific launch commands:

ros2 launch racing_stage1 competition_stage1.launch.py
ros2 launch racing_stage2 competition_stage2.launch.py
ros2 launch racing_stage3 competition_stage3.launch.py
ros2 launch origincar_base origincar_bringup.launch.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages