  In real-world environments, robots need to be resilient to damages and robust
to unforeseen scenarios. Quality-Diversity (QD) algorithms have been
successfully used to make robots adapt to damages in seconds by leveraging a
diverse set of learned skills. A high diversity of skills increases the chances
of a robot to succeed at overcoming new situations since there are more
potential alternatives to solve a new task.However, finding and storing a large
behavioural diversity of multiple skills often leads to an increase in
computational complexity. Furthermore, robot planning in a large skill space is
an additional challenge that arises with an increased number of skills.
Hierarchical structures can help reducing this search and storage complexity by
breaking down skills into primitive skills. In this paper, we introduce the
Hierarchical Trial and Error algorithm, which uses a hierarchical behavioural
repertoire to learn diverse skills and leverages them to make the robot adapt
quickly in the physical world. We show that the hierarchical decomposition of
skills enables the robot to learn more complex behaviours while keeping the
learning of the repertoire tractable. Experiments with a hexapod robot show
that our method solves a maze navigation tasks with 20% less actions in
simulation, and 43% less actions in the physical world, for the most
challenging scenarios than the best baselines while having 78% less complete
failures.
