Skip to content
Snippets Groups Projects
Commit b3d01f59 authored by Mirko Wächter's avatar Mirko Wächter Committed by Sarah Puch
Browse files

Fixed FT Obs: datafield were not created because exception was thrown

parent 4f6fec1c
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,11 @@ DatafieldRefBasePtr armarx::ForceTorqueObserver::createNulledDatafield(const Dat
DatafieldRefBasePtr ForceTorqueObserver::getForceDatafield(const std::string &nodeName, const Ice::Current &)
{
auto id = getForceDatafieldId(nodeName, nodeName);
if(!existsChannel(id->channelName))
throw UserException("No sensor for node '" + nodeName + "'available: channel " + id->channelName);
if(!existsDataField(id->channelName, id->dataFieldName))
throw UserException("No sensor for node '" + nodeName + "'available: datafield " + id->dataFieldName);
return new DatafieldRef(this, id->channelName, id->dataFieldName);
}
......@@ -138,6 +143,11 @@ DatafieldRefBasePtr ForceTorqueObserver::getForceDatafield(const std::string &no
DatafieldRefBasePtr ForceTorqueObserver::getTorqueDatafield(const std::string &nodeName, const Ice::Current &)
{
auto id = getTorqueDatafieldId(nodeName, nodeName);
if(!existsChannel(id->channelName))
throw UserException("No sensor for node '" + nodeName + "'available: channel " + id->channelName);
if(!existsDataField(id->channelName, id->dataFieldName))
throw UserException("No sensor for node '" + nodeName + "'available: datafield " + id->dataFieldName);
return new DatafieldRef(this, id->channelName, id->dataFieldName);
}
......@@ -149,10 +159,6 @@ DataFieldIdentifierPtr ForceTorqueObserver::getForceDatafieldId(const std::strin
else
channelName = nodeName + "_" + frame;
std::string datafieldName = "forces";
if(!existsChannel(channelName))
throw UserException("No sensor for node '" + nodeName + "'available: channel " + channelName);
if(!existsDataField(channelName, datafieldName))
throw UserException("No sensor for node '" + nodeName + "'available: datafield " + datafieldName);
DataFieldIdentifierPtr id = new DataFieldIdentifier(getName(), channelName, datafieldName);
return id;
}
......
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