Go to the documentation of this file.
35 #ifndef XML_TESTDATA_LOADER_H
36 #define XML_TESTDATA_LOADER_H
44 #include <boost/property_tree/ptree.hpp>
48 namespace pt = boost::property_tree;
120 class XmlTestdataLoader :
public TestdataLoader
124 XmlTestdataLoader(
const std::string& path_filename,
const moveit::core::RobotModelConstPtr& robot_model);
128 JointConfiguration
getJoints(
const std::string& pos_name,
const std::string& group_name)
const override;
130 CartesianConfiguration
getPose(
const std::string& pos_name,
const std::string& group_name)
const override;
145 Sequence
getSequence(
const std::string& cmd_name)
const override;
147 Gripper
getGripper(
const std::string& cmd_name)
const override;
157 const pt::ptree::value_type&
findNodeWithName(
const boost::property_tree::ptree& tree,
const std::string& name,
158 const std::string& key,
const std::string& path =
"")
const;
163 const pt::ptree::value_type&
findCmd(
const std::string& cmd_name,
const std::string& cmd_path,
164 const std::string& cmd_key)
const;
171 JointConfiguration
getJoints(
const boost::property_tree::ptree& joints_tree,
const std::string& group_name)
const;
177 inline static std::vector<double>
strVec2doubleVec(std::vector<std::string>& strVec);
185 class AbstractCmdGetterAdapter
212 std::vector<double>
vec;
214 vec.resize(strVec.size());
215 std::transform(strVec.begin(), strVec.end(),
vec.begin(), [](
const std::string& val) { return std::stod(val); });
223 #endif // XML_TESTDATA_LOADER_H
Circ< CartesianConfiguration, CartesianCenter, CartesianConfiguration > CircCenterCart
std::map< std::string, AbstractCmdGetterUPtr > cmd_getter_funcs_
CircCenterCart getCircCartCenterCart(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
Circ< JointConfiguration, CartesianInterim, JointConfiguration > CircJointInterimCart
std::unique_ptr< AbstractCmdGetterAdapter > AbstractCmdGetterUPtr
Gripper getGripper(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
const pt::ptree empty_tree_
Sequence getSequence(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
Ptp< JointConfiguration, JointConfiguration > PtpJoint
const pt::ptree::value_type empty_value_type_
virtual CmdVariant getCmd(const std::string &) const =0
PtpCart getPtpCart(const std::string &cmd_name) const override
Lin< CartesianConfiguration, CartesianConfiguration > LinCart
JointConfiguration getJoints(const std::string &pos_name, const std::string &group_name) const override
CircJointInterimCart getCircJointInterimCart(const std::string &cmd_name) const override
Interim< CartesianConfiguration, CartesianPathConstraintsBuilder > CartesianInterim
std::unique_ptr< TestdataLoader > XmlTestDataLoaderUPtr
LinJointCart getLinJointCart(const std::string &cmd_name) const override
static std::vector< double > strVec2doubleVec(std::vector< std::string > &strVec)
Converts string vector to double vector.
const pt::ptree::value_type & findNodeWithName(const boost::property_tree::ptree &tree, const std::string &name, const std::string &key, const std::string &path="") const
Use this function to search for a node (like an pos or cmd) with a given name.
boost::variant< PtpJoint, PtpJointCart, PtpCart, LinJoint, LinCart, CircCenterCart, CircInterimCart, CircJointCenterCart, CircJointInterimCart, Gripper > CmdVariant
Lin< JointConfiguration, JointConfiguration > LinJoint
Ptp< JointConfiguration, CartesianConfiguration > PtpJointCart
CircJointCenterCart getCircJointCenterCart(const std::string &cmd_name) const override
const pt::ptree::value_type & findCmd(const std::string &cmd_name, const std::string &cmd_path, const std::string &cmd_key) const
Use this function to search for a cmd-node with a given name.
XmlTestdataLoader(const std::string &path_filename)
Center< CartesianConfiguration, CartesianPathConstraintsBuilder > CartesianCenter
~XmlTestdataLoader() override
PtpJointCart getPtpJointCart(const std::string &cmd_name) const override
CartesianConfiguration getPose(const std::string &pos_name, const std::string &group_name) const override
Circ< JointConfiguration, CartesianCenter, JointConfiguration > CircJointCenterCart
std::string path_filename_
PtpJoint getPtpJoint(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
CartesianCenter getCartesianCenter(const std::string &cmd_name, const std::string &planning_group) const
Circ< CartesianConfiguration, CartesianInterim, CartesianConfiguration > CircInterimCart
virtual ~AbstractCmdGetterAdapter()=default
CartesianInterim getCartesianInterim(const std::string &cmd_name, const std::string &planning_group) const
Ptp< CartesianConfiguration, CartesianConfiguration > PtpCart
Lin< JointConfiguration, CartesianConfiguration > LinJointCart
CircInterimCart getCircCartInterimCart(const std::string &cmd_name) const override
LinCart getLinCart(const std::string &cmd_name) const override
LinJoint getLinJoint(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.