@@ -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