Autonomous navigation simulation for the IGVC (Intelligent Ground Vehicle Competition) course using ROS 2 Humble, Gazebo, and Navigation2. Features lane detection, LiDAR obstacle avoidance, and waypoint-based path following.
Clone from GitHub → git clone https://github.com/PixelPepper/IGVC_2.git → Works from any directory (no hardcoded paths).
- Gazebo simulation – Orange robot in IGVC-style world with lanes, cones, and obstacles
- Lane detection – HSV-based white/yellow lane segmentation via OAK-D Pro camera
- Navigation2 – Path planning and obstacle avoidance with fused LiDAR + lane boundaries
- Waypoint navigation – Sequential waypoint following through the course
- Robot localization – EKF fusion of wheel odometry and IMU
- RViz visualization – Costmaps, paths, LiDAR, and camera feeds
- OS: Ubuntu 22.04 (Jammy)
- ROS 2: Humble
- Gazebo: Gazebo Classic (gazebo11)
- Python: 3.10+
- Display: For Gazebo and RViz (X11 or headless with virtual display)
Install ROS 2 Humble and common packages:
sudo apt update
sudo apt install -y ros-humble-desktop ros-humble-gazebo-ros-pkgs
sudo apt install -y ros-humble-nav2-bringup ros-humble-navigation2
sudo apt install -y ros-humble-robot-localization
sudo apt install -y ros-humble-cv-bridge ros-humble-vision-opencv
sudo apt install -y ros-humble-pcl-ros ros-humble-pcl-conversions
sudo apt install -y ros-humble-pointcloud-to-laserscan
sudo apt install -y ros-humble-robot-state-publisher ros-humble-joint-state-publisher
sudo apt install -y ros-humble-xacro ros-humble-urdf
sudo apt install -y ros-humble-gazebo-plugins
sudo apt install -y ros-humble-tf2 ros-humble-tf2-ros ros-humble-tf2-geometry-msgs
sudo apt install -y ros-humble-laser-geometry
sudo apt install -y ros-humble-sensor-msgs ros-humble-geometry-msgs ros-humble-nav-msgssudo apt install -y python3-opencv python3-numpy python3-pip
sudo apt install -y libpcl-dev pcl-tools# Linefit ground segmentation (orange_sensor_tools)
sudo apt install -y ros-humble-linefit-ground-segmentation-ros
# Velodyne (if using 3D LiDAR)
sudo apt install -y ros-humble-velodynegit clone https://github.com/PixelPepper/IGVC_2.git
cd IGVC_2The repository is self-contained (no submodules).
setup_orange.sh auto-detects the workspace from its location—no path edits needed. Clone as IGVC_2 (default) or any name; just cd into your clone directory before sourcing.
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bashsource setup_orange.shTerminal 1 – Gazebo
cd IGVC_2 # or your workspace path
source setup_orange.sh
ros2 launch orange_gazebo orange_igvc_simple.launch.xmlTerminal 2 – Navigation + Perception
cd IGVC_2
source setup_orange.sh
ros2 launch orange_gazebo igvc_perception_full.launch.xmlTerminal 3 – RViz (optional)
cd IGVC_2
source setup_orange.sh
rviz2 -d igvc_perception.rvizTerminal 4 – Run course
cd IGVC_2
source setup_orange.sh
python3 navigate_igvc_course.py
# or: ./run_igvc_course.shThe system uses a layered ROS 2 architecture:
- Simulation (Gazebo) → Localization (EKF) → Perception (lane detection, fusion) → Navigation2 → cmd_vel → Gazebo
Key topics: /odom, /imu, /hokuyo_scan, /oak/rgb/image_raw → EKF and perception → /fused_scan, /lane_cloud → Nav2 costmaps → /cmd_vel.
Documentation:
- docs/ARCHITECTURE.md – In-depth architecture, layers, TF tree, config files
- docs/TOPIC_GRAPH.md – Mermaid diagram and topic tables
- docs/SETUP_GUIDE.md – Step-by-step setup for new users
IGVC_2/
├── src/
│ ├── orange_ros2/ # Core Orange robot packages
│ │ ├── orange_description # Robot URDF, sensors (OAK-D Pro, Hokuyo)
│ │ ├── orange_gazebo # Gazebo worlds, spawn, launch
│ │ ├── orange_perception # Lane detection, point cloud fusion
│ │ ├── orange_sensor_tools
│ │ ├── orange_navigation
│ │ └── ...
│ ├── linefit_ground_segmentation_ros2/
│ ├── velodyne/
│ └── ...
├── docs/ # Architecture and setup documentation
│ ├── ARCHITECTURE.md # System design, layers, TF tree
│ ├── TOPIC_GRAPH.md # Topic diagram and tables
│ └── SETUP_GUIDE.md # New user setup guide
├── navigate_igvc_course.py # Waypoint navigation script
├── nav2_params_fused.yaml # (legacy; primary: orange_gazebo/config/)
├── igvc_perception.rviz # RViz config
├── setup_orange.sh # Workspace setup
├── FINAL_SETUP_GUIDE.md # Detailed setup instructions
└── README.md
- Waypoints: Edit
navigate_igvc_course.py(self.waypoints) - Nav2 params:
orange_gazebo/config/nav2_params_fused.yaml(costmaps, inflation, goal tolerance) - Lane detection:
orange_perception(HSV thresholds, morphological ops) - Robot spawn:
orange_igvc_simple.launch.xml(position, yaw)
| Issue | Solution |
|---|---|
| Gazebo window doesn't open | Run DISPLAY=:0 gzclient & in a separate terminal |
| Lane detection shows 0 points | Check camera topic /oak/rgb/image_raw, adjust camera pitch/position |
| Robot stuck at waypoint | Increase xy_goal_tolerance in nav2_params_fused.yaml |
| Build errors | Run rosdep install --from-paths src --ignore-src -r -y |
Apache-2.0 (see package package.xml files)
- KBKN Autonomous Robotics Lab – Original Orange robot repository
- ROS 2 Navigation2, Gazebo, OpenCV