The Husky examples, examples/husky_braitenberg and examples/husky_braitenberg_nest_server, require additional gazebo models that are not included in the NRP-core repository. These assets can be found in other NRP repositories, and the instructions below show how to download and make them available to gazebo.
Now it should be possible to run the Husky experiments!
To record progress of a simulation in Gazebo, the following command line arguments can be used:
-r
- enables recording of simulation state data. By default, the data is saved in $HOME/.gazebo/log/
directory--record_path <path>
- absolute path in which to store the recorded dataThese options should be added to the Gazebo engine configuration section in the simulation configuration, under the EngineProcStartParams
parameter:
In order to replay the simulation, gazebo executable should be called with the recording arguments mentioned above replaced with -u -p <log_file>
, and with the rest of arguments matching exactly the arguments used during the recording:
The full command can be printed during NRPCoreSim execution by adding --cloglevel=debug
argument.
It is possible to record a video by clicking the Record a video
button visible on the top right part of the gazebo GUI during the replay of simulation.
More information about gazebo logging can be found at the following page.
Some basic tools are included for time profiling the execution of NRPCore experiments. They can be used to debug bottlenecks in the execution.
In order to enable time profiling, nrp-core must be configured with -DENABLE_TIME_PROFILE=ON
:
see this page for more details.
After this is done, running an NRPCore experiment will generate a set of log files containing profiling information. The files are stored in a directory: <experiment_folder>/time_logs<time_stamp>
. Each of these files contain a list of time points (one for each simulation loop step) corresponding to each of the sub-steps in a loop step. More information about the simulation loop step structure can be found in this Simulation Loop step structure page. All the time data is express in microseconds wrt a fixed time point with no relevance. Thus, data is meant to analyzed by comparing time differences between the same rows of different files.
The files containing simulation loop sub-step temporal information are:
Additionally, two files containing processed data are stored:
after_restart_engines - step_start
in the aforementioned filesA python script is provided to plot logged profiling data. It can be found at tools/python plot_sim_loop.py
. It takes as argument a list of directories separated by spaces containing profiling data generated by NRPCore. It plots a graph with the duration of each simulation loop sub-steps in milliseconds and prints some stats from this data. The maximum number of log directories that can be plotted together is four.
As an example, below is shown a plot from a run of the examples/husky_braitenberg
experiment:
And the accompanying printout stats from the script:
The script has some dependencies which are not installed during the nrp-core installation guide, you might need to install them manually before running the script.