diff --git a/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp b/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp index 6a8c3a3a3bd84c17a6b7d9117d9d50abe548e686..d9c6a40aa7aac9b325ad9f21672b8b1e5226d041 100644 --- a/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp +++ b/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp @@ -524,8 +524,30 @@ namespace armarx::armem::server ARMARX_TRACE; ARMARX_CHECK_NOT_NULL(longtermMemory); ARMARX_IMPORTANT << "Enabling the recording of memory " << longtermMemory->id().str(); - longtermMemory->startRecording(); // TODO: config and execution time! - //other LTMs only start recording when defined from the beginning + std::vector<armarx::armem::server::ltm::Memory*> ltms; + ltms.push_back(longtermMemory); + ltms.push_back(secondLTM); + ltms.push_back(thirdLTM); + ltms.push_back(fourthLTM); + ltms.push_back(fiftLTM); + ltms.push_back(sixthLTM); + ltms.push_back(seventhLTM); + ltms.push_back(eightLTM); + ltms.push_back(ninthLTM); + ltms.push_back(tenthLTM); + ltms.push_back(eleventhLTM); + /* + ltms.push_back(twelvethLTM); + ltms.push_back(thirteenthLTM); + ltms.push_back(fourteenthLTM); + ltms.push_back(fifteenthLTM); + ltms.push_back(sixteenthLTM); + */ + for(int i = 0; i < static_cast<int>(ltms.size()); i++){ + ltms.at(i)->startRecording(); + } + //longtermMemory->startRecording(); // TODO: config and execution time! + dto::StartRecordResult ret; ret.success = true; @@ -560,7 +582,7 @@ namespace armarx::armem::server ltms.push_back(sixteenthLTM); */ std::vector<std::thread> threads; - for(int i = 0; i < 5; ++i){ + for(int i = 0; i < static_cast<int>(ltms.size()); ++i){ threads.push_back(std::thread([i, <ms]{ ltms.at(i)->stopRecording(); })); @@ -570,17 +592,8 @@ namespace armarx::armem::server thread.join(); } - ARMARX_INFO << "Stopped all LTM recordings"; - - /** - thirdLTM->stopRecording(); - longtermMemory->stopRecording(); - secondLTM->stopRecording(); - - fourthLTM->stopRecording(); - fiftLTM->stopRecording(); - - */ + ARMARX_INFO << "Stopped all LTM recordings, please wait with stopping the component until " + "all files are written"; dto::StopRecordResult ret; ret.success = true;