Skip to content
Snippets Groups Projects
Commit 215e9bcb authored by Simon Ottenhaus's avatar Simon Ottenhaus
Browse files

fixed compiler error

parent c6902502
No related branches found
No related tags found
No related merge requests found
......@@ -74,9 +74,9 @@ void ForceTorqueObserver::offerValue(std::string nodeName, const std::string &ty
FramedVector3Ptr vec = FramedVector3Ptr::dynamicCast(value);
DataFieldIdentifierPtr id;
if(type ==FORCES_STRING)
if(type =="forces")
id = getForceDatafieldId(nodeName, vec->frame);
else if(type == TORQUES_STRING)
else if(type == "torques")
id = getTorqueDatafieldId(nodeName, vec->frame);
else
throw LocalException() << "Unknown sensor type: " << type;
......@@ -112,12 +112,12 @@ void armarx::ForceTorqueObserver::reportSensorValues(const std::string &sensorNo
if(forces)
{
std::string type = FORCES_STRING;
std::string type = "forces";
offerValue(sensorNodeName, type, forces);
}
if(torques)
{
std::string type = TORQUES_STRING;
std::string type = "torques";
offerValue(sensorNodeName, type, torques);
}
}
......@@ -148,7 +148,7 @@ DataFieldIdentifierPtr ForceTorqueObserver::getForceDatafieldId(const std::strin
channelName = nodeName;
else
channelName = nodeName + "_" + frame;
std::string datafieldName = FORCES_STRING;
std::string datafieldName = "forces";
if(!existsChannel(channelName))
throw UserException("No sensor for node '" + nodeName + "'available: channel " + channelName);
if(!existsDataField(channelName, datafieldName))
......@@ -164,7 +164,7 @@ DataFieldIdentifierPtr ForceTorqueObserver::getTorqueDatafieldId(const std::stri
channelName = nodeName;
else
channelName = nodeName + "_" + frame;
std::string datafieldName = TORQUES_STRING;
std::string datafieldName = "torques";
DataFieldIdentifierPtr id = new DataFieldIdentifier(getName(), channelName, datafieldName);
return id;
}
......@@ -44,8 +44,11 @@ namespace armarx
*/
virtual PropertyDefinitionsPtr createPropertyDefinitions();
const std::string FORCES_STRING = "forces";
const std::string TORQUES_STRING = "torques";
// DOES NOT COMPILE:
// sorry, unimplemented: non-static data member initializers
// error: in-class initialization of static data member ‘FORCES_STRING’ of non-literal type
//const std::string FORCES_STRING = "forces";
//const std::string TORQUES_STRING = "torques";
private:
armarx::Mutex dataMutex;
std::string topicName;
......
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