oselin / vmc_project

Vector Field Histogram (VFH) algorithm implemented in ROS1 and Python3. It has been exploited for achieving Object Avoidance in an autonomous vehicle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vector Field Histogram algorithm implementation

Simple simulation of a turtle bot moving within a maze. Algorithm developed using ROS2 and Python3

Inspired by the paper A Constrained VFH Algorithm for Motion Planning of Autonomous Vehicles

Installation of the ROS package

1 - Move to catkin workspace folder

cd ~/catkin_ws/src/

2 - Clone the repository

git clone git@github.com:oselin/vmc_project.git

3 - Copy the track file into the Gazebo folder

cp -r vmc_project/models ~/.gazebo

3 - Recompile CMakeLists file and source the folder

catkin_make
source ~/.bashrc

Run the program

First of all, launch Gazebo with the chosen track

roslaunch vmc_project project_world.launch

Then, activate the VFH algorithm by running the script

rosrun vmc_project racer.py

If you want to see in real time how data is manipulated, run

rosrun vmc_project plotter.py

or

rosrun vmc_project plotter2.py

Difference between Plotter and Plotter2

The designed node publishes two types of data

  1. velocity commands to the robot
  2. manipulated data, or VF histograms + occupancy map

Since the latter is a very big message (almost 5000 float32 values), to increase the perfomances the following workaround has been designed.

plotter.py: builds the graphs basing on the complex and heavy message

plotter2.py: reads LiDAR values directly from /scan topic and performs the same data manipulation steps as in racer.py. That is to avoid a useless publishing on a custom topic

Known issues in the software

Since this data manipulation is quite complex, the computer cannot keep up with both manipulating data, publishing commands and manging real time plots.

This slows down all the computations, leading to a failure of the algorithm. Workaround: A cool way to see real time plots is to first record the LiDARS values with

rosbag record /scan

And then simulate data publishing, but this time running only the plotter. Therefore

rosbag play <your-recording>

And on a new terminal

rosrun vmc_project plotter2.py

About

Vector Field Histogram (VFH) algorithm implemented in ROS1 and Python3. It has been exploited for achieving Object Avoidance in an autonomous vehicle


Languages

Language:Python 63.8%Language:CMake 36.2%