Robowflex  v0.1
Making MoveIt Easy
cob4.h
Go to the documentation of this file.
1 /* Author: Juan D. Hernandez */
2 
3 #ifndef ROBOWFLEX_COB4_
4 #define ROBOWFLEX_COB4_
5 
8 
9 namespace robowflex
10 {
11  /** \cond IGNORE */
12  ROBOWFLEX_CLASS_FORWARD(Cob4Robot);
13  /* \endcond */
14 
15  /** \class robowflex::Cob4RobotPtr
16  \brief A shared pointer wrapper for robowflex::Cob4Robot. */
17 
18  /** \class robowflex::Cob4RobotConstPtr
19  \brief A const shared pointer wrapper for robowflex::Cob4Robot. */
20 
21  /** \brief Convenience class that describes the default setup for Care-O-Bot4.
22  * Will first attempt to load configuration and description from the robowflex_resources package.
23  * See https://github.com/KavrakiLab/robowflex_resources for this package.
24  * If this package is not available, then fetch_description / fetch_moveit_config packages will be used.
25  */
26  class Cob4Robot : public Robot
27  {
28  public:
29  /** \brief Constructor.
30  */
31  Cob4Robot();
32 
33  /** \brief Initialize the robot with arm_left and arm_right kinematics.
34  * \return True on success, false on failure.
35  */
36  bool initialize();
37 
38  /** \brief Sets the base pose of the Cob4 robot (a virtual planar joint)
39  * \param[in] x The x position.
40  * \param[in] y The y position.
41  * \param[in] theta The angle.
42  */
43  void setBasePose(double x, double y, double theta);
44 
45  /** \brief Points the Cob4's head to a point in the world frame.
46  * \param[in] point The point to look at.
47  */
48  void pointHead(const Eigen::Vector3d &point);
49 
50  /** \brief Opens the Cob4's grippers.
51  */
52  void openGrippers();
53 
54  /** \brief Opens the Cob4's left gripper.
55  */
56  void openLeftGripper();
57 
58  /** \brief Opens the Cob4's right gripper.
59  */
60  void openRightGripper();
61 
62  /** \brief Closes the Cob4's grippers.
63  */
64  void closeGrippers();
65 
66  /** \brief Closes the Cob4's left gripper.
67  */
68  void closeLeftGripper();
69 
70  /** \brief Closes the Cob4's right gripper.
71  */
72  void closeRightGripper();
73 
74  private:
75  static const std::string DEFAULT_URDF; ///< Default URDF
76  static const std::string DEFAULT_SRDF; ///< Default SRDF
77  static const std::string DEFAULT_LIMITS; ///< Default Limits
78  static const std::string DEFAULT_KINEMATICS; ///< Default kinematics
79 
80  static const std::string RESOURCE_URDF; ///< URDF from robowflex_resources
81  static const std::string RESOURCE_SRDF; ///< SRDF from robowflex_resources
82  static const std::string RESOURCE_LIMITS; ///< Limits from robowflex_resources
83  static const std::string RESOURCE_KINEMATICS; ///< kinematics from robowflex_resources
84  };
85 
86  namespace OMPL
87  {
88  /** \cond IGNORE */
90  /* \endcond */
91 
92  /** \class robowflex::OMPL::Cob4OMPLPipelinePlannerPtr
93  \brief A shared pointer wrapper for robowflex::OMPL::Cob4OMPLPipelinePlanner. */
94 
95  /** \class robowflex::OMPL::Cob4OMPLPipelinePlannerConstPtr
96  \brief A const shared pointer wrapper for robowflex::OMPL::Cob4OMPLPipelinePlanner. */
97 
98  /** \brief Convenience class for the default motion planning pipeline for Cob4.
99  */
101  {
102  public:
103  /** \brief Constructor.
104  * \param[in] robot Robot to create planner for.
105  * \param[in] name Namespace of this planner.
106  */
107  Cob4OMPLPipelinePlanner(const RobotPtr &robot, const std::string &name = "");
108 
109  /** \brief Initialize the planning context. All parameter provided are defaults.
110  * \param[in] settings Settings to set on the parameter server.
111  * \param[in] adapters Planning adapters to load.
112  * \return True on success, false on failure.
113  */
114  bool initialize(const Settings &settings = Settings(),
115  const std::vector<std::string> &adapters = DEFAULT_ADAPTERS);
116 
117  private:
118  static const std::string DEFAULT_CONFIG; ///< Default planning configuration.
119  static const std::string RESOURCE_CONFIG; ///< Planning configuration from robowflex_resources.
120  };
121  } // namespace OMPL
122 } // namespace robowflex
123 
124 #endif
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
Definition: class_forward.h:16
Convenience class that describes the default setup for Care-O-Bot4. Will first attempt to load config...
Definition: cob4.h:27
void closeLeftGripper()
Closes the Cob4's left gripper.
Definition: cob4.cpp:106
void closeGrippers()
Closes the Cob4's grippers.
Definition: cob4.cpp:98
bool initialize()
Initialize the robot with arm_left and arm_right kinematics.
Definition: cob4.cpp:36
void openLeftGripper()
Opens the Cob4's left gripper.
Definition: cob4.cpp:82
void openRightGripper()
Opens the Cob4's right gripper.
Definition: cob4.cpp:90
void setBasePose(double x, double y, double theta)
Sets the base pose of the Cob4 robot (a virtual planar joint)
Definition: cob4.cpp:122
static const std::string DEFAULT_LIMITS
Default Limits.
Definition: cob4.h:77
static const std::string DEFAULT_SRDF
Default SRDF.
Definition: cob4.h:76
static const std::string RESOURCE_URDF
URDF from robowflex_resources.
Definition: cob4.h:80
void openGrippers()
Opens the Cob4's grippers.
Definition: cob4.cpp:72
static const std::string RESOURCE_KINEMATICS
kinematics from robowflex_resources
Definition: cob4.h:83
void closeRightGripper()
Closes the Cob4's right gripper.
Definition: cob4.cpp:114
static const std::string DEFAULT_KINEMATICS
Default kinematics.
Definition: cob4.h:78
static const std::string RESOURCE_LIMITS
Limits from robowflex_resources.
Definition: cob4.h:82
Cob4Robot()
Constructor.
Definition: cob4.cpp:32
void pointHead(const Eigen::Vector3d &point)
Points the Cob4's head to a point in the world frame.
Definition: cob4.cpp:60
static const std::string DEFAULT_URDF
Default URDF.
Definition: cob4.h:75
static const std::string RESOURCE_SRDF
SRDF from robowflex_resources.
Definition: cob4.h:81
Convenience class for the default motion planning pipeline for Cob4.
Definition: cob4.h:101
bool initialize(const Settings &settings=Settings(), const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize the planning context. All parameter provided are defaults.
Definition: cob4.cpp:141
static const std::string RESOURCE_CONFIG
Planning configuration from robowflex_resources.
Definition: cob4.h:119
Cob4OMPLPipelinePlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
Definition: cob4.cpp:136
static const std::string DEFAULT_CONFIG
Default planning configuration.
Definition: cob4.h:118
A robowflex::PipelinePlanner that uses the MoveIt! default OMPL planning pipeline.
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
Settings descriptor for settings provided by the default MoveIt! OMPL planning pipeline.
A shared pointer wrapper for robowflex::Robot.
Loads information about a robot and maintains information about a robot's state.
Functions for loading and animating robots in Blender.
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25