43 #include <boost/property_tree/ptree.hpp>
47 namespace pt = boost::property_tree;
123 XmlTestdataLoader(
const std::string& path_filename,
const moveit::core::RobotModelConstPtr& robot_model);
156 const pt::ptree::value_type& findNodeWithName(
const boost::property_tree::ptree& tree,
const std::string&
name,
157 const std::string& key,
const std::string& path =
"")
const;
162 const pt::ptree::value_type& findCmd(
const std::string& cmd_name,
const std::string& cmd_path,
163 const std::string& cmd_key)
const;
165 CartesianCenter getCartesianCenter(
const std::string& cmd_name,
const std::string& planning_group)
const;
167 CartesianInterim getCartesianInterim(
const std::string& cmd_name,
const std::string& planning_group)
const;
176 inline static std::vector<double> strVec2doubleVec(std::vector<std::string>& strVec);
198 std::string path_filename_;
201 using AbstractCmdGetterUPtr = std::unique_ptr<AbstractCmdGetterAdapter>;
208 std::map<std::string, AbstractCmdGetterUPtr> cmd_getter_funcs_;
211 const pt::ptree::value_type empty_value_type_{};
212 const pt::ptree empty_tree_{};
215 std::vector<double> XmlTestdataLoader::strVec2doubleVec(std::vector<std::string>& strVec)
217 std::vector<double> vec;
219 vec.resize(strVec.size());
220 std::transform(strVec.begin(), strVec.end(), vec.begin(), [](
const std::string& val) { return std::stod(val); });
Class to define a robot configuration in space with the help of cartesian coordinates.
Class to define the center point of the circle on which the robot is supposed to move via circ comman...
Data class storing all information regarding a Circ command.
Class to define a point on the circle on which the robot is supposed to move via circ command.
Class to define a robot configuration in space with the help of joint values.
Data class storing all information regarding a linear command.
Data class storing all information regarding a Sequence command.
Abstract base class describing the interface to access test data like robot poses and robot commands.
Abstract base class providing a GENERIC getter-function signature which can be used to load DIFFERENT...
AbstractCmdGetterAdapter()=default
AbstractCmdGetterAdapter & operator=(AbstractCmdGetterAdapter &&)=default
AbstractCmdGetterAdapter(const AbstractCmdGetterAdapter &)=default
AbstractCmdGetterAdapter & operator=(const AbstractCmdGetterAdapter &)=default
virtual CmdVariant getCmd(const std::string &) const =0
AbstractCmdGetterAdapter(AbstractCmdGetterAdapter &&)=default
virtual ~AbstractCmdGetterAdapter()=default
Implements a test data loader which uses a xml file to store the test data.
CircCenterCart getCircCartCenterCart(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
JointConfiguration getJoints(const std::string &pos_name, const std::string &group_name) const override
LinJointCart getLinJointCart(const std::string &cmd_name) const override
PtpCart getPtpCart(const std::string &cmd_name) const override
CircInterimCart getCircCartInterimCart(const std::string &cmd_name) const override
~XmlTestdataLoader() override
CartesianConfiguration getPose(const std::string &pos_name, const std::string &group_name) const override
PtpJointCart getPtpJointCart(const std::string &cmd_name) const override
XmlTestdataLoader(const std::string &path_filename)
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.
CircJointCenterCart getCircJointCenterCart(const std::string &cmd_name) const override
CircJointInterimCart getCircJointInterimCart(const std::string &cmd_name) const override
Sequence getSequence(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
Gripper getGripper(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
PtpJoint getPtpJoint(const std::string &cmd_name) const override
Returns the command with the specified name from the test data.
std::variant< PtpJoint, PtpJointCart, PtpCart, LinJoint, LinCart, CircCenterCart, CircInterimCart, CircJointCenterCart, CircJointInterimCart, Gripper > CmdVariant
std::unique_ptr< TestdataLoader > XmlTestDataLoaderUPtr