17 #ifndef GZ_SIM_COMPONENTS_MODEL_HH_
18 #define GZ_SIM_COMPONENTS_MODEL_HH_
22 #include <sdf/Model.hh>
23 #include <sdf/Root.hh>
27 #include <gz/sim/config.hh>
34 inline namespace GZ_SIM_VERSION_NAMESPACE {
46 sdf::ElementPtr modelElem = _model.Element();
54 if (modelElem->HasElement(
"pose"))
56 sdf::ElementPtr poseElem = modelElem->GetElement(
"pose");
57 if (poseElem->HasAttribute(
"relative_to"))
66 static bool warned =
false;
69 gzwarn <<
"Skipping serialization / deserialization for models "
70 <<
"with //pose/@relative_to attribute."
78 _out <<
"<?xml version=\"1.0\" ?>"
79 <<
"<sdf version='" << SDF_PROTOCOL_VERSION <<
"'>"
95 sdf::Errors errors = root.LoadSdfString(sdf);
102 _model = *root.Model();
117 serializers::SdfModelSerializer>;