Hello guys, Can someone help me?
I am developping a COLLADA 1.5 exporter to OpenRAVE (Robot simulator) and I have some troubles to achieve this. The problem is that I wish to write down some sensor features and I want to use the setCharData method of the daeElement class to store this info.But I don’t know how to activate the char data. I have seen that there is a hasCharData method that indicates that the object has char data. In my case It is always false. Here there is a sample of the source that I am writting:
sensor->getMeta()->setAllowsAny(true);
domInstance_sensorRef element = daeSafeCast<domInstance_sensor>(domInstance_sensor::create(*_collada.get()));
element->setElementName("Elemento");
element->setCharData(string("15.5"));
sensor->getContents().append(element);
for (size_t i = 0; i < sensor->getContents().getCount(); i++)
{
if (sensor->getContents()[i]->hasCharData())
{
RAVELOG_DEBUGA("Has Char Data
");
}
else
{
RAVELOG_DEBUGA("Doesn’t have Char Data
");
}
RAVELOG_WARNA("Content %d Type ID %d Name %s:%s
",
i,
sensor->getContents()[i]->typeID(),
sensor->getContents()[i]->getElementName(),
sensor->getContents()[i]->getCharData().c_str());
}
It always appears the message "Doesn’t have Char Data
" because the char data it is not allowed.
Any help good be wellcome…
Best regards