Skip to content

This is the accompaning code of the paper titled "A novel MPC framework for efficient navigation of mobile robots in cluttered environments"

License

Notifications You must be signed in to change notification settings

IntelligentControlSystems/ClutteredEnvironment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A novel MPC framework for efficient navigation of mobile robots in cluttered environments

License: MIT

This is the accompaning code of the paper titled "A novel MPC framework for efficient navigation of mobile robots in cluttered environments". Read preprint on arXiv

Demo

Experiments

🎥 Click to watch the experiment video

Prerequisites

This software is based on the Control and Robotics Software (CRS), an advanced control software framework to support simulations and experiments in the fields of control and robotics. CRS is built on top of the Robot Operating System (ROS) and primarily written in C++ and Python. The CRS environment uses Docker to allow cross-platform compatibility. The only requirement you have is to run an up-to-date operating system and up to 16 GB of free storage (some of it is only required during the setup). Below you find the install instructions for Ubuntu, macOS and Windows.

Setting up the Docker Image

Toolkit Installation

First, install the crs-docker tool based on your operating system:

Ubuntu (recommended)

These instructions were tested on the following Ubuntu versions:

  • 20.04 LTS
  • 22.04 LTS
  • 24.04 LTS

However, the instructions should apply to all recent Ubuntu versions.

Steps

  1. Install Docker using the offical install instructions   Note: The install instructions list Ubuntu in the server section!

  2. Allow Docker execution as a non-root user; follow these instructions   Note: Only do the first section "Manage Docker as a non-root user"

  3. Test your Docker installation with the following command   Note: You might want to restart your computer at this point.

    docker run hello-world
  4. Clone the git repository

    git clone https://github.com/IntelligentControlSystems/ClutteredEnvironment.git
  5. Navigate to the Ubuntu setup folder

    cd ClutteredEnvironment/.setup/ubuntu
  6. Execute the setup script

    ./setup.sh
Arch Linux

The Installation does not differ too much from the Ubuntu installation. There is however one caveat on Arch Linux: Running Docker containers might fill up your memory and crash your system. To prevent this, add following lines to the file /etc/docker/daemon.json :

{
  "default-ulimits": {
    "nofile": {
      "Name": "nofile",
      "Soft": 1024,
      "Hard": 524288
    }
  }
}

Do not forget to restart the docker service with sudo systemctl restart docker.

Alternatively, one can specify these limits in the docker-compose.yaml file:

version: '3'
name: "crs"
services:
  crs:

    ...

    # ADD THESE 4 LINES
    ulimits:
      nofile:
        soft: 1024
        hard: 524288

    ...
MacOS

These instructions were tested on macOS Sonoma (14.4). However, the instructions should apply to all recent macOS versions.

Steps

  1. Install Docker using the offical install instructions

  2. Test your Docker installation with the following command

    docker run hello-world
  3. Clone the git repository   Note: Make sure you have a SSH key set up, otherwise this doesn't work.

    git clone https://github.com/IntelligentControlSystems/ClutteredEnvironment.git
  4. Navigate to the MacOS setup folder

    cd ClutteredEnvironment/.setup/macos
  5. Execute the setup script

    ./setup.sh
Windows

These instructions were tested on the following Windows versions:

  • Windows 11

Windows 10 should work as well, but might need some slight modifications.

Steps

  1. Install Docker using the official install instructions

  2. Make sure to run Docker on WSL 2 (see Docker Desktop WSL 2 backend on Windows)

    1. Make sure you have WSL 2 installed and set Ubuntu as the default distro.

    2. Make sure to tick the boxes in the Docker Desktop as in the screenshots below.

      image.png{width="840" height="440"}

      Screenshot 2024-08-30 103945.png{width="1440" height="759"}

  3. Open a PowerShell Terminal and get into your default WSL with:

    wsl
  4. Test your Docker installation with the following command   Note: You might want to restart your computer at this point.

    docker run hello-world
  5. Clone the git repository Note: Make sure you have a SSH key set up, otherwise this doesn't work.

    git clone https://github.com/IntelligentControlSystems/ClutteredEnvironment.git
  6. Navigate to the Ubuntu setup folder

    cd ClutteredEnvironment/.setup/ubuntu
  7. Execute the setup script

    ./setup.sh

Verification

After installation, navigate to the root of this repository, and check the help manual page:

crs-docker --help
usage: crs-docker <command> [-h]

there are the following commands:

    up [-b/-p]:  Starts docker container with CRS environment.
                 -b | --build: build CRS Docker image from scratch.
                 -p | --pull: pull CRS Docker image from registry.
    down:        Shuts down docker container.
    run:         Open interactive shell in container.
    clean:       Delete the previously built Docker image. 'crs-docker up -b' will rebuild the image.
    attach:      Attach to a running container (only works for a single running container).

Build the Docker Image

This is only needed once during setup.

After the crs-docker tool-chain setup:

  1. Navigate to repository root.

  2. Build the Docker image locally:

    [ClutteredEnvironment]$ crs-docker up -b

Verification

Expected outcome in console for crs-docker up -b
#40 resolving provenance for metadata file
#40 DONE 0.0s
[+] Running 2/2
 ✔ ghcr.io/intelligentcontrolsystems/crs-2.0:cluttered-environment  Built                                                                                                                 0.0s
 ✔ Container crs                                                    Started

Build and Run the Source Code

The source code in this repository will be built in a Docker container created from the Docker image built in the previous section.

  1. Launch the Docker container from the root of this repository. (This also mounts all current repository's contents in the /code directory INSIDE the container)

    [ClutteredEnvironment]$ crs-docker run
  2. Build all packages (inside the container)

    • This is needed ONLY the first time

      /code# crs init
    • This is needed initially, AND when source files changed

      /code# crs build

Verification

Expected outcome in console for crs build
[build] Summary: All 26 packages succeeded!
[build]   Ignored:   None.
[build]   Warnings:  5 packages succeeded with warnings.
[build]   Abandoned: None.
[build]   Failed:    None.
[build] Runtime: 1 minute and 50.6 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.

Launch the Demo

After building the source code, run the simulation experiment

/code# source devel/setup.bash
/code# roslaunch crs_launch sim_single_car.launch

And the same Demo as above will show up. One can drag the target destination around, before the car reaches it, to see the real-time re-planning to navigate around obstacles.

How to customize the experiment

In the folder src/ros4crs/crs_launch/config/experiments/cluttered, edit the following config files. The most important are

  • simulator.yaml: starting point of the simulation
  • planner.yaml: planner config, and location of the initial target
  • obstacles.yaml: The position of the obstacles or if they should be randomly generated
  • solver.yaml: specifies the num_obstacles, num_segments, and model bounds

FAQs

Changes in solver.yaml not reflected in simulation
  • The solver.yaml is symlinked from the solver config in src/crs/controls/car/mpc_solvers/acados/acados_kinematic_nonconvex_mpc_solver/config/solver_nonconvex_mpc.yaml.

  • This is also a compile-time config since it affects code genration. If you change, make sure to REBUILD the source files

  • If you see errors when you rebuild, you may have to (inside the crs container) run

    /code# catkin build --force-cmake acados_kinematic_nonconvex_mpc_solver

    and then rebuild

Problem building Docker image with crs-docker up -b

Issue

Docker fails to resolve the base image, and an error like the following shows up in the console:

#3 ERROR: failed to do request: Head "https://registry-1.docker.io/v2/library/ros/manifests/noetic-ros-core-focal": dial tcp: lookup registry-1.docker.io on 192.168.1.1:53: read udp 172.17.0.
2:60410->192.168.1.1:53: i/o timeout
------
 > [internal] load metadata for docker.io/library/ros:noetic-ros-core-focal:
------
Dockerfile:1

--------------------
   1 | >>> FROM ros:noetic-ros-core-focal
   2 |
   3 |     # Install, on top of core, the desktop packages of ROS
--------------------

failed to solve: ros:noetic-ros-core-focal: failed to resolve source metadata for docker.io/library/ros:noetic-ros-core-focal: failed to do request: Head "https://registry-1.docker.io/v2/libr
ary/ros/manifests/noetic-ros-core-focal": dial tcp: lookup registry-1.docker.io on 192.168.1.1:53: read udp 172.17.0.2:60410->192.168.1.1:53: i/o timeout

Resolution

This might be due to Docker's DNS options. It might happen if the user is using coporate/institute network. An example solution is given with the case of Ubuntu system.

The user can add/set DNS options for docker by creating or editing the /etc/docker/daemon.json file with contents:

{
  "dns": ["8.8.8.8", "8.8.4.4"]
}

And restarting the Docker daemon by:

sudo systemctl restart docker

And retry the crs-docker up -b command. It should get past the base image resolution.

How long does the build take?

Here are some references:

  • Machine specs

    OS: Ubuntu 24.04.3 LTS
    CPU: 12th Gen Intel® Core™ i7-1260P × 16
    MEM: 32.0 GiB
    
  • Building time for the Docker image (crs-docker up -b): ~17 minutes

  • Building time for the source code (crs build): ~2 minutes

Citing us

If you use this method, please cite our corresponding article:

@article{kohler2025cluttered,
  title={An MPC framework for efficient navigation of mobile robots in cluttered environments},
  author={K{\"o}hler, Johannes, Zhang, Daniel and Soloperto, Raffaele and Carron Andrea and Zeilinger, Melanie N},
  journal={arXiv preprint arXiv:2509.15917},
  year={2025}
}

About

This is the accompaning code of the paper titled "A novel MPC framework for efficient navigation of mobile robots in cluttered environments"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •