Skip to content

Commit 4a755a1

Browse files
Order srdf save so plugins are above the acm
1 parent 5aeca39 commit 4a755a1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tesseract_srdf/src/srdf_model.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,18 @@ bool SRDFModel::saveToFile(const std::string& file_path) const
350350
xml_root->InsertEndChild(xml_kin_plugin_entry);
351351
}
352352

353+
if (!contact_managers_plugin_info.empty())
354+
{
355+
tesseract_common::fs::path p(file_path);
356+
std::ofstream fout(p.parent_path().append("contact_managers_plugin_config.yaml").string());
357+
YAML::Node config;
358+
config[tesseract_common::ContactManagersPluginInfo::CONFIG_KEY] = contact_managers_plugin_info;
359+
fout << config;
360+
tinyxml2::XMLElement* xml_kin_plugin_entry = doc.NewElement("contact_managers_plugin_config");
361+
xml_kin_plugin_entry->SetAttribute("filename", "contact_managers_plugin_config.yaml");
362+
xml_root->InsertEndChild(xml_kin_plugin_entry);
363+
}
364+
353365
if (!calibration_info.empty())
354366
{
355367
tesseract_common::fs::path p(file_path);
@@ -390,18 +402,6 @@ bool SRDFModel::saveToFile(const std::string& file_path) const
390402
}
391403
}
392404

393-
if (!contact_managers_plugin_info.empty())
394-
{
395-
tesseract_common::fs::path p(file_path);
396-
std::ofstream fout(p.parent_path().append("contact_managers_plugin_config.yaml").string());
397-
YAML::Node config;
398-
config[tesseract_common::ContactManagersPluginInfo::CONFIG_KEY] = contact_managers_plugin_info;
399-
fout << config;
400-
tinyxml2::XMLElement* xml_kin_plugin_entry = doc.NewElement("contact_managers_plugin_config");
401-
xml_kin_plugin_entry->SetAttribute("filename", "contact_managers_plugin_config.yaml");
402-
xml_root->InsertEndChild(xml_kin_plugin_entry);
403-
}
404-
405405
doc.InsertFirstChild(xml_root);
406406
tinyxml2::XMLError status = doc.SaveFile(file_path.c_str());
407407
if (status != tinyxml2::XMLError::XML_SUCCESS)

0 commit comments

Comments
 (0)