A ROS 2‑based autonomous navigation stack for scaled vehicles that fuses LiDAR and depth‑camera data to generate SVM‑inspired virtual barriers and steer safely around obstacles.
This project implements a real‑time obstacle detection and avoidance system on a 1:10 RC vehicle (MacAEV) using:
- Sensor fusion of a 2D SLAMTEC RPLIDAR A2M8 and an Intel RealSense D435 depth camera
- Ground‑plane filtering (RANSAC) and point‑cloud replacement to merge camera and LiDAR ranges
- Convex optimization to compute parallel virtual barriers that maximize clearance
- Finite‑state control (normal, backup, turn) with a PD‑based steering controller for smooth navigation
- RealSense Node publishes
/camera/depthand camera info - RPLIDAR Node publishes
/scan - VESC Driver & Odom Node handle motor commands and odometry
- Ackermann Mux Node routes manual or autonomous
/drivecommands - Nav Node subscribes to
/scan,/camera/depth, and/odom, runs fusion & control, and publishes/drive
- Ground‑Plane Filtering
- Apply RANSAC on the depth image to remove ground points
- Frame Transformation
- Transform remaining depth points into the LiDAR frame
- Data Replacement
- For each beam θᵢ, if camera range rcam < LiDAR range rlidar, replace rlidar with rcam
This yields a fused 1D scan that captures obstacles both above and below the LiDAR plane.
- Barrier Parameters
- Compute heading θhead as weighted average of ranges
- Define left (αl, βl) and right (αr, βr) sectors
- Optimization
Solve:$$\begin{aligned} \min_{w,b}\ &\frac{1}{2}\|w\|^2 \\[6pt] \text{s.t.}\quad & w^\top p_i + b \ge 1, && \forall\,p_i \in \mathcal{P}_{\mathrm{left}},\\\ & w^\top p_j + b \le -1, && \forall\,p_j \in \mathcal{P}_{\mathrm{right}}. \end{aligned}$$ This maximizes the margin (sum of left/right distances) between the two obstacle sets - Finite‑State Machine
- Normal: drive forward, steer to maximize clearance (PD on dlr)
- Backup: reverse when blocked
- Turn: pivot in place if needed
- Chassis: 1:10 RC Car (ARMA Granite 4×4)
- Compute: NVIDIA Jetson Orin Nano AI computer
- Sensors:
- SLAMTEC RPLIDAR A2M8 (2D LiDAR)
- Intel RealSense D435i (RGB‑D camera)
- BNO055 9‑DOF IMU
- TRAMPA VESC 6 MKV motor driver
- Power: VENOM 3S LiPo battery
- Software: Ubuntu 20.04, ROS 2 Foxy, C++17
-
Install dependencies
sudo apt update sudo apt install \ ros-foxy-ros-base \ ros-foxy-ackermann-msgs \ ros-foxy-rplidar-ros
-
To run the full system:
ros2 launch auto_nav nav_launch.py