Skip to content

Environment for the Simulation of a Robot moving in a pedestrians-filled space

License

Notifications You must be signed in to change notification settings

JuliusMiller/robot-sf

 
 

Repository files navigation

robot-sf

About

This project provides a training environment for the simulation of a robot moving in a pedestrian-filled space.

The project interfaces with OpenAI Gym to facilitate trainings with various SOTA reinforcement learning algorithms like e.g. StableBaselines3. For simulating the pedestrians, the SocialForce model is used via a dependency on a fork of PySocialForce.

Quickstart

1. Clone Source Code

git clone --recurse-submodules https://github.com/Bonifatius94/robot-sf
cd robot-sf

2. Install Dependencies

python3 -m pip install pip --upgrade
python3 -m pip install -r requirements.txt
python3 -m pip install -r fast-pysf/requirements.txt

3. Register robot_sf and pysocialforce Packages

pushd ./fast-pysf
    python3 -m pip install .
popd
python3 -m pip install .

Note: This needs to be repeated to propagate robot_sf changes on a host deployment. Otherwise the calling scope might run an old version of robot_sf. Dockerized deployments will recognize when a change requires a rebuild.

Alternatively create soft links for fast-pysf. The modules and tests are automatically detected by the interpreter if the calling scope is located at the repository's root directory which is very useful e.g. for debugging.

ln -s fast-pysf/pysocialforce pysocialforce
pushd tests
    ln -s ../fast-pysf/tests pysf_tests
popd

Note: The outlined command might differ on Windows, e.g. try mklink

4. Run Linter / Tests

python3 -m pytest tests
python3 -m pylint robot_sf

5. Run StableBaselines Training (Docker)

docker-compose build && docker-compose run \
    robotsf-cuda python ./scripts/training_ppo.py

Note: See this setup to install Docker with GPU support.

6. Edit Maps

sudo apt-get update && sudo apt-get install -y python3-tk
python3 -m map_editor

Note: See this documentation on how to use the map editor.

7. Visual Debugging

cp scripts/debug_random_policy.py .
python3 debug_random_policy.py
mkdir model
pushd model;
    wget https://megastore.rz.uni-augsburg.de/get/hXJCV2BgAC/ -O ppo_model.zip
popd
cp scripts/debug_trained_policy.py .
python3 debug_trained_policy.py

About

Environment for the Simulation of a Robot moving in a pedestrians-filled space

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Dockerfile 0.4%