Skip to content

Latest commit

 

History

History
219 lines (132 loc) · 8.63 KB

README.md

File metadata and controls

219 lines (132 loc) · 8.63 KB

Minitaur Framework

This framework contains everything needed to use IT&E and Map-Elites with the minitaur from ghost robotics. It includes the followings :

  • minitaur_sdk - The minitaur ghost robotics sdk with some custom examples to be able to read and send commands from ROS and though USB

  • ros_pyminitaur - The ros package with everything needed to read maps created with Map Elites and send the commands to the minitaur through ros

  • pybullet_minitaur_sim - This contains a pybullet minitaur simulation based on this github repository . The pybullet_minitaur_sim defines everything needed to run episodes and create maps with Map Elites.

  • pyite - An IT&E implementation in python, it can be used with pybullet for simulation or with ros to send commands to the real robots. It is selecting the best behaviors in the maps created with Map Elites thanks to a bayesian optimization process

You can see below a graphical overview of the framework :

framework

You can click on the GIF to watch the full IT&E minitaur video:

Citing this code

If you use our code for a scientific paper, please cite:

For IT&E

Antoine Cully, Jeff Clune, Danesh Tarapore, and Jean-Baptiste Mouret. "Robots that can adapt like animals." Nature 521, no. 7553 (2015): 503-507.

In BibTex:

@article{cully_robots_2015,
    title = {Robots that can adapt like animals},
    volume = {521},
    pages = {503--507},
    number = {7553},
    journal = {Nature},
    author = {Cully, Antoine and Clune, Jeff and Tarapore, Danesh and Mouret, Jean-Baptiste},
    year = {2015}
}

For CVT-MAP-Elites

Main paper: Mouret JB, Clune J. Illuminating search spaces by mapping elites. arXiv preprint arXiv:1504.04909. 2015 Apr 20.

CVT Map-Elites: Vassiliades V, Chatzilygeroudis K, Mouret JB. Using centroidal voronoi tessellations to scale up the multi-dimensional archive of phenotypic elites algorithm. IEEE Transactions on Evolutionary Computation. 2017 Aug 3.

Variation operator: Vassiliades V, Mouret JB. Discovering the Elite Hypervolume by Leveraging Interspecies Correlation. Proc. of GECCO 2018.

Installation

Clone this repository and run :

git submodule update --init --recursive

You will then need two python environments. One for the simulation with python 3.6.7 and another with python 2.7 (official python version for ros-kinetic)

Here are some of the dependencies:

python 3.6.7:

  • gym
  • tensorflow
  • matplotlib
  • sklearn
  • pybullet
  • gpy

python 2.7 / ros-kinetic:

  • install vrpn with : apt-get install ros-kinetic-vrpn*

How to launch a minitaur experiment when you have map_elites maps?

First launch a roscore on your computer

roscore

Then use the minitaur_sdk

Go to the minitaur_sdk repository

Plug the minitaur with a usb cable

Upload the CommandRobotRosXY (or the CommandRobotRosXYDamaged to test with a damage).

cd minitaur_sdk/example/CommandRobotRosXY/
make

Wait until the upload is complete. Check the usb port adress and if needed change it in command.py ( default is "/dev/ttyUSB0" ). Then execute :

sudo -s
python command.py

You should now be able to retrieve data from ros topics and send cartesian commands to the legs. For more details refer to the README.md of minitaur_sdk

Note that a safety limit has been implemented. If one motor is trying to use more than 25A for more than 1second, the motors will be disabled. The following framework will automatically enable the motors at each new episode.

Then use the ros_pyminitaur package

Copy or clone the ros_pyminitaur repository in your catkin_workspace. If needed make the python scripts in the script folder executable with chmod +x my_script.py

Execute the followings:

roslaunch vrpn_optitrack_minitaur.launch
rosrun pyminitaur cmd_minitaur_xy.py

VRPN needs to be able to recover the minitaur position through the minitaur frame. The cmd_minitaur_xy node will wait for commands to run episodes on the real robot.

cmd_minitaur_xy.py will allow you to run episodes with a specific duration. For more details please refer to the README.md of ros_pyminitaur

Note that you can use test_maps.py to test some behaviors but you can also use pyite as depicted in the following section

Then use pyite

Go to the pyite folder and execute :

python ite.py maps/minitaur/centroids_40000_16.dat maps/minitaur/archive_20000.dat 1 minitaur

For more details please refer to the README.md of pyite

Instead of pyite you can also test maps

test_maps.py is located in the ros_pyminitaur/script folder.

This node allows you to randomly test x behaviours from n maps and save the results (real travelled distance) You need to specify a path containing map_elites maps as an argument.

The following specific file tree organisation needs to be respected for n maps :

  • path_to_folder_containing_maps/
    • 1/

      • centroid_file
      • archive_file
    • 2/

      • centroid_file
      • archive_file
    • ../

    • n/

      • centroid_file
      • archive_file

You will have tune the name of the archive_file and centroid_file directly in test_maps.py (line 92 and line 94)

Then you can execute :

python test_maps.py path_to_folder_containing_maps

If you want to test 10 maps you can use ite_final_test_maps.py

For more details please refer to ros_pyminitaur

How create map_elites maps for the minitaur ?

Go to the pybullet_minitaur_sim folder and refer to the README.md file pybullet_minitaur_sim