Skip to content

csucaimeigvc/IGVC_CSUC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IGVC Autonomous Robot Project

An autonomous ground vehicle project for the Intelligent Ground Vehicle Competition (IGVC) featuring computer vision, LiDAR navigation, GPS positioning, and real-time object detection.

πŸš€ Features

  • Computer Vision: DepthAI OAK-D camera with lane segmentation and object detection
  • LiDAR Navigation: RPLidar integration for obstacle detection and mapping
  • GPS Positioning: u-blox GPS with RTK support for precise navigation
  • Real-time Inference: Roboflow-based object detection and lane segmentation
  • ROS2 Integration: Complete ROS2 workspace with custom packages
  • Docker Support: Containerized inference server for scalable deployment

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   DepthAI OAK-D β”‚    β”‚   RPLidar A1    β”‚    β”‚  u-blox GPS     β”‚
β”‚   (Vision)      β”‚    β”‚   (LiDAR)       β”‚    β”‚  (Navigation)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚                      β”‚                      β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚      ROS2 Workspace       β”‚
                    β”‚  - sllidar_ros2           β”‚
                    β”‚  - ublox_gps              β”‚
                    β”‚  - Custom nodes           β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Inference Server        β”‚
                    β”‚   (Roboflow/Docker)       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Prerequisites

Hardware Requirements

  • NVIDIA Jetson (recommended) or x86_64 system
  • DepthAI OAK-D camera
  • RPLidar A1/A2/A3
  • u-blox GPS receiver (NEO-F10N or similar)
  • USB-serial adapters (CH341SER compatible)

Software Requirements

  • Ubuntu 22.04 LTS
  • ROS2 Humble
  • Python 3.8+
  • Docker and Docker Compose
  • NVIDIA drivers (for Jetson)

πŸ› οΈ Installation

1. Clone the Repository

git clone https://github.com/your-username/igvc-robot.git
cd igvc-robot

2. Install System Dependencies

# Install ROS2 Humble
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt upgrade -y
sudo apt install ros-humble-desktop python3-argcomplete python3-colcon-common-extensions python3-rosdep python3-vcstool -y

# Install Python dependencies
sudo apt install python3-pip python3-opencv python3-numpy python3-flask -y

# Install Docker
sudo apt install docker.io docker-compose -y
sudo usermod -aG docker $USER

3. Install Hardware Drivers

CH341SER Driver (USB-Serial)

cd CH341SER
make
sudo make load
sudo cp ch34x.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/
sudo depmod -a

DepthAI SDK

# For Jetson
pip3 install depthai

# For x86_64
pip3 install depthai[examples]

4. Setup ROS2 Workspace

cd ros2_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bash

5. Install Python Dependencies

pip3 install -r requirements.txt

πŸš€ Quick Start

1. Start the Inference Server

# Start Roboflow inference server
docker-compose up -d

2. Launch ROS2 Nodes

# Terminal 1: Start LiDAR
./start_lidar.sh

# Terminal 2: Start GPS
ros2 launch ublox_gps neo_f10n_nmea.launch.py

# Terminal 3: Start camera processing
python3 oakd_web_stream.py

3. View Data

# List available topics
ros2 topic list

# Monitor specific topics
ros2 topic echo /scan
ros2 topic echo /gps/fix

πŸ“ Project Structure

igvc-robot/
β”œβ”€β”€ ros2_ws/                    # ROS2 workspace
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ sllidar_ros2/       # LiDAR ROS2 package
β”‚   β”‚   └── ublox/              # GPS ROS2 packages
β”‚   β”œβ”€β”€ build/                  # Build directory
β”‚   β”œβ”€β”€ install/                # Install directory
β”‚   └── log/                    # Build logs
β”œβ”€β”€ CH341SER/                   # USB-serial driver
β”œβ”€β”€ depthai-python/             # DepthAI SDK
β”œβ”€β”€ oakd_*.py                   # Camera processing scripts
β”œβ”€β”€ test_*.py                   # Test scripts
β”œβ”€β”€ docker-compose.yaml         # Docker configuration
β”œβ”€β”€ Dockerfile.roboflow         # Roboflow inference container
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ start_lidar.sh             # LiDAR startup script
└── README.md                   # This file

πŸ”§ Configuration

GPS Configuration

Edit ros2_ws/src/ublox/ublox_gps/config/neo_f10n.yaml:

device: /dev/ttyNEO_F10N
uart1:
  baudrate: 38400
frame_id: gps
rate: 4

LiDAR Configuration

Edit ros2_ws/src/sllidar_ros2/launch/sllidar_a1_launch.py:

serial_port: '/dev/ttyUSB0'
serial_baudrate: 115200
frame_id: 'laser'

Camera Configuration

Edit camera scripts to adjust:

  • Model IDs and API keys
  • Confidence thresholds
  • Output directories
  • Stream settings

πŸ§ͺ Testing

Test Individual Components

# Test camera
python3 test_oakd.py

# Test Roboflow API
python3 test_roboflow_api.py

# Test local inference
python3 test_local_roboflow.py

Test ROS2 Packages

# Build and test
cd ros2_ws
colcon build --packages-select sllidar_ros2
colcon test --packages-select sllidar_ros2

πŸ“Š Performance Monitoring

ROS2 Topics

  • /scan - LiDAR data
  • /gps/fix - GPS position
  • /gps/vel - GPS velocity
  • /camera/image_raw - Camera feed

Web Interfaces

  • Camera stream: http://localhost:5000
  • Inference results: http://localhost:5000/stream

πŸ› Troubleshooting

Common Issues

  1. Permission denied on /dev/ttyUSB0

    sudo chmod 666 /dev/ttyUSB0
    # Or add user to dialout group
    sudo usermod -a -G dialout $USER
  2. GPS not connecting

    • Check baud rate settings
    • Verify device path: ls /dev/tty*
    • Test with: cat /dev/ttyNEO_F10N
  3. Camera not detected

    • Check USB connection
    • Install DepthAI drivers
    • Test with: python3 test_oakd.py
  4. ROS2 nodes not starting

    • Source setup files: source install/setup.bash
    • Check dependencies: rosdep install --from-paths src --ignore-src -r -y

Debug Commands

# Check ROS2 topics
ros2 topic list
ros2 topic echo /scan

# Check device permissions
ls -la /dev/tty*

# Monitor system resources
htop
nvidia-smi  # For Jetson

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit changes: git commit -am 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • DepthAI for OAK-D camera support
  • Roboflow for inference infrastructure
  • Slamtec for RPLidar drivers
  • u-blox for GPS solutions
  • ROS2 community for excellent robotics framework

πŸ“ž Support

For questions and support:

  • Create an issue on GitHub
  • Check the troubleshooting section
  • Review ROS2 and hardware documentation

Note: This project is designed for educational and competition purposes. Always follow safety guidelines when operating autonomous vehicles.

About

IGVC repo for Jetson Orin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors