Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I ended up using folowing lines, that do what I need

auto box_name = my_box_sdf->GetAttribute("name");
(*box_name).GetAsString();

I ended up using folowing lines, that do what I need

auto box_name = my_box_sdf->GetAttribute("name");
(*box_name).GetAsString();

End for access to other <my_box> elements I use:

std::vector<std::string>  boxes_name_vec;
while( _sdf->HasElement("my_box") )
{
   auto my_box_sdf = _sdf->GetElement("my_box");
   auto box_name = my_box_sdf->GetAttribute("name");
   boxes_name_vec.push_back((*box_name).GetAsString());
   _sdf->RemoveChild(my_box_sdf);
}