Skip to content

How to extend the timings metrics ?

Bruno Bodin edited this page Jun 20, 2019 · 1 revision

How to extend the timings metrics for a specific SLAM system?

Within the SLAMBench interface of a SLAM system, you can add customized metrics (Example in the MonoSLAM benchmark). This can be used to share algorithm specific information. You can also divided your algorithm into phases, this can be used to divide your timing in different section (Example in the KFusion benchmark).

How to add phases ?

When your algorithm follows a sequence of step within the computation, you can divide the process in different section. To do so, first you need to declare phases in the algorithm initialization :

bool sb_init_slam_system(SLAMBenchLibraryHelper * slam_settings)  {
...
    slam_settings->GetMetricManager().AddPhase("Preprocessing");
    slam_settings->GetMetricManager().AddPhase("Tracking");
...
}

Then during the process of frames, you can notice changes of phases :

	auto &metrics = slam_settings->GetMetricManager();
	slambench::metrics::Phase *preprocessing = metrics.GetPhase("Preprocessing");
	slambench::metrics::Phase *tracking = metrics.GetPhase("Tracking");

	preprocessing->Begin();
	....
	preprocessing->End();

	tracking->Begin();
	....
	tracking->End();

Please note that the phases could overlap, this is useful in the case of parallel processing.