Robowflex  v0.1
Making MoveIt Easy
io/yaml.h
Go to the documentation of this file.
1 /* Author: Zachary Kingston */
2 
3 #ifndef ROBOWFLEX_IO_YAML_
4 #define ROBOWFLEX_IO_YAML_
5 
6 #include <geometry_msgs/Pose.h>
7 
8 #include <moveit_msgs/PlanningScene.h>
9 #include <moveit_msgs/MotionPlanRequest.h>
10 #include <moveit_msgs/RobotTrajectory.h>
11 
12 #include <yaml-cpp/yaml.h>
13 
14 namespace robowflex
15 {
16  namespace IO
17  {
18  /** \brief Checks if a key exists within a YAML node.
19  * \param[in] node Node to check.
20  * \return True if the node exists and is not null.
21  */
22  bool isNode(const YAML::Node &node);
23 
24  /** \brief Converts a robot state YAML to a robot_state message.
25  * \param[in] node Node to convert.
26  * \return The converted message.
27  */
28  moveit_msgs::RobotState robotStateFromNode(const YAML::Node &node);
29 
30  /** \brief Converts a pose message to YAML.
31  * \param[in] msg Message to convert.
32  * \return The converted message.
33  */
34  YAML::Node toNode(const geometry_msgs::Pose &msg);
35 
36  /** \brief Converts a pose YAML to a goemetry message.
37  * \param[in] node Node to convert.
38  * \return The converted message.
39  */
40  geometry_msgs::Pose poseFromNode(const YAML::Node &node);
41 
42  /** \brief Converts a planning scene message to YAML.
43  * \param[in] msg Message to convert.
44  * \return The converted message.
45  */
46  YAML::Node toNode(const moveit_msgs::PlanningScene &msg);
47 
48  /** \brief Converts a motion plan request to YAML.
49  * \param[in] msg Message to convert.
50  * \return The converted message.
51  */
52  YAML::Node toNode(const moveit_msgs::MotionPlanRequest &msg);
53 
54  /** \brief Converts a motion plan to YAML.
55  * \param[in] msg Message to convert.
56  * \return The converted message.
57  */
58  YAML::Node toNode(const moveit_msgs::RobotTrajectory &msg);
59 
60  /** \brief Converts a robot state to YAML.
61  * \param[in] msg Message to convert.
62  * \return The converted message.
63  */
64  YAML::Node toNode(const moveit_msgs::RobotState &msg);
65 
66  /** \brief Loads a planning scene from a YAML file.
67  * \param[out] msg Message to load into.
68  * \param[in] file File to load.
69  * \return True on success, false on failure.
70  */
71  bool fromYAMLFile(moveit_msgs::PlanningScene &msg, const std::string &file);
72 
73  /** \brief Loads a motion planning request from a YAML file.
74  * \param[out] msg Message to load into.
75  * \param[in] file File to load.
76  * \return True on success, false on failure.
77  */
78  bool fromYAMLFile(moveit_msgs::MotionPlanRequest &msg, const std::string &file);
79 
80  /** \brief Loads a robot state from a YAML file.
81  * \param[out] msg Message to load into.
82  * \param[in] file File to load.
83  * \return True on success, false on failure.
84  */
85  bool fromYAMLFile(moveit_msgs::RobotState &msg, const std::string &file);
86  } // namespace IO
87 } // namespace robowflex
88 
89 #endif
bool isNode(const YAML::Node &node)
Checks if a key exists within a YAML node.
Definition: yaml.cpp:1847
bool fromYAMLFile(moveit_msgs::PlanningScene &msg, const std::string &file)
Loads a planning scene from a YAML file.
Definition: yaml.cpp:1914
moveit_msgs::RobotState robotStateFromNode(const YAML::Node &node)
Converts a robot state YAML to a robot_state message.
Definition: yaml.cpp:1869
geometry_msgs::Pose poseFromNode(const YAML::Node &node)
Converts a pose YAML to a goemetry message.
Definition: yaml.cpp:1881
YAML::Node toNode(const geometry_msgs::Pose &msg)
Converts a pose message to YAML.
Definition: yaml.cpp:1874
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25