53 std::filesystem::path file_path = package_path / KINEMATICS_FILE;
56 throw std::runtime_error(
"Failed to parse kinematics yaml file. This file is not critical but any previous "
57 "kinematic solver settings have been lost. To re-populate this file edit each "
58 "existing planning group and choose a solver, then save each change.");
97 std::ifstream input_stream(file_path);
98 if (!input_stream.good())
106 YAML::Node doc = YAML::Load(input_stream);
109 for (YAML::const_iterator group_it = doc.begin(); group_it != doc.end(); ++group_it)
111 const std::string& group_name = group_it->first.as<std::string>();
112 const YAML::Node&
group = group_it->second;
119 DEFAULT_KIN_SOLVER_SEARCH_RESOLUTION);
121 DEFAULT_KIN_SOLVER_TIMEOUT);
129 catch (YAML::ParserException& e)
140 emitter << YAML::BeginMap;
145 const std::string& group_name = meta_pair.first;
152 emitter << YAML::Key << group_name;
153 emitter << YAML::Value << YAML::BeginMap;
156 emitter << YAML::Key <<
"kinematics_solver";
160 emitter << YAML::Key <<
"kinematics_solver_search_resolution";
164 emitter << YAML::Key <<
"kinematics_solver_timeout";
167 emitter << YAML::EndMap;
170 emitter << YAML::EndMap;
180 std::string kinematics_parameters_files_block;
183 if (groups.second.kinematics_parameters_file_.empty())
187 if (!kinematics_parameters_files_block.empty())
188 kinematics_parameters_files_block +=
"\n";
190 std::string line =
" <rosparam command=\"load\" ns=\"" + groups.first +
"\" file=\"" +
191 groups.second.kinematics_parameters_file_ +
"\"/>";
192 kinematics_parameters_files_block += line;
194 variables.push_back(
TemplateVariable(
"KINEMATICS_PARAMETERS_FILE_NAMES_BLOCK", kinematics_parameters_files_block));
200 #include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(cached_ik_kinematics_plugin::CachedIKKinematicsPlugin< kdl_kinematics_plugin::KDLKinematicsPlugin >, kinematics::KinematicsBase)
where all the data for each part of the configuration is stored.
bool getYamlProperty(const YAML::Node &node, const std::string &key, T &storage, const T &default_value=T())
Simple Key/value pair for templates.