Giter Club home page Giter Club logo

tensorswarm's Introduction

TensorSwarm: A framework for reinforcement learning of robot swarms.

Introduction

TensorSwarm is an open source framework for reinforcement learning of robot swarms. Each robot in the swarm uses the same single behaviour policy with the included neural network, but different approaches are also supported.

It connects the open source robot swarm simulation Argos 3 to either Open AIs PPO or TensorForce using ROS.

A working neural network configuration is already provided following the ideas from Towards Optimally Decentralized Multi-Robot Collision Avoidance via Deep Reinforcement Learning

Video: https://youtu.be/GDV5NgrER5U

Features

  • Training up to 100 robots in multiple simulation environments.
  • A ROS service handles all the communication between the simulation and the learning environment. This service is easily extendable to new sensor or command data.
  • Support of multiple simulation environments at the same time to optimally use multicore CPUs.
  • Contains examples which can be trained out of the box and on which users can build their extensions.

Installation

Dependencies

Argos 3

Argos 3 must be installed from here. This version extends the simulation by a laser scanner which is missing in the official version.

ROS

ROS Kinetic is required which can be found here

Python Dependencies

Note that ROS does not support Python 3, so all python dependencies must be installed for Python 2.

pip install tensorflow-gpu

If you want to use the Tensorforce integration you also need to install it as described here

TensorSwarm

TensorSwarm comes as a ROS packages. So all you need to do is clone it into your catkin workspace.

Running

Running TensorSwarm consits of 4 steps:

  1. Setting up the environment.
  2. Starting roscore
  3. Starting the Argos 3 simulation instances.
  4. Starting the Python script for generating actions and learning.

We include two experiments:

  1. 8 Robots crossing in an 4-way-crossing.
  2. 8 Robots crossing in a L-curve.

Variants

The are two variants of TensorSwarm:

OpenAI PPO

This is a true multi agent PPO implementation which should be used by advanced users. We trained swarms of over to 100 robots successfully with it.

Note that you most likely need to start with less robots, train them and then add more robots after the models.

To run this experiments execute in your catkin work space:

  1. 4-way-crossing: src/tensorswarm/run/4_way_run_ppo.bash
  2. L-curve: src/tensorswarm/run/l_curve_run_ppo.bash

TensorForce

As TensorForce does not support multiple agents at the moment this variant only trains one agent at a time. Therefore this variant highly sample inefficent. But it is well suitable for less experienced users or users who want to experiment with different deep learning algorithms other than PPO. We trained up to 4 robots successfully with this variant. To run this experiments execute in your catkin work space:

  1. 4-way-crossing: src/tensorswarm/run/4_way_run_tforce.bash

Starting the simulation

For each simulation window you have to hit FastForward (>> Button) to get the simulations running as they all start paused by default.

Contact

For personal requests or commercial support write to: [email protected]

tensorswarm's People

Contributors

deeplearningrobotics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorswarm's Issues

Issues in building TensorSwarm

Hi,

I followed the installation instructions. I built and installed Argos from the corresponding branch. The only difference is that I have Melodic installed instead of Kinetic. I tried to build TensorSwarm, but I get the following errors:

CMake Error at TensorSwarm/plugin/CMakeLists.txt:12 (include):
  include could not find load file:

    ARGoSCheckQTOpenGL


CMake Error at TensorSwarm/plugin/CMakeLists.txt:15 (find_package):
  By not providing "FindLua52.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Lua52", but
  CMake did not find one.

  Could not find a package configuration file provided by "Lua52" with any of
  the following names:

    Lua52Config.cmake
    lua52-config.cmake

  Add the installation prefix of "Lua52" to CMAKE_PREFIX_PATH or set
  "Lua52_DIR" to a directory containing one of the above files.  If "Lua52"
  provides a separate development package or SDK, be sure it has been
  installed.

Do you maybe have any idea what the problem could be?

Thank you

Issues with Argos while trying to run TensorSwarm

Hey there!,
I've been trying to run your TensorSwarm code since I'd like to work with it.
I've been stopped by the following error:
[FATAL] Error initializing controllers
[FATAL] Can't load library "libargos_ros_bot.so" even after trying to add extensions for shared library (so) and module library (so):
/usr/local/lib/argos3/libargos_ros_bot.so.so: /usr/local/lib/argos3/libargos_ros_bot.so: cannot open shared object file: No such file or directory
/usr/local/lib/argos3/libargos_ros_bot.so.so: /usr/local/lib/argos3/libargos_ros_bot.so.so: cannot open shared object file: No such file or directory
/usr/local/lib/argos3/libargos_ros_bot.so.so: OK

Thank you for your time,

Julio

Can't find tensorswarm.srv

Hi. When I try to execute the experiment 4-way-crossing with ppo, using the included bash file, I get the following error:

Traceback (most recent call last):
File "src/TensorSwarm/scripts/new/RunExperiment4Way.py", line 31, in
from ArgosMultiProcessEnvironment import ArgosMultiProcessEnvironment
File "/home/julio/catkin_ws/src/TensorSwarm/scripts/new/ArgosMultiProcessEnvironment.py", line 26, in
from tensorswarm.srv import *
ImportError: No module named tensorswarm.srv

Do you have a suggestion on how to fix this error?
Thanks,

Julio

Issues in running TensorSwarm

Hi,

I've been trying your code but I still cannot run your code successfully. I would greatly appreciate if you could give some help or hint to solve it. Here’s a detailed description of what I have tried:

OS: Ubuntu 16.04
Ros: Kinetic
Python: python 2
Argos: Cloned from deeplearningrobotics repo and checkout “adding_lidar_clean”, then followed the README to install.
Open AIs PPO: I didn't try. Because I’m confused. The Open AIs PPO requires Python 3, but TensorSwarm uses ROS so everything should be installed in python 2.
TensorForce: pip install tensorforce

So basically I’m trying to use the tensorforce example under tensorswarm/run/. Everything is running with no compiling errors and bugs, including cmake, make install, catkin_make, ROS, the training code argosAgent.py under tensorswarm/scripts/tensorforce_plugin/.

But the problem is the Argos3 samples provided by TensorSwarm under /argos_worlds/.
These three samples can be run with no errors show in the terminal. But when I click on in the pop-out window, like the “play” or “step_play” button, the windows freezes as shown in the photos.

screen shot 2019-02-02 at 14 38 03

After clicking "play" or ">>"button:

screen shot 2019-02-02 at 14 37 04

Then the training code will show “Service call failed”.
Actually, all these three Argos3 samples in /argos_worlds/ have the same issue. While I CAN successfully run the official example provided by Argos3 website.

Thank you

Looking for libopencv_core3.so.3.2

Hi

While attempting to run this, I am encountering the following issue:

[FATAL] Can't load library "/home/arsalan/catkin_ws/devel/lib/libgazebo_ros_prosilica.so" even after trying to add extensions for shared library (so) and module library (so): 
/home/arsalan/catkin_ws/devel/lib/libgazebo_ros_prosilica.so: libopencv_core3.so.3.2: cannot open shared object file: No such file or directory
/home/arsalan/catkin_ws/devel/lib/libgazebo_ros_prosilica.so.so: /home/arsalan/catkin_ws/devel/lib/libgazebo_ros_prosilica.so.so: cannot open shared object file: No such file or directory
/home/arsalan/catkin_ws/devel/lib/libgazebo_ros_prosilica.so.so: OK
Segmentation fault (core dumped)

I tried running sudo apt install --reinstall ros-kinetic-opencv3, which reinstalled libopencv_core3.so.3.3.1. Now I have libopencv_core3.so, libopencv_core3.so.3.3 and libopencv_core3.so.3.3.1 at /opt/ros/kinetic/lib/x86_64-linux-gnu, but it doesn't seem to have libopencv_core3.so.3.2

Thanks

catkin_make can't find header file: ci_footbot_lidar_sensor.h

Hi,

I am running into an issue when compiling TensorSwarm in ROS, after installing argos. Specifically, the compilation process cannot "see" the header file ci_footbot_lidar_sensor.h , even though the file exists in the indicated directory. The message I am receving is:

In file included from /home/julio/catkin_ws/src/TensorSwarm/plugin/tensor_swarm_bot/tensor_swar_bot.cpp:2:0:
/home/julio/catkin_ws/src/TensorSwarm/plugin/tensor_swarm_bot/tensor_swarm_bot.h:10:86: fatal error: argos3/plugins/robots/foot-bot/control_interface/ci_footbot_lidar_sensor.h: No such file or directory
compilation terminated.

Any help would be appreciated,

thanks,

Julio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.