GithubHelp home page GithubHelp logo

ci-group / revolve Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 32.0 430.13 MB

Robot evolution framework for the Triangle of Life project

Home Page: https://evosphere.eu/

CMake 0.95% C++ 25.88% C 0.26% Python 69.84% Dockerfile 0.06% Shell 0.81% R 2.21%
artificial-life evolutionary-algorithms evolutionary-computation evolutionary-robotics gazebo-plugin robot-simulator robotics-simulation

revolve's People

Contributors

amirbnnsr avatar dependabot[bot] avatar egdman avatar eltehupkes avatar huub8 avatar karinemiras avatar langongjin avatar maarten911 avatar mrebolle avatar onerachel avatar portaloffreedom avatar safsaf150 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

revolve's Issues

Installation problem: Gazebo namespace occupied

I am trying to install Revolve on Ubuntu version: 20.04 (VirtualBox 7.0.12).
I attempt to do: Minimal installation.

However, installation fails with a namespace problem:

/home/erik/UNI_project/revolve/cpprevolve/revolve/gazebo/brains/BrainFactory.cpp:25:22: error: ‘namespace gz = gazebo;’ conflicts with a previous declaration
   25 | namespace gz = gazebo;
      |                      ^
In file included from /usr/include/ignition/math6/gz/math/Helpers.hh:34,
                 from /usr/include/ignition/math6/gz/math/Spline.hh:22,
                 from /usr/include/ignition/math6/ignition/math/Spline.hh:18,
                 from /usr/include/gazebo-11/gazebo/common/Animation.hh:22,
                 from /usr/include/gazebo-11/gazebo/common/common.hh:5,
                 from /home/erik/UNI_project/revolve/cpprevolve/revolve/gazebo/brains/BrainFactory.h:27,
                 from /home/erik/UNI_project/revolve/cpprevolve/revolve/gazebo/brains/BrainFactory.cpp:22:
/usr/include/ignition/math6/gz/math/config.hh:23:11: note: previous declaration ‘namespace gz { }’
   23 | namespace gz
      |           ^~

Any ideas will be appreciated.

Standalone Revolve

  • Remove tol-revolve as the connected project
  • Remove usage of revolve-brain

DISCONNECT ERROR

[manager] DISCONNECT ERROR  <pygazebo.pygazebo._Connection object at 0x7f88f068a4e0> manager_client_n
[manager] DISCONNECT ERROR  <pygazebo.pygazebo._Connection object at 0x7f88f0680a20> subscriber_/gazebo/default/revolve/robot_states
[manager] DISCONNECT ERROR  <pygazebo.pygazebo._Connection object at 0x7f88f067bd30> manager_client_n
[manager] DISCONNECT ERROR  <pygazebo.pygazebo._Connection object at 0x7f88f067bb00> subscriber_/gazebo/default/response
[manager] DISCONNECT ERROR  <pygazebo.pygazebo._Connection object at 0x7f88f067bc50> manager_client_n
[manager] DISCONNECT ERROR  <pygazebo.pygazebo._Connection object at 0x7f88f06e1eb8> Manager_master
[manager] Got disconnect / connection reset - shutting down.
Program 'simulator' exited with code -11

MultiNEAT is not automatically installed

We should supply the revolve CMakeLists.txt with

add_subdirectory(thirdparty/MultiNEAT)

But this does not build MultiNEAT successfully.

CMake Error at build/thirdparty/MultiNEAT/MultiNEATConfig.cmake:21 (include):
  include could not find load file:
/home/daanz/revolve_workspace/revolve_battery/build/thirdparty/MultiNEAT/MultiNEATTargets.cmake
Call Stack (most recent call first):
  cpprevolve/revolve/brains/CMakeLists.txt:21 (find_package)

The MultiNEAT cmake file should create the MultiNEATTargets.cmake, but this is not the case.

Tutorial 1 - the 'package' argument is required to perform a relative import for

In the tutorial 1, seems there's a problem with the paths.
After typing:
(.venv) ./revolve.py --simulator-cmd=gazebo --manager ./tutorial1.py

I have:
STARTING
Traceback (most recent call last):
File "./revolve.py", line 69, in
main()
File "./revolve.py", line 62, in main
run(loop, arguments)
File "./revolve.py", line 28, in run
manager = importlib.import_module(manager_lib).run
File "/usr/lib/python3.6/importlib/init.py", line 121, in import_module
raise TypeError(msg.format(name))
TypeError: the 'package' argument is required to perform a relative import for '...revolveProject.tutorial'

Actually I used another folder and not the root one as mentioned in the tutorial, but following exactly the tutorial I received the same message.

Simulated Tymios

  • Add Tymio models to Revolve
  • Create a showcase on how to insert them into the world
  • Create a basic controller for Tymios

Limbo not found error

If there is an error regarding limbo not compiling, you probably haven't downloaded limbo.
To do so you need to use git submodules.

git submodule init  #only the first time per object
git submodule update

Robot Brains

  • Make the separation between learners and controllers

Learners:

  • Implement (mu+1)ES aka rlpower
  • Implement NEAT

Controllers

  • Implement spline-based policies
  • Implement differential CPGs

Gazebo extra installation steps on Ubuntu 20.04

The instructions for installing Gazebo on Ubuntu 20.04 on the wiki are missing the following steps (taken from http://gazebosim.org/tutorials?tut=install_ubuntu):

  1. Setup your computer to accept software from packages.osrfoundation.org.
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
  1. Setup keys
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
  1. Update database
sudo apt-get update

Only then will sudo apt-get install libgazebo11-dev gazebo11 work. Not sure if Gazebo is in the standard Ubuntu/Debian repositories for other versions, but on 20.04 they aren't, so these extra steps are necessary.

I also had to install the following packages to build revolve: libpqxx-dev libyaml-cpp-dev libnlopt-dev libopencv-dev

Tutorials

  • Tutorial 1: Run a world
  • Tutorial 2: Create a model
  • Tutorial 3: Create a Robogen robot
  • Tutorial 4: Run an experiment

(important) the errors for memory and runs

when we run the experiments (e.g., the branch learners) for n_jobs (run in a core). each run in a core will consume a lot of memory. After a lot of testing and meet a lot of weird problems, I finally found the rough consume memory for each run in a core.
It is about 4 Gbits each n_jobs (run in a core). Therefore, generally, do not run more than 16 cores for 64 Gbits memory on ripper1/ ripper2/ripper3.

If you run more cores, you will probably meet the problem like:
image
If you run 16 cores on ripper1/ripper2/ripper3, you will see the perfect ending like:
image
note that 1500 is the terminal iteration.

for more computing platform, we could calculate it with 4 Gbits per cores at least.

Thymio Body

  • Make sure the Thymio had 7 proximity sensors
  • Add camera module to Thymio

Learners

  • Apply neuro evolution for obstacle avoidance task
  • apply neuro evolution for foraging task
  • use more advanced learning methods (NEAT?)
  • implement robot-to-robot learning techniques (share controller)

Python 3.8 Asyncio problems

Both me and another student have problems with using Python 3.8, probably caused by an asyncio implementation problem.

Traceback (most recent call last):
  File "./revolve.py", line 69, in <module>
    main()
  File "./revolve.py", line 62, in main
    run(loop, arguments)
  File "./revolve.py", line 32, in run
    loop.run_until_complete(only_gazebo.run())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
asyncio.exceptions.CancelledError
[2020-05-08 06:16:15,168     gazebo] INFO     Terminating processes...
Exception handling an incoming connection
Traceback (most recent call last):
  File "/Users/lewis/revolve/.venv/src/pygazebo/pygazebo/connection.py", line 163, in read_raw
    header = await self._reader.readexactly(8)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/streams.py", line 721, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 8 expected bytes

Controllers

  • Add simple feed forward neural network as the controller of the robot

tutorial 3

Tutorial 3 doesn't work with the current version of revolve.py. This is the error that comes up when executing it:

(.venv) (base) p058170:revolve tarigarma$ ./revolve.py --simulator-cmd=gazebo --manager experiments/examples/tutorial3.py 
STARTING
Traceback (most recent call last):
  File "./revolve.py", line 69, in <module>
    main()
  File "./revolve.py", line 62, in main
    run(loop, arguments)
  File "./revolve.py", line 28, in run
    manager = importlib.import_module(manager_lib).run
  File "/Users/tarigarma/revolve/.venv/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/tarigarma/revolve/experiments/examples/tutorial3.py", line 11, in <module>
    from pygazebo.pygazebo import DisconnectError
ImportError: cannot import name 'DisconnectError' from 'pygazebo.pygazebo' (/Users/tarigarma/revolve/.venv/src/pygazebo/pygazebo/pygazebo.py)```

Refactoring for a fresh start (27-31 August 2018)

The most urgent TODO list:

  • Add RLPower back as a learning mechanism
  • Strip-off Revolve from TOL and Brain
  • Test it on Mac and Linux
  • Install instructions
  • Make Beginner’s tutorials
  • Lint
  • Docker
  • Remove body-analyzer
  • Debugging errors
  • Multrun Gazebo

Thymio Experiments

  • Obstacle avoidance
  • Puck collecting
  • Food collecting
  • Multiroom experiment
  • Maze navigation

Evaluation time mixed configuration

Evaluation time is configured in two different places: from command line and in the population config. If the two times differ, this could cause weird and difficult to debug issues.

Hardware Integration

  • Reshape CMakeListx.txt and C++ files to work as an independent library
  • Add installation option for Raspberry Pi
  • Write instructions to run the real robot with Revolve

Full path lenght calculation is wrong

In the c++ evaluator (simulator) somehow the total path length can results smaller than the distance between first and last position.
This is matematically impossible.

It could be an accumulating error problem, but we are not certain

Code found here:

for (size_t i=1; i < this->step_poses.size(); i++)
{
const auto &pose_i_1 = this->step_poses[i-1];
const auto &pose_i = this->step_poses[i];
this->path_length += Evaluator::measure_distance(pose_i_1, pose_i);
}

Documentation

  • Test the installation on Mac OS X and Linux
  • Write installation instructions
  • Write guidelines for new contributors
  • Write technical description
  • Write conceptual description
  • Write guidelines for hardware usage

Continuous Integration

  • Integrate the project with CircleCI
  • Add Python tests
  • Add C++ tests
  • Run experiments in Docker

ubuntu and python3 and cairo

When pip installing on ubuntu, you may see that you get pycairo installation/compilation errors. You probably have to install:
python3-dev and python3-cairocffi

If you are using python3.7, install
python3.7-dev instead of python3-dev

power consumption (in battery branch)

  • implement power consumption of a joint
  • improve precision of the power consumption (actual angular velocity instead of desired one)
  • implement a battery
  • kill the robot when battery is out of power

Environment

  • Add Thymio module to Gazebo (2D)
  • Add Thymio module to Gazebo (3D)
  • Demo to add Thymio to Gazebo
  • Add multiple robots to same Gazebo environment ("Evert style")
  • One arena per robot ("Jacqueline style")
  • Multiroom environment
  • Maze environment

Experiments in Docker

We need to add an experiment runner image

  • Think on how to pass the code from the local machine
  • create a build and run script inside the machine, that should not conflict with the local machine build (think mac executables on linux docker)
  • Create a place where to collect output of the run
  • Guide on how to use it

Process exited with code -15

Followed all the installation tutorials for macOS. gzserver and gazebo launch without a problem, GUI is functional too.

However, when trying to run ./revolve.py it ends abruptly with

Process exited with code -15

My full output:

./revolve.py          
STARTING
[2020-11-10 12:06:14,805     gazebo] INFO     Created Supervisor with:
	- simulator command: gzserver ['--verbose']
	- world file: worlds/plane.world
	- GAZEBO_PLUGIN_PATH: /Users/jorijnsmit/Documents/uva/thesis/revolve/build/lib
	- GAZEBO_MODEL_PATH: /Users/jorijnsmit/Documents/uva/thesis/revolve/models
[2020-11-10 12:06:14,805     gazebo] INFO     Launching the simulator...
[2020-11-10 12:06:15,603     gazebo] INFO     [starting] [Msg] Waiting for master.
[2020-11-10 12:06:15,603     gazebo] INFO     [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[2020-11-10 12:06:15,604     gazebo] INFO     [Msg] Publicized address: 192.168.178.44
[2020-11-10 12:06:15,604     gazebo] INFO     World plugin loaded.
[2020-11-10 12:06:15,604     gazebo] ERROR    Gazebo multi-robot simulator, version 9.15.0
[2020-11-10 12:06:15,604     gazebo] ERROR    Copyright (C) 2012 Open Source Robotics Foundation.
[2020-11-10 12:06:15,604     gazebo] ERROR    Released under the Apache 2 License.
[2020-11-10 12:06:15,604     gazebo] ERROR    http://gazebosim.org
[2020-11-10 12:06:15,604     gazebo] ERROR    
[2020-11-10 12:06:20,642     gazebo] INFO     Setting robot state update frequency to 5.
Traceback (most recent call last):
<...>
[2020-11-10 12:06:21,663     gazebo] ERROR    
[2020-11-10 12:06:21,663     gazebo] INFO     
[2020-11-10 12:06:21,663     gazebo] INFO     Process exited with code -15

The full traceback is pygazebo and asyncio disconnecting by throwing exceptions.

What is code -15? I can't find much about it.

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.