Skip to content

This repository contains a complete setup for a wall‑follower robot simulation using CoppeliaSim and a Python‑based controller. The project includes a ready‑made scene with a Pioneer P3DX mobile robot, a configurable PID controller implemented in Python, and auxiliary scripts to connect to the simulator using a Remote API. The goal of this project

Notifications You must be signed in to change notification settings

mijay6/CoppeliaSim-Wall-Follower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoppeliaSim Wall Follower

Language: Python License: MIT University: UPT Status: Academic Project Version

Description

This repository contains a complete setup for a wall‑follower robot simulation using CoppeliaSim and a Python‑based controller. The project includes a ready‑made scene with a Pioneer P3DX mobile robot, a configurable PID controller implemented in Python, and auxiliary scripts to connect to the simulator using a Remote API. The goal of this project is to provide a clear, educational example of how to build and tune a wall‑following-PID algorithm.

Dependencies

This project relies on several Python packages and system libraries to communicate with CoppeliaSim and process sensor data:

  • CBOR – Used to serialise and deserialise messages between Python and CoppeliaSim. Install it via apt or pip:
    sudo apt install python3-cbor      
    # or, using pip
    python3 -m pip install cbor
  • ZeroMQ (pyzmq) – Provides asynchronous messaging and sockets for the Remote API:
    sudo apt install python3-zmq       
    # or, using pip
    python3 -m pip install pyzmq
  • NumPy – Numerical library used for handling sensor arrays:
    python3 -m pip install numpy
  • OpenCV (optional) – Required only if you plan to use the camera from CoppeliaSim:
    python3 -m pip install opencv-python

If CoppeliaSim fails to start due to a missing Qt platform plugin (error mentioning xcb), install the required system libraries as follows:

sudo apt-get update && sudo apt-get install -y \
  libxcb-xinerama0 libxcb-icccm4 libxcb-image0 \
  libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \
  libxcb-shape0 libxcb-xfixes0 libxcb-xkb1 libxkbcommon-x11-0

How to Use

  1. Configure the environment – Before running any Python scripts, source the configuration script to set up the correct PYTHONPATH:

    source config.bash

    This step must be repeated each time you open a new terminal so that Python can find the Remote API client.

    Verify if the CoppeliaSim API client library (ZeroMQ) is installed correctly.

    python3 -c "from coppeliasim_zmqremoteapi_client import RemoteAPIClient; print('OK')"
  2. Open the simulation – Launch CoppeliaSim and open the scene file located in scenes/wallFollower.ttt. The scene contains the Pioneer P3DX robot, the floor and walls for wall‑following, and a small child script that draws the robot’s trajectory for visualisation.

  3. Run the controller – From the root of the repository, execute the Python control script:

    python3 wall_follower_pid.py

    The script connects to the running simulator, starts the simulation, reads the sonar sensors and sends wheel commands to perform wall following using a configurable PID controller. Tune the gains in Config within wall_follower_pid.py to change the behaviour of the robot.

Documentation

Video Tutorial

Author

Dobra Mihai

Politehnica University of Timișoara
Faculty of Automation and Computer Science
Robotics Elements
Academic Year 2025–2026

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

About

This repository contains a complete setup for a wall‑follower robot simulation using CoppeliaSim and a Python‑based controller. The project includes a ready‑made scene with a Pioneer P3DX mobile robot, a configurable PID controller implemented in Python, and auxiliary scripts to connect to the simulator using a Remote API. The goal of this project

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published