Skip to content

SteerSuiteSimulationRecording

Neo-X edited this page Sep 18, 2015 · 1 revision

3.2. Recording and Replaying a Simulation using SteerSim

The __steersim__simulations can also be recorded to file. These recordings, of course, can be then be replayed at a later time. We found it useful to nickname these recordings "rec files." Rec files are intended to be an easy way to archive and share results, even when someone does not want to share their source code.

To make a recording, use the-storesimulationoption as follows:

./steersim -testcase <test-case-path> -storesimulation simple.rec

This command stores the AI simulation into the filesimple.rec. The.rec extension is not required, but it is the preferred extension for rec files.

To replay the rec file, use the-replay option. This option cannot be used at the same time as the-testcaseoption.

./steersim -replay simple.rec

While replaying a simulation, you can use the left and right arrow keys to shuttle back and forth along the timeline of the simulation. If the simulation plays too fast or slow, you can also use__+__ (without pressing shift) or__-__ keys to speed up or slow down the simulation, respectively.

Specifying the Modules Directly

Similar to the test case options described above, the-storesimulation and-replay are actually shortcuts for loading and specifying options to the appropriate modules. It is possible to specify more options by explicitly loading thesimulationRecorder andrecFilePlayermodules. For example to store a simulation:

./steersim -testcase <test-case-path> -module simulationRecorder,file=simple.rec

and to replay a simulation:

./steersim -module recFilePlayer,file=simple.rec

When an existing recording is being replayed, it actually creates agents that can be manipulated and analyzed just like other steering AI modules. Look carefully at the following example:

./steersim -module recFilePlayer,file=simple.rec,retime=1.5 -storesimulation simple-fast.rec -commandline -numframes 60

This example_simulates_ 60 frames, and each frame of the simulation it advances 1.5 frames in the playback. This means it will replay 90 frames ofsimple.rec, 50 percent faster. It then stores 60 frames of simulation intosimple-fast.rec. In other words, this example essentially transcodes a recording into a faster recording.

Producing Footstep Based Rec file

The footstepAI module has ability produce a different rec file format that stores information on the footstep data from the simulation. To record in thos format you need to pass the record parameter to the footstepAI module.

../build/bin/steersim -module footstepAI,record=blah.rec -ai footstepAI -config configs/footstepAI-config.xml -testcase ../testcases/crossing-4.xml

--Main.GlenBerseth - 2013-06-11