User:Fredrsae

From Robin

(Difference between revisions)
Jump to: navigation, search
(Ny side: Fredrik Sævland M.Sc Robotikk og Intelligente Systemer Fredrik@saevland.com, fredrsae@ifi.uio.no)
(MAP elites)
 
(20 intermediate revisions not shown)
Line 1: Line 1:
 +
=About=
Fredrik Sævland
Fredrik Sævland
 +
M.Sc Robotikk og Intelligente Systemer
M.Sc Robotikk og Intelligente Systemer
 +
Fredrik@saevland.com, fredrsae@ifi.uio.no
Fredrik@saevland.com, fredrsae@ifi.uio.no
 +
 +
'''Thesis: Optimizing and adapting gait pattern of a legged robot'''
 +
 +
I'm using an EA to evolve and adapt a legged robot (e.g Arachna, Quadratot) to different environments by changing the gait pattern based on what type of terrain it is currently walking on.
 +
 +
=Progress plan=
 +
* October through December
 +
**<s>Essay and progress plan</s>
 +
**<s>Set up Evorob, Gazebo and possibly other sim-platforms, and figure out which one to use</s>
 +
** <s>By this month I should have decided upon a simulator to use. Experiment with this platform</s>
 +
** <s>Do further research on IT&E and The Transferability Approach, and work on implementation</s>
 +
** Start work on implementation, the simulator and robot should be able to work together in some form by now
 +
 +
* January
 +
** Have GA implemented and most of IT&E ready
 +
 +
* February
 +
** Write some of the implementation-part of the thesis
 +
** Start gathering the test-results
 +
** Finish the implementation-part
 +
 +
* March
 +
** Write about the experiments
 +
 +
* April
 +
** Finish up the thesis
 +
 +
=Implementation=
 +
 +
 +
'''[http://github.com/Gavekort/GaitAdaptation Git repository]'''
 +
 +
 +
The implementation of this master thesis is done in C++11 using a set of free software frameworks called [http://github.com/resibots/robdyn Robdyn] and [http://github.com/sferes2/sferes2 Sferes2].
 +
 +
==Robdyn==
 +
[[Image:robdyn_demo.png|thumb|200px|Screenshot of Robdyn 'walking' demo]]
 +
Robdyn is a simple C++ wrapper around ODE <ref>OpenDynamicsEngine</ref> and OSG <ref>OpenSceneGraph</ref> which makes a nice basis for simulating robots without having to dwelve into the more complex parts of these libraries. Robdyn works by simply defining your own robot similar to [http://github.com/resibots/robdyn/blob/master/src/robot/hexapod.cc hexapod.cc], and then testing it out in a [http://github.com/resibots/robdyn/blob/master/src/demos/hexapod.cc demo]. By then compiling the code using the bundled waf build-system it will create a two library-files, librobdyn.a and librobdyn_osgvisitor.a, which can then be linked into any other code together with the header-files. Robdyn makes it very easy to do your simulations headless by separating out the simulation and graphics into a visitor design pattern called the OSG-visitor. This means that dropping the graphical rendering is as simple as not making the objects accept the OSG-visitor.
 +
 +
==Sferes2==
 +
Sferes2 is a high-performance, multi-core, lightweight, generic C++98 <ref>Although the code written for this application is C++11</ref> framework for evolutionary computation. It is the second component used in this implementation, and is the framework responsible to do the evolutionary algorithm. Although there are a few evolutionary algorithms to choose between, the algorithm called [http://www.iitk.ac.in/kangal/Deb_NSGA-II.pdf NSGA-II] with a single objective optimization will be used in this case. Sferes2 offers multi-core support, as well as [http://www.open-mpi.org/ OpenMPI]-support, which invites computation on massive computer clusters.
 +
 +
==The Robot==
 +
[[Image:robot4_photo.png|thumb|200px|Photo of "Robot 4", courtesy of K. Glette and E. Samuelsen"]]
 +
[[Image:robot4_schematic.png|thumb|200px|Schematic of "Robot 4", courtesy of K. Glette and E. Samuelsen]]
 +
[[Image:robot4_robdyn.png|thumb|200px|Rough estimation of "Robot 4" implemented in Robdyn]]
 +
The robot used for this application is a four-legged quadrapod that was developed in-house here at Robin by Kyrre Glette and Eivind Samuelsen in the paper [http://link.springer.com/chapter/10.1007/978-3-319-16549-3_62 Real-World Reproduction of Evolved Robot Morphologies: Automated Categorization and Evaluation], and goes under the nonchalant name of "Robot 4". The interesting thing about this robot is that it is designed by evolving itself and was evaluated by a genetic algorithm to be an offspring with good performance-fitness.
 +
 +
===Controller-function===
 +
 +
==Map Elites==
 +
(Text is paraphrased from [http://arxiv.org/pdf/1504.04909.pdf Illuminating search spaces by mapping elites])
 +
MAP Elites is very simple in both concept and implementation. First a user
 +
chooses a performance measure f(x) that evaluates a solution x. Such a
 +
performance measure can be how fast the robot moves. After that the user
 +
chooses N dimensions of variation of interest that define a feature space of
 +
interest to the user. Examples of this could be how tall the robot is, how much
 +
it weighs, or how much energy it consumes per meter moved.
 +
A different scenario could be chess, where the performance measure is the win
 +
percentage, and the dimensions of variation could be aggressiveness of play,
 +
the speed with which moves are selected, etc. Each dimension of variation is
 +
discretized based on user preference or available computational resources.
 +
MAP Elites will search for the highest performing solution for each cell in the
 +
N-dimensional feature space. For example, MAP-Elites will search for the
 +
fastest robot that is tall, heavy and efficient. The search is conducted in the
 +
search space, which is the space of all possible values of x, where x is a
 +
description of a candidate solution. In our example, the search space will
 +
contain all possible description of gait patterns. We will call the x
 +
descriptor a genome, and the configuration a phenotype. A feature function is
 +
also defined that, for each x, determines x's value in each of the N feature
 +
dimensions. b(x) returns b_x, which is an N-dimensional vector describing x's
 +
features. To put it in practical terms, the first dimension is the height of
 +
the legs lifting, and the second dimension is how far it moves forward. These
 +
elements are directly measured in the phenotype. MAP-elites starts by randomly
 +
generating G genomes and determining the performance and features of each. In a
 +
random order, those genomes are placed into the cells to which they belong in
 +
the feature space. At that point the algorithm is initialized, and the
 +
following steps are repeated until a termination criterion is reached. First A
 +
cell in the map is randomly chosen and the genome in that cell produces an
 +
offspring via mutation and crossover. After that the features and performance
 +
of that offspring are determined, and the offspring is placed in the cell if
 +
the cell is empty or if the offspring is higher-performing than the current
 +
occupant of the cell, in which case that occupant is discarded.
 +
 +
===Sidenote===
 +
We will have two dimensions, leg lift and leg sweeplength (??). We will have X
 +
scenario with some tilt and some obstacle-variation and we will search in the
 +
MAP Elites with IT&E that gives us the best performance in terms of forwards
 +
speed. What I need to do is to make my code work with the MAP Elites module for
 +
Sferes2, and find out how IT&E is done in robot can evolve like animals.
 +
I may have to implement IT&E myself, and worst case scenario I will have to
 +
implement MAP Elites as well. The training can probably done in random
 +
scenarios, as long as we encourage solutions with a wide variety of leg lift
 +
and leg sweep.

Current revision as of 14:27, 26 February 2016

Contents

About

Fredrik Sævland

M.Sc Robotikk og Intelligente Systemer

Fredrik@saevland.com, fredrsae@ifi.uio.no

Thesis: Optimizing and adapting gait pattern of a legged robot

I'm using an EA to evolve and adapt a legged robot (e.g Arachna, Quadratot) to different environments by changing the gait pattern based on what type of terrain it is currently walking on.

Progress plan

  • October through December
    • Essay and progress plan
    • Set up Evorob, Gazebo and possibly other sim-platforms, and figure out which one to use
    • By this month I should have decided upon a simulator to use. Experiment with this platform
    • Do further research on IT&E and The Transferability Approach, and work on implementation
    • Start work on implementation, the simulator and robot should be able to work together in some form by now
  • January
    • Have GA implemented and most of IT&E ready
  • February
    • Write some of the implementation-part of the thesis
    • Start gathering the test-results
    • Finish the implementation-part
  • March
    • Write about the experiments
  • April
    • Finish up the thesis

Implementation

Git repository


The implementation of this master thesis is done in C++11 using a set of free software frameworks called Robdyn and Sferes2.

Robdyn

Screenshot of Robdyn 'walking' demo

Robdyn is a simple C++ wrapper around ODE <ref>OpenDynamicsEngine</ref> and OSG <ref>OpenSceneGraph</ref> which makes a nice basis for simulating robots without having to dwelve into the more complex parts of these libraries. Robdyn works by simply defining your own robot similar to hexapod.cc, and then testing it out in a demo. By then compiling the code using the bundled waf build-system it will create a two library-files, librobdyn.a and librobdyn_osgvisitor.a, which can then be linked into any other code together with the header-files. Robdyn makes it very easy to do your simulations headless by separating out the simulation and graphics into a visitor design pattern called the OSG-visitor. This means that dropping the graphical rendering is as simple as not making the objects accept the OSG-visitor.

Sferes2

Sferes2 is a high-performance, multi-core, lightweight, generic C++98 <ref>Although the code written for this application is C++11</ref> framework for evolutionary computation. It is the second component used in this implementation, and is the framework responsible to do the evolutionary algorithm. Although there are a few evolutionary algorithms to choose between, the algorithm called NSGA-II with a single objective optimization will be used in this case. Sferes2 offers multi-core support, as well as OpenMPI-support, which invites computation on massive computer clusters.

The Robot

Photo of "Robot 4", courtesy of K. Glette and E. Samuelsen"
Schematic of "Robot 4", courtesy of K. Glette and E. Samuelsen
Rough estimation of "Robot 4" implemented in Robdyn

The robot used for this application is a four-legged quadrapod that was developed in-house here at Robin by Kyrre Glette and Eivind Samuelsen in the paper Real-World Reproduction of Evolved Robot Morphologies: Automated Categorization and Evaluation, and goes under the nonchalant name of "Robot 4". The interesting thing about this robot is that it is designed by evolving itself and was evaluated by a genetic algorithm to be an offspring with good performance-fitness.

Controller-function

Map Elites

(Text is paraphrased from Illuminating search spaces by mapping elites) MAP Elites is very simple in both concept and implementation. First a user chooses a performance measure f(x) that evaluates a solution x. Such a performance measure can be how fast the robot moves. After that the user chooses N dimensions of variation of interest that define a feature space of interest to the user. Examples of this could be how tall the robot is, how much it weighs, or how much energy it consumes per meter moved. A different scenario could be chess, where the performance measure is the win percentage, and the dimensions of variation could be aggressiveness of play, the speed with which moves are selected, etc. Each dimension of variation is discretized based on user preference or available computational resources. MAP Elites will search for the highest performing solution for each cell in the N-dimensional feature space. For example, MAP-Elites will search for the fastest robot that is tall, heavy and efficient. The search is conducted in the search space, which is the space of all possible values of x, where x is a description of a candidate solution. In our example, the search space will contain all possible description of gait patterns. We will call the x descriptor a genome, and the configuration a phenotype. A feature function is also defined that, for each x, determines x's value in each of the N feature dimensions. b(x) returns b_x, which is an N-dimensional vector describing x's features. To put it in practical terms, the first dimension is the height of the legs lifting, and the second dimension is how far it moves forward. These elements are directly measured in the phenotype. MAP-elites starts by randomly generating G genomes and determining the performance and features of each. In a random order, those genomes are placed into the cells to which they belong in the feature space. At that point the algorithm is initialized, and the following steps are repeated until a termination criterion is reached. First A cell in the map is randomly chosen and the genome in that cell produces an offspring via mutation and crossover. After that the features and performance of that offspring are determined, and the offspring is placed in the cell if the cell is empty or if the offspring is higher-performing than the current occupant of the cell, in which case that occupant is discarded.

Sidenote

We will have two dimensions, leg lift and leg sweeplength (??). We will have X scenario with some tilt and some obstacle-variation and we will search in the MAP Elites with IT&E that gives us the best performance in terms of forwards speed. What I need to do is to make my code work with the MAP Elites module for Sferes2, and find out how IT&E is done in robot can evolve like animals. I may have to implement IT&E myself, and worst case scenario I will have to implement MAP Elites as well. The training can probably done in random scenarios, as long as we encourage solutions with a wide variety of leg lift and leg sweep.

Personal tools
Front page