Testing Facilities
Introduction
If you want to test your motion control/tactic/whatever, the testfile facility
is a good, easy way to do it automatically. The test file facility executes
from a script file test functions repeatedly from set starting and ending
conditions and logs the results to a log file that you can process using
the octave or matlab scripts.
Relevant files and directories
datatactics.h/cc contains all the relevant C code.
config/testfiles the test files
config/data some sample data
config/data/analysis the matlab/octave files
Making it go
Given a test file test.tf in config/testfiles (or wherever teh tactic.cfg
parameter poitns to), click on the tactic drop down and select data_collect
(with a robot enabled) and enter the test file name test.tf. Click go. The
robot will run to the start point, pause, and then execute the test. While
running the test, the robot will log all its information to a log file in
config/data (or wherever tactic.cfg poitns to). The name will be <test
filename no extension>.<test name>.<run>. You can then extract
the information after the test is completed with Matlab or Octave and teh
analysis programs...although they still need a little work.
Test Functions
The Test function is derived from a robottactic class so can use nav2point
etc. If you want low-levels or to use another tactic like TShoot, use the
override flag. With that you can execute any other tactic.
Test Files
The test script file controls the execution sequence and test functions that
perform the actual test. Each test gets all the world information, plus
any testfunction information, logged to a text file. I have some Matlab
scripts (still pretty simple though), that parse the log files and produce
graphs etc.
The test file controls the start conditiosn and end conditions for each test.
Example test files (and an example called test.tf) located in config/testfiles.
These test files are scripts that you use to control a set of tests. The
file can contain multiple tests. Each test has a name, which will become
part of the log file name, a set of optional start, end and timeotu conditions,
the test function and its parameters, and how many times to execute it.
The test file test.tf describes the format.
For each sequence:
while ( not ready to start)
robot drives to start
pause
while (end conditiosn not true)
execute teh test function
log the vision, world, tracker information
log testfunction user information
done
Octave/Matlab scripts
The octave scripts use the function readlog (in readlog.m) to pull the data
from teh files. Two scripts motlinear and motrot will process motions.linear.xxx
and motions.rotational.xxx files to produce some pretty graphs and values.
Brett Browning
Last
modified: Sun Oct 13 23:52:01 EST 2002