Skip to content
Snippets Groups Projects
Commit 87474ee7 authored by Joana Plewnia's avatar Joana Plewnia
Browse files

fixed issue with starting and stopping of recording several parallel LTMs at once

parent 70f9fbf1
No related branches found
No related tags found
1 merge request!322Feature/forgetting in wm and em
......@@ -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, &ltms]{
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment