Skip to content

kngyeol/TeamPathfinders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeamPathfinders - Xycar Autonomous Driving

ROS 기반 Xycar 자율주행 프로젝트. Bezier 곡선 경로 생성, Pure Pursuit 추적, 카메라/IMU 센서 융합, 차선 검출 등의 자율주행 핵심 알고리즘을 구현한다.

프로젝트 구조

TeamPathfinders/
├── assignment_1/          # 자율 주차 (Bezier + Pure Pursuit)
│   └── src/
│       ├── assignment_1/  # 주차 제어 패키지
│       │   ├── src/
│       │   │   ├── main.py       # 시뮬레이터 진입점
│       │   │   └── parking.py    # 경로 생성 & 추적 로직
│       │   ├── launch/
│       │   │   └── parking.launch
│       │   └── image/            # 차량/로고 이미지
│       └── xycar_msgs/           # 커스텀 ROS 메시지
│
├── assignment_2/          # 자율 주행 (카메라 + IMU)
│   ├── start.launch       # 환경 + 주행 통합 실행
│   ├── assignment_2/      # 주행 제어 패키지
│   │   ├── src/
│   │   │   └── driving.py # 녹색 신호 감지 + 거리 기반 제어
│   │   └── launch/
│   │       └── driving.launch
│   └── xycar_msgs/        # 커스텀 ROS 메시지
│
└── ref/                   # 레퍼런스 - 차선 검출
    └── src/
        ├── lane_detection/
        │   ├── main.py           # ROS 카메라 뷰어 노드
        │   ├── test_detections.py # 오프라인 테스트
        │   └── utils/
        │       ├── detector.py    # Canny+Sobel 에지 + 슬라이딩 윈도우
        │       ├── imagewarp.py   # 원근 변환 (Bird's-eye View)
        │       └── interpolator.py # 다항식 피팅 + 등거리 차선
        └── xycar_msgs/

기술 스택

구분 기술
프레임워크 ROS Noetic (catkin)
언어 Python 3
컴퓨터 비전 OpenCV, scikit-image
수치 연산 NumPy
시각화 Pygame (주차 시뮬레이터)
센서 카메라 (USB), IMU, 초음파

핵심 알고리즘

Assignment 1 — 자율 주차

  • 경로 생성: 3차 Bezier 곡선으로 현재 위치 → 주차 목표까지의 부드러운 경로 생성
  • 경로 추적: Pure Pursuit 알고리즘으로 전방 주시 거리 기반 조향 제어
  • 후진 판단: 경로 굴곡점(inflection point) 탐지로 전진/후진 자동 전환

Assignment 2 — 자율 주행

  • 출발 감지: HSV 색공간 녹색 신호 검출
  • 속도/거리 추적: IMU 가속도 적분
  • 경로 제어: 누적 거리 기반 조향/속도 프로파일

Reference — 차선 검출

  • 에지 검출: Canny + Sobel 이중 필터링
  • 원근 변환: Bird's-eye View 변환
  • 차선 피팅: 다항식 회귀 + RANSAC 이상치 제거
  • 차선 추정: 단일 차선에서 등거리 평행 차선 생성

커스텀 ROS 메시지

xycar_motor.msg

Header header
int32 angle    # 조향각 (도)
int32 speed    # 속도

xycar_ultrasounds.msg

Header header
sensor_msgs/Range[] ranges   # 초음파 센서 배열

빌드 및 실행

빌드

cd assignment_1  # 또는 assignment_2
catkin_make
source devel/setup.bash

실행

주차 시뮬레이션:

roslaunch assignment_1 parking.launch

자율 주행:

roslaunch assignment_2 driving.launch

차선 검출 테스트 (오프라인):

cd ref/src/lane_detection
python3 test_detections.py

Team Pathfinders

About

ROS 기반 Xycar 자율주행 프로젝트 — Bezier 경로 생성, Pure Pursuit 추적, 카메라/IMU 센서 융합, 차선 검출

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors