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

fixed error when transferring objects from memory to simulation without the commonstorage

parent 497875cc
No related branches found
No related tags found
No related merge requests found
......@@ -626,12 +626,14 @@ memoryx::GridFileManagerPtr Simulator::requestFileManager()
{
if (fileManager)
{
ARMARX_INFO << deactivateSpam(10) << "Was able to find a reference to the CommonStorage. Continue with existing connection to memory.";
return fileManager;
}
CommonStorageInterfacePrx commonStoragePrx = getProxy<CommonStorageInterfacePrx>(commonStorageName, false, "", false);
if (commonStoragePrx)
{
ARMARX_INFO << deactivateSpam(10) << "Was able to find a reference to the CommonStorage. Reset GridFSManager and continue with memory.";
fileManager.reset(new GridFileManager(commonStoragePrx));
}
else
......@@ -1098,12 +1100,12 @@ void Simulator::addObject(const memoryx::ObjectClassBasePtr& objectClassBase, co
void Simulator::addObjectFromFile(const armarx::data::PackagePath& packagePath, const std::string& instanceName, const PoseBasePtr& globalPose, bool isStatic, const Ice::Current&)
{
ARMARX_VERBOSE << "Add object from memory " << instanceName;
if (!requestFileManager())
{
ARMARX_WARNING << "Cannot add object - no connection to common storage";
return;
}
ARMARX_INFO << "Add object from memory " << instanceName;
//if (!requestFileManager())
//{
// ARMARX_WARNING << "Cannot add object - no connection to common storage";
// return;
//}
auto lockEngine = physicsWorld->getScopedEngineLock(__FUNCTION__);
auto lockData = physicsWorld->getScopedSyncLock(__FUNCTION__);
......
......@@ -178,6 +178,7 @@ namespace armarx::simulation::components::object_memory_to_simulation
else
{
ARMARX_INFO << "Found object: " << toPackagePath(objectInfo->simoxXML()).toSystemPath();
const armarx::PackagePath packagePath(toPackagePath(objectInfo->simoxXML()));
simulator->addObjectFromFile(
packagePath.serialize(), instanceName, globalPoseIce, objectPose.isStatic);
......
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