Skip to content

Python simulation of a robot navigating toward a target while avoiding dynamic obstacles. Utilizing the Pure Pursuit algorithm for path following and the Vector Field Histogram (VFH) for real-time obstacle avoidance, the robot intelligently adjusts its course to reach the target safely. Visualizations include the robot’s path

Notifications You must be signed in to change notification settings

devanys/VFH-Collision-Avoidance

Repository files navigation

VFH for Collision Avoidance

Screenshot 2024-11-02 163145 Watch the video

Robot Navigation Simulation with Pure Pursuit and Vector Field Histogram

This project simulates a robot navigating towards a target while avoiding dynamic obstacles using the Pure Pursuit Method for path following and Vector Field Histogram (VFH) for obstacle avoidance.


Overview

This simulation demonstrates:

  1. Pure Pursuit Path Following
    The robot calculates the angle toward the target and adjusts its orientation accordingly to follow the path.

  2. Vector Field Histogram (VFH) Obstacle Avoidance
    The robot scans its environment to detect nearby obstacles, generating a histogram of distances within its field of view. When obstacles are detected within a certain threshold distance, the robot adjusts its orientation to avoid them.

  3. Dynamic Obstacles
    Obstacles move randomly, adding complexity to the robot's navigation task.


Features

  • Dynamic Targeting: The robot continuously re-orients toward a target position.
  • Obstacle Avoidance: Upon detecting obstacles, the robot selects a safe angle to prevent collisions.
  • Real-time Plotting: The simulation visually represents the robot, target, obstacles, and sensor beams.
  • Polar Histogram Display: An inset plot shows the polar histogram of obstacle distances.

Kinematics Control

Kinematics.Control.mp4

Kinematics*

Model of a differential-drive mobile robot, using wheel angular velocities, body velocities, and pose representation


Screenshot 2025-11-22 092352

Robot Pose Representation**

Robot pose at time step i is:

image

Where:

  • xi​,yi: robot position in global frame.
  • ψi: robot orientation (heading).

Time derivative:

image

Control Inputs (Wheel Speeds)**

The control inputs are wheel angular velocities:

image

Where:

  • θ˙iR: right wheel angular velocity
  • θ˙iL: left wheel angular velocity.

Distance between wheels:

  • d: wheelbase

Forward Kinematics (Wheel → Robot Velocity)**

Robot linear and angular velocities are expressed as:

image

Where:

  • vi​: robot linear velocity
  • wi: robot angular velocity

Inverse Kinematics (Robot Velocity → Wheel Speeds)**

To compute the wheel angular velocities from robot velocities:

image

Velocity Mapping to Global Frame**

Mapping from robot velocity in body frame to global coordinates:

image

the global motion is:

  • x˙i​: vi ​cos ψi
  • y˙i: vi ​sin ψi​
  • ψ˙i: wi​

About

Python simulation of a robot navigating toward a target while avoiding dynamic obstacles. Utilizing the Pure Pursuit algorithm for path following and the Vector Field Histogram (VFH) for real-time obstacle avoidance, the robot intelligently adjusts its course to reach the target safely. Visualizations include the robot’s path

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages