20 #include <boost/lexical_cast.hpp> 21 #include <boost/algorithm/string.hpp> 39 for (std::vector<SceneSharedPointer>::iterator sceneIterator =
SceneList.begin(); sceneIterator !=
SceneList.end(); ++sceneIterator)
41 (*sceneIterator)->getObjectFromDb();
42 (*sceneIterator)->calcAveragePositionForEachObject();
43 (*sceneIterator)->calcPresenceInSceneForEachObject();
44 (*sceneIterator)->getObjectAverageDistance();
45 (*sceneIterator)->normalize();
46 (*sceneIterator)->rank();
47 (*sceneIterator)->displayStats();
49 std::list<evalulatorTupleSharedPtr> evaluatorTupleList;
50 std::list<std::string> sceneList;
51 ROS_DEBUG_STREAM(
"Domain::calcIntermediateObjectsForDomain begin scene fusion");
53 for (std::vector<SceneSharedPointer>::iterator sceneIterator =
SceneList.begin(); sceneIterator !=
SceneList.end(); ++sceneIterator)
55 std::string sceneName = (*sceneIterator)->getSceneName();
56 sceneList.push_back(sceneName);
57 std::unordered_map<std::string,ObjectSharedPointer> bufferObjectMap = (*sceneIterator)->getObjectMap();
58 for (std::unordered_map<std::string,ObjectSharedPointer>::iterator objectMapIterator=bufferObjectMap.begin(); objectMapIterator!=bufferObjectMap.end(); ++objectMapIterator)
61 objectMapIterator->second->getObjectName(),objectMapIterator->second->getObservedId())));
64 ROS_DEBUG_STREAM(
"Domain::calcIntermediateObjectsForDomain scene fusion completed");
65 ROS_DEBUG_STREAM(
"Domain::calcIntermediateObjectsForDomain begin from evaluation");
68 ROS_DEBUG_STREAM(
"Domain::calcIntermediateObjectsForDomain end from evaluation");
86 std::vector<std::string> pathSplit;
87 boost::split(pathSplit,
Scene_path, boost::is_any_of(
"/"));
88 std::string dbName = pathSplit[pathSplit.size()-1];
90 const std::string placeholder =
"XXX";
91 std::string::size_type pos;
92 if ((pos =
AutomatPath.find(placeholder)) != std::string::npos) {
93 AutomatPath.replace(pos, placeholder.length(), dbName);
96 if ((pos =
NBVPath.find(placeholder)) != std::string::npos) {
97 NBVPath.replace(pos, placeholder.length(), dbName);
113 std::vector<std::string> Scene_patterns = tabelHelper.getRecordedPatternNames();
114 for(
const std::string &name : Scene_patterns)
126 std::chrono::time_point<std::chrono::system_clock>
start;
127 start = std::chrono::system_clock::now();
128 std::time_t start_time = std::chrono::system_clock::to_time_t(start);
130 std::ofstream file(filePath, std::ios::out | std::ios::app);
133 file << std::endl <<this->DomainName <<
" Log file" << std::endl;
134 file <<
"Timestamp for the Log " << std::ctime(&start_time) << std::endl;
135 file << std::endl <<
"Intermediate Objects for The Domain " << std::endl;
138 file << std::get<1>(*tuple) <<
" : " << std::get<0>(*tuple) << std::endl;
142 for (std::vector<SceneSharedPointer>::iterator sceneIterator =
SceneList.begin(); sceneIterator !=
SceneList.end(); ++sceneIterator)
144 (*sceneIterator)->publishLogs(filePath);
151 std::string output =
"<InterObj>";
154 output +=
"<obj type=\"" + std::get<2>(*tuple) +
"\" identifier=\""+ std::get<3>(*tuple) +
"\"/>";
156 output +=
"</InterObj>";
157 std::ofstream file(
AutomatPath, std::ios::out | std::ios::trunc);
std::shared_ptr< objectTuple > objectTupleSharedPtr
std::vector< SceneSharedPointer > SceneList
std::list< objectTupleSharedPtr > getIntermediateObjects()
void getDomainFromParams()
std::list< objectTupleSharedPtr > IntermediateOjects
void calcIntermediateObjectsForDomain()
double GainValueThreshold
const std::string & getNamespace() const
void publishIntermediateObjectToAutomat()
#define ROS_DEBUG_STREAM(args)
bool getParam(const std::string &key, std::string &s) const
std::tuple< double, std::string, std::string, std::string, std::string > evalulatorTuple
std::shared_ptr< Scene > SceneSharedPointer
ros::NodeHandle LocalHandle
std::shared_ptr< evalulatorTuple > evalulatorTupleSharedPtr