GAMS  1.4.0
RosBase.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_PLATFORM_ROS_BASE_H_
55 #define _GAMS_PLATFORM_ROS_BASE_H_
56 
57 #ifdef _GAMS_ROS_
58 
59 #include "gams/variables/Self.h"
60 #include "gams/variables/Sensor.h"
63 #include "gams/pose/GPSFrame.h"
65 #include "madara/knowledge/KnowledgeBase.h"
66 
67 // ROS includes
68 #ifdef __GNUC__
69 #pragma GCC diagnostic push
70 #pragma GCC diagnostic ignored "-Wpedantic"
71 #endif
72 
73 #include "ros/ros.h"
74 #include "move_base_msgs/MoveBaseAction.h"
75 #include "actionlib/client/simple_action_client.h"
76 #include "geometry_msgs/PoseWithCovarianceStamped.h"
77 
78 #ifdef __GNUC__
79 #pragma GCC diagnostic pop
80 #endif
81 
82 namespace gams
83 {
84  namespace platforms
85  {
86  class GAMS_EXPORT RosBase : public BasePlatform
87  {
88  public:
96  RosBase (
97  madara::knowledge::KnowledgeBase * knowledge,
98  variables::Sensors * sensors,
99  variables::Self * self);
100 
105  virtual int sense (void) override;
106 
111  virtual int analyze (void) override;
112 
117  virtual double get_accuracy () const override;
118 
123  virtual int land (void) override;
124 
131  int move (const pose::Position & position,
132  const pose::PositionBounds &bounds) override;
133 
134  // inherit BasePlatform's move overloads
135  using BasePlatform::move;
136 
141  virtual void set_move_speed (const double& speed) override;
142 
147  virtual int takeoff (void) override;
148 
153  virtual const pose::ReferenceFrame & get_frame (void) const override;
154 
159  static void ros_init(const std::string& n = "robot_0");
160 
161  protected:
163  pose::ReferenceFrame * frame_;
164 
168  void wait_for_go () const;
169 
171  bool ready_;
172  }; // class RosBase
173  } // namespace platform
174 } // namespace gams
175 
176 #endif // _GAMS_ROS_
177 
178 #endif // _GAMS_PLATFORM_ROS_BASE_H_
Copyright(c) 2014 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
virtual int move(const pose::Position &target)
Moves the platform to a location.
Definition: BasePlatform.h:230
gams::pose::ReferenceFrame ReferenceFrame
Base class for Reference Frames.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
Contains all GAMS-related tools, classes and code.
Copyright (c) 2015 Carnegie Mellon University.
Copyright (c) 2015 Carnegie Mellon University.