Skip to content
Snippets Groups Projects
Commit bc7d1326 authored by Fabian Paus's avatar Fabian Paus
Browse files

ArViz: Handle not readable robot files explicitly

parent b3f10766
No related branches found
No related tags found
No related merge requests found
......@@ -34,17 +34,14 @@ namespace armarx::viz::coin
<< "\n\t'" << filename << "'"
<< "\nConsider specifying the containing ArmarX package and relative data path instead to "
<< "improve portability to other systems.";
fullFilename = filename;
}
else
// We need to always check that the file is readable otherwise, VirtualRobot::RobotIO::loadRobot crashes
ArmarXDataPath::FindPackageAndAddDataPath(project);
if (!ArmarXDataPath::SearchReadableFile(filename, fullFilename))
{
ArmarXDataPath::FindPackageAndAddDataPath(project);
if (!ArmarXDataPath::SearchReadableFile(filename, fullFilename))
{
ARMARX_INFO << deactivateSpam()
<< "Unable to find readable file for name: " << filename;
return result;
}
ARMARX_INFO << deactivateSpam()
<< "Unable to find readable file for name: " << filename;
return result;
}
try
......@@ -59,10 +56,18 @@ namespace armarx::viz::coin
// }
ARMARX_INFO << "Loading robot from " << fullFilename;
result = VirtualRobot::RobotIO::loadRobot(fullFilename, loadMode);
result->setThreadsafe(false);
// Do we want to propagate joint values? Probably not...
// Closing the hand on the real robot could be implemented on another level
result->setPropagatingJointValuesEnabled(false);
if (result)
{
result->setThreadsafe(false);
// Do we want to propagate joint values? Probably not...
// Closing the hand on the real robot could be implemented on another level
result->setPropagatingJointValuesEnabled(false);
}
else
{
ARMARX_WARNING << "Could not load robot from file: " << fullFilename
<< "\nReason: loadRobot() returned nullptr";
}
}
catch (std::exception const& ex)
{
......
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