Skip to content
Snippets Groups Projects
Commit 8d1f4f6c authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

updates to aron and armem

parent 85608875
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ namespace armarx::armem::server::plugins
void ComponentPlugin::postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties)
{
ClientPlugin::postCreatePropertyDefinitions(properties);
properties->topic(memoryListener, "MemoryUpdates");
properties->topic(memoryListener, this->parent<ComponentPluginUser>().memoryListenerDefaultName);
}
......
......@@ -86,6 +86,9 @@ namespace armarx::armem::server
Memory memory;
std::mutex memoryMutex;
/// property defauls
std::string memoryListenerDefaultName = "MemoryUpdates";
/// Helps connecting `memory` to ice. Used to handle Ice callbacks.
MemoryToIceAdapter iceMemory { &memory };
......
......@@ -82,7 +82,7 @@ armem::Memory setupMemoryWithType(const std::string& memoryName, const aron::typ
return memory;
}
/*
BOOST_AUTO_TEST_CASE(test_memory_export__easy_int_setup)
{
std::string memoryName = "TestMemory_IntSetup";
......@@ -325,6 +325,51 @@ BOOST_AUTO_TEST_CASE(test_memory_export__easy_bool_setup)
//std::cout << mfs2_str << std::endl;
BOOST_CHECK_EQUAL(mfs_str == mfs2_str, true);
armem::Memory memory2 = mfs.readMemoryFromDisk(memoryName);
BOOST_CHECK_EQUAL(memory.equalsDeep(memory2), true);
}*/
BOOST_AUTO_TEST_CASE(test_memory_export__easy_rainer_setup)
{
std::string memoryName = "TestMemory_RainerSetup";
aron::typenavigator::AronObjectTypeNavigatorPtr t(new aron::typenavigator::AronObjectTypeNavigator(aron::AronPath()));
t->setObjectName("TestRainerType1");
aron::typenavigator::AronDictTypeNavigatorPtr tm1(new aron::typenavigator::AronDictTypeNavigator(aron::AronPath()));
aron::typenavigator::AronFloatTypeNavigatorPtr tm1m1(new aron::typenavigator::AronFloatTypeNavigator(aron::AronPath()));
tm1->setAcceptedType(tm1m1);
aron::typenavigator::AronStringTypeNavigatorPtr tm2(new aron::typenavigator::AronStringTypeNavigator(aron::AronPath()));
aron::typenavigator::AronDictTypeNavigatorPtr tm3(new aron::typenavigator::AronDictTypeNavigator(aron::AronPath()));
aron::typenavigator::AronStringTypeNavigatorPtr tm3m1(new aron::typenavigator::AronStringTypeNavigator(aron::AronPath()));
tm3->setAcceptedType(tm3m1);
aron::typenavigator::AronStringTypeNavigatorPtr tm4(new aron::typenavigator::AronStringTypeNavigator(aron::AronPath()));
t->addAcceptedType("float_params", tm1);
t->addAcceptedType("name", tm2);
//t->addAcceptedType("string_params", tm3);
t->addAcceptedType("type", tm4);
armem::Memory memory = setupMemoryWithType(memoryName, t, nullptr, 15, 1);
// export memory
std::string storagePath = "/tmp/MemoryExport"; // important! without tailing /
std::filesystem::remove_all(storagePath);
armem::io::FileSystemMemoryManager mfs(storagePath, true);
mfs.writeOnDisk(memory);
std::string mfs_str = mfs.toString();
armem::io::FileSystemMemoryManager mfs2(storagePath);
mfs2.update();
std::string mfs2_str = mfs2.toString();
//std::cout << "MFS1: " << std::endl;
//std::cout << mfs_str << std::endl;
//std::cout << "MFS2: " << std::endl;
//std::cout << mfs2_str << std::endl;
BOOST_CHECK_EQUAL(mfs_str == mfs2_str, true);
armem::Memory memory2 = mfs.readMemoryFromDisk(memoryName);
BOOST_CHECK_EQUAL(memory.equalsDeep(memory2), true);
}
......@@ -138,7 +138,7 @@ namespace armarx
public:
AronIndexNotValidException() = delete;
AronIndexNotValidException(const std::string& caller, const std::string& method, const std::string& reason, int real, int expected) :
AronException(caller, method, reason + ". The measured size is: " + std::to_string(real) + ". The maximum index was: " + std::to_string(expected))
AronException(caller, method, reason + ". The requested index is: " + std::to_string(real) + ". The maximum index was: " + std::to_string(expected))
{
}
......
......@@ -191,7 +191,7 @@ BOOST_AUTO_TEST_CASE(AronNaturalIKTest)
AronPath memberReached(path, "reached");
AronPath memberJointValues(path, "jointValues");
AronPath indexJointValues0(memberJointValues, "0");
AronPath indexJointValues1(memberJointValues, "1");
AronPath indexJointValues1(memberJointValues, "1000");
BOOST_CHECK_EQUAL(path.toString(), "\\");
BOOST_CHECK_EQUAL(path.size(), 0);
......
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