GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AbdallahElkashef/ros2-vehicle-lateral-longitudinal-control: ROS 2 implementation of a PID-based autonomous lane keeping and precise stopping controller developed during the Assiut Motorsport Autonomous Team Newcomer Program.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
coppelia
coppelia
 
 
images
images
 
 
resource
resource
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.xml
package.xml
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

šŸš— ROS 2 PID-Based Autonomous Lane Keeping & Precise Stopping

This repository contains a ROS 2 implementation of a closed-loop autonomous driving controller that performs lane keeping, speed regulation, and precise stopping using PID control.

The system was developed as part of the Assiut Motorsport Autonomous Team Newcomer Program, focusing on real-world autonomous vehicle control software.


🧠 System Architecture

Two independent real-time PID controllers operate simultaneously:

Controller Function
Lateral PID Minimizes lateral deviation using steering angle
Longitudinal PID Controls throttle and braking for speed tracking and stopping

Both controllers rely on live odometry feedback.


šŸŽÆ Control Strategy

Lateral Control

The lateral error is computed as:

e_x = x_desired āˆ’ x_current

A PID controller continuously adjusts the steering angle to keep the vehicle centered in the lane.


Longitudinal Control

The longitudinal controller operates in two phases:

Phase Behavior
Cruising Track target speed using throttle PID
Terminal Disable throttle and apply full braking

The mission only terminates when the vehicle reaches the target position and its velocity becomes zero, guaranteeing a true physical stop.


āš™ļø Key Technical Features

  • Dual real-time PID control loops
  • Anti-windup protection
  • Quaternion to yaw conversion
  • Velocity magnitude estimation
  • ROS 2 Action Server for mission control
  • Hard stop enforcement logic for zero-velocity convergence

šŸ—‚ļø ROS 2 Interfaces

Type Name
Throttle /cmd_vel
Brakes /brakes
Steering /SteeringAngle
Odometry /odom
Action Server /reach_target

šŸ“ Package Structure

. ā”œā”€ā”€ coppelia │ ā”œā”€ā”€ c_drive0.py │ ā”œā”€ā”€ c_drive1.py │ ā”œā”€ā”€ c_drive2.py │ ā”œā”€ā”€ task_0.py │ └── task2_pid.py ā”œā”€ā”€ package.xml ā”œā”€ā”€ setup.py ā”œā”€ā”€ setup.cfg └── resource └── coppelia


ā–¶ļø Running the Controller

Build workspace:

colcon build
source install/setup.bash

Run node:

ros2 run coppelia task2_pid.py

Send mission goal:

ros2 action send_goal /reach_target my_own_action/action/ReachTarget "{target_distance: -80.0}"


šŸ Skills Demonstrated

  • Autonomous vehicle control systems
  • PID-based lateral and longitudinal control
  • ROS 2 real-time robotics software
  • Closed-loop feedback system design
  • Autonomous stopping logic
  • Team-based engineering (Assiut Motorsport)

šŸ‘Øā€šŸ’» Author

Abdallah Elkashef
Autonomous Systems Engineer — Assiut Motorsport

About

ROS 2 implementation of a PID-based autonomous lane keeping and precise stopping controller developed during the Assiut Motorsport Autonomous Team Newcomer Program.

Topics

assuit-motorsportautonomous-drivingcontrol-systemscoppeliasimlane-keepingpid-controlroboticsros2self-driving-carvehicle-control

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.