Problem writting char data

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

I have found the solution to the problem with write parameters that are not part of the COLLADA specification. I write down the solution for help someone that will have the same problem.

// Gets the meta element of the parent tag that will contain the parameter
// sensor is the tag that represents a robot sensor
daeMetaElement* meta = sensor->getMeta();

// Allows to insert a parameter not present in the COLLADA specifications
meta->setAllowsAny(true);

// Adds sensor param to the COLLADA document
// ‘param_name’ is a const char* variable that contains the name of the param
// ‘str_param_value’ is a std::string variable that contains the value of the param
sensor->add(meta->create(‘param_name’))->setCharData(‘str_param_value’);

I hope that this may be useful to someone