Sie sind auf Seite 1von 3

Reproducible Testing for Behavior-Based Robotics

Csaba Kertesz1 , IEEE Member, and Markku Turunen1

Abstract Reproducibility is essential in the testing of robots the DTCs complement those with behavior-based integration
because verification techniques are required to handle the testing.
growing software complexity. This short paper introduces the A DTC requires guarantee from the execution model of the
deterministic test cases (DTCs) for extending the standard
testing practices to test incremental changes in behavior-based robot software that the algorithms provide the same results
systems. Recorded sensor data for DTCs and design patterns on the robot and on a remote computer. Some basic design
guarantee that the behavior execution is equivalent on the robot patterns should be followed to ensure this constraint:
and when the test case is simulated on a computer. These DTCs Heartbeat (HB): A timer signals the main cycles in the
can be created easily, their execution is fast, they can test any
kind of robot skills and they minimize the manual testing with software when periodic tasks must be executed.
robots in a project. A real world example with a Sony ERS-7 Robot state (RS): This data storage contains the latest
proves that the DTCs can be used successfully in a long run. sensor data (e.g. accelerometer, sonar) and the higher
level variables (e.g. emotions, locomotion direction).
I. INTRODUCTION
Sensor data are collected between heartbeats, but they
Traditionally, the robot control software is developed in are not evaluated until the new heartbeat signal arrives.
simulation environments to spare the operating time of the The higher level variables are extracted from the raw
expensive robots. In [1], Pioneer 3-DX and PeopleBot robots sensor data and they are stored to the robot state. To use
were modeled in ROS and Gazebo to run autonomous DTCs on the robots with limited resources, the robot
navigation task with 3D mapping. These robots had wheels, state should be constructed as light as possible. For
therefore, the dynamics modeling was easier than the chal- example, if the environmental brightness is computed
lenging legged robots. They found that a proper robot model from the camera picture, the data structures of this
in the simulation provided enough precision to deploy the de- algorithm should not be stored in the robot state, only
veloped code to the robots. However, the difference between the final brightness level.
the simulation and reality makes often impossible to reuse Session log (SL): When the robot state is actualized after
the same software in both the simulation environment and a heartbeat, the new version is saved to the session log.
the real robot. Laue and Hebbel [2] tried to overcome this Furthermore, the behaviors update their states according
problem by combining the Webots simulation and recorded to the new robot state and they report their state changes
data of the robot for optimizing gait parameters, but they to the session log as well. A session log collects these
could not reach exact match between the two environments information after the robot is switched on until it is
with genetic algorithm. Araiza-Illan et al [3] used model- powered down.
based test generation in ROS and Gazebo to reach high code Random numbers (RN): The robot software must report
coverage during testing and cover rare cases. A limitation of all generated random numbers to the session log which
their work was the static simulation environment and on-line effect the behaviors.
test generation would be required to cover those cases. As we Since a session log contains all information (sensor data,
can see all kind of solutions are available to develop robot random numbers) what influence the behavior state changes,
software, but to the best knowledge of the authors, there the whole session can be replayed back deterministically with
has been a little interest in the literature for reproducible the log on a remote machine.
testing of mobile robots. This paper presents a concept how
the testing process can be enhanced with recorded test cases A. Test Case Creation
of the robot to deal with the increasing complexity of the A DTC is prescribed with a test case specification, which
behaviors.
Algorithm 1 Deterministic test case creation.
II. D ETERMINISTIC T EST C ASES 1 . S t a r t t h e r o b o t s o f t w a r e and c r e a t e a h e a r t b e a t t i m e r .
2. t = 0
The proposed deterministic test cases (DTCs) in this paper 3 . C o l l e c t s e n s o r d a t a and w a i t f o r t h e h e a r t b e a t s i g n a l .
does not replace the traditional testing practices. The robot 4 . U p d a t e t h e a c t u a l r o b o t s t a t e ( RSt ) w i t h t h e s e n s o r d a t a .
5 . U p d a t e t h e b e h a v i o r s , s a v e t h e random numbers t o RNt and
software still requires unit, module and functional tests, but t h e b e h a v i o r s t a t e c h a n g e s t o BSt .
6 . t = t +1
1 Csaba Kert
esz and Markku Turunen are with University of Tampere, 7 . Goto 3 u n t i l t h e t e s t c a s e i s f i n i s h e d .
33710 Tampere, Finland. (emails: csaba.kertesz@ieee.org and 8 . Save t h e s e s s i o n l o g .
markku.turunen@uta.fi)

Reproducible Research in Robotics: Current Status and Road Ahead Workshop


ICRA 2017, Singapore
Algorithm 2 Deterministic test case execution. quick as possible. The behavior state changes are saved
1 . Load t h e s e s s i o n l o g f o r a DTC and s t a r t t h e r o b o t to BSt since the equivalent execution must be verified by
software .
2. Create a heartbeat timer . comparing them to robot version (BSt ). If the behaviors use
3. t = 0 random numbers, they are read from RNt . The session log
4 . I n c r e a s e t h e h e a r t b e a t t i m e r by HBt .
5 . Load t h e c u r r e n t r o b o t s t a t e ( RSt ) from t h e l o g . processing continues respectively until the DTC is finished
6 . U p d a t e t h e b e h a v i o r s w i t h RSt , u s e t h e random numbers (t = T-1). The DTC is successful if the recorded behavior
from RNt and s a v e t h e b e h a v i o r s t a t e c h a n g e s t o BS t .
7 . t = t +1 state changes are equivalent with the stored changes in the
8 . I f t < T1 t h e n g o t o 4 session log.
9 . Compare {BS0 , . . . , BST 1 } t o {BS 0 , . . . , BS T 1 } . I f
t h e y a r e e q u a l t h e DTC was s u c c e s s f u l o t h e r w i s e f a i l e d .
III. L IMITATIONS
illustrates the purpose, and step-by-step procedures. The Deterministic test cases can be recorded easily with the
session log of a DTC is defined as follows: robot regardless of the tested skills, however, this procedure
SL = (HBt , RSt , BSt , RNt ), t {0, ..., T 1} (1) requires human supervision. An other important fact is that
the behavior state changes in the session log BS0 , ..., BST 1
where the session log (SL) stores the heart beat intervals must be modified if a smaller revision is introduced in the
(HBt ), the robot states (RSt ), the behavior state changes tested behaviors (e.g. a behavior name is changed). When the
(BSt ) and the generated random numbers (RNt ) for each tested behavior or the underlying sensor data processing was
t cycle from the robot startup (t = 0) until the test case is considerable changed in the software, the session log for the
finished (t = T-1). The DTC creation is detailed in Algorithm DTC must be recorded again with the robot. Although these
1. When the session log is recorded on the robot, the practices have maintenance costs and DTCs are suitable for
heartbeat timer issue a signal based on the system time in e.g. finished behaviors, but running a DTC on a PC spares the
every 30 msecs to evaluate the gathered sensor data since the manual testing session with a real robot.
previous heartbeat, the robot state is filled with the new data
and the behaviors are updated according to the actual robot IV. E XAMPLE A PPLICATION
state. The elapsed time between two heartbeat signals (HBt ) DTCs have been used in the AiBO+ project1 for three
are recorded to the session log because it is not guaranteed years to build a new artificial intelligence (AI) for the
that the operating system on the robot can precisely keep the Sony ERS-7 robot dogs. The new features were added
fixed heartbeat intervals and some behavior functions may incrementally to the behavior-based system and the previous
depend on the elapsed time. skills were protected by testing their recorded DTCs. The
As it can be seen, the DTC definition is general, it does increasing software complexity was also handled by the
not depend on specific robot hardware or skill. Any situation dynamic behavior creation with algorithmic decomposition
can be tested with a DTC forasmuch the executed behaviors [4] how the skills can be separated effectively.
exhibit the robot capabilities to solve a problem. 15 complex test cases have been defined for verification,
To describe an example, an obstacle-avoidance DTC can including locomotion functions, obstacle avoidance, touch
be created with the above mentioned principles if the session responses and motion control from a remote client. The
log is saved while the robot detect and avoid an object. DTC execution is quick and an AI instance for each DTC
The robot starts to move forward after powered on (t = can be tested in separate threads simultaneously. With these
0), an obstacle is detected by the sonar sensor data after advantages, the 17.5 minutes-long session logs are executed
1 meter, object-avoidance behavior is activated on the robot, in few seconds on an average laptop. Because the PC runs
the locomotion path is modified, the robot turns away and the same robot software in simulation mode, additional code
the session is terminated after 30 more seconds (t = T-1). quality tools (code coverage, memory error checkers) can be
The session log is finished and transferred from the robot to used in conjunction with DTCs.
a computer as an object-avoidance test case.
V. C ONCLUSION
B. Test Case Execution
The deterministic test cases were introduced in this paper
When a new change happens in the robot software, a DTC to show a behavior-based testing method which runs the
can be run by the pseudo-code of Algorithm 2 on a regular robot software on a PC identically. This method can be
PC. There are key differences in the software execution on beneficial to develop behavior-based robots for long-term
the robot and on the computer in testing mode. When the research or commercial purposes. The proposed behavior
heartbeats are simulated on the PC, the heartbeat timer does execution model has further advantages in the debugging
not take into account the system clock, but the elapsed time and feature extraction for machine learning, but they are out
is increased by HBt for each cycle from the session log. of the scope in this paper because of the page limitations.
The test case simulation do not have to wait between the Further work can include the standardization of the robot
cycles because the robot state for time t (RSt ) is already
available to update the behaviors and the execution is as 1 http://aiboplus.sf.net

Reproducible Research in Robotics: Current Status and Road Ahead Workshop


ICRA 2017, Singapore
state and the scalability must be analyzed with behavior-
based systems with very high complexity.
R EFERENCES
[1] K. Takaya, et al. Simulation environment for mobile robots testing
using ROS and Gazebo, in Proc. of 20th Intl. Conf. in System Theory,
Control and Computing (ICSTCC), 2016, pp. 96-101.
[2] T. Laue, and M. Hebbel, Automatic parameter optimization for a
dynamic robot simulation, in Robot Soccer World Cup. Springer
Berlin Heidelberg, 2008, pp 121-132.
[3] D. Araiza-Illan, A. G. Pipe, and K. Eder, Model-based Test Gener-
ation for Robotic Software: Automata versus Belief-Desire-Intention
Agents, arXiv preprint arXiv:1609.08439, 2016.
[4] C. Kertesz, Dynamic behavior network, in Proc. of 10th Intl. Symp.
of Applied Machine Intelligence and Informatics (IEEE-SAMI), 2012,
pp. 207-212.

Reproducible Research in Robotics: Current Status and Road Ahead Workshop


ICRA 2017, Singapore

The author has requested enhancement of the downloaded file. All in-text references underlined in blue are linked to publications on ResearchGate.

Das könnte Ihnen auch gefallen