2011-06-05 14:45:39 +00:00
|
|
|
/*
|
2014-08-11 17:00:55 +00:00
|
|
|
Copyright (c) 2010-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
|
* Neither the name of the Universite de Sherbrooke nor the
|
|
|
|
|
names of its contributors may be used to endorse or promote products
|
|
|
|
|
derived from this software without specific prior written permission.
|
|
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
|
|
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
2011-06-05 14:45:39 +00:00
|
|
|
|
2013-02-03 22:12:02 +00:00
|
|
|
#include "rtabmap/core/Statistics.h"
|
2013-04-30 20:16:01 +00:00
|
|
|
#include <rtabmap/utilite/UStl.h>
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
namespace rtabmap {
|
|
|
|
|
std::map<std::string, float> Statistics::_defaultData;
|
|
|
|
|
bool Statistics::_defaultDataInitialized = false;
|
|
|
|
|
|
|
|
|
|
const std::map<std::string, float> & Statistics::defaultData()
|
|
|
|
|
{
|
|
|
|
|
Statistics stat;
|
|
|
|
|
return _defaultData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Statistics::Statistics() :
|
|
|
|
|
_extended(0),
|
|
|
|
|
_refImageId(0),
|
2013-06-05 19:25:16 +00:00
|
|
|
_loopClosureId(0),
|
2016-03-11 17:54:01 -05:00
|
|
|
_proximiyDetectionId(0),
|
2015-05-03 18:16:55 -04:00
|
|
|
_currentGoalId(0)
|
2011-06-05 14:45:39 +00:00
|
|
|
{
|
|
|
|
|
_defaultDataInitialized = true;
|
|
|
|
|
}
|
2012-06-24 17:19:34 +00:00
|
|
|
|
2011-06-05 14:45:39 +00:00
|
|
|
Statistics::~Statistics()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// name format = "Grp/Name/unit"
|
|
|
|
|
void Statistics::addStatistic(const std::string & name, float value)
|
|
|
|
|
{
|
2013-01-29 15:48:36 +00:00
|
|
|
uInsert(_data, std::pair<std::string, float>(name, value));
|
2011-06-05 14:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|