The design of a robot that is capable of operating autonomously in
a changing and unstructured scenario is based on complex software architec-
tures, in which perceptual and actuation components, as well as deliberative
ones, are considered. The inherent dynamism of this kind of scenarios forces
the software architecture to be able to adapt the robot’s behaviour to de-
tected changes at runtime. This adaptation is often hard-coded by the robotic
engineer within software components, thus considering the specific situations
that s/he believes to be appropriate at design-time. Subsequently, when any
of these situations occur, software components can react by updating parame-
ters, planning decisions, etc., then ensuring that the robot provides the desired
response. On the contrary, adding and managing situations that were not ini-
tially considered is a cumbersome and expensive task. This paper describes
a complete model-based framework for endowing a robot control architecture
with the ability of self-adapting the robot’s behaviour at runtime. On the one
hand, this framework provides robotic designers with a textual model editor
allowing them to specify variation points in the robot behaviour and define
how these variation points should be configured at runtime according to the
perceived situation. On the other hand, the framework also includes a code
generator that, taking the previous models as an input, generates and ap-
propriately configures the runtime infrastructure needed to monitor relevant
non-functional properties and, according to their evolution, perform the ap-
propriate behaviour adaptations to meet the required robot quality-of-service
(QoS). The proposed framework is discussed and validated in two case studies
using different and well-known robotics software architectures. The first use
case runs over a simulation environment generated using Webots. In a second
use case a real robot is moved in an intralogistic scenario