GAMS  1.2.2
JavaPlatform.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_PLATFORM_JAVA_H_
55 #define _GAMS_PLATFORM_JAVA_H_
56 
57 #include "gams/variables/Self.h"
58 #include "gams/variables/Sensor.h"
62 #include "madara/knowledge/KnowledgeBase.h"
63 
64 #ifdef _GAMS_JAVA_
65 #include <jni.h>
66 #include "gams_jni.h"
67 #endif
68 
69 namespace gams
70 {
71  namespace platforms
72  {
77  {
78  public:
87  JavaPlatform (
88  jobject obj,
89  madara::knowledge::KnowledgeBase * knowledge = 0,
90  variables::Sensors * sensors = 0,
91  variables::Platforms * platforms = 0,
92  variables::Self * self = 0);
93 
97  ~JavaPlatform ();
98 
103  void operator= (const JavaPlatform & rhs);
104 
109  virtual int analyze (void) override;
110 
115  virtual double get_accuracy () const override;
116 
122  virtual std::string get_id () const override;
123 
127  virtual double get_move_speed () const override;
128 
132  virtual std::string get_name () const override;
133 
138  virtual int home (void) override;
139 
144  virtual int land (void) override;
145 
153  virtual int move (const pose::Position & position,
154  const PositionBounds &bounds) override;
155 
156  // inherit BasePlatform's move overloads
157  using BasePlatform::move;
158 
164  virtual int orient (const pose::Orientation & axes,
165  const OrientationBounds &bounds) override;
166 
167  // inherit BasePlatform orient overloads
168  using BasePlatform::orient;
169 
174  virtual int sense (void) override;
175 
180  virtual void set_move_speed (const double& speed) override;
181 
186  virtual int takeoff (void) override;
187 
192  jobject get_java_instance (void);
193 
194  protected:
196  jobject obj_;
197 
199  jclass class_;
200  };
201  }
202 }
203 
204 #endif // _GAMS_PLATFORM_JAVA_H_
Interface for defining a bounds checker for Orientations.
Definition: BasePlatform.h:121
jobject obj_
the Java object with callable methods
Definition: JavaPlatform.h:196
jclass class_
the class of the Java object obj_
Definition: JavaPlatform.h:199
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
The base platform for all platforms to use.
Definition: BasePlatform.h:190
Copyright (c) 2014 Carnegie Mellon University.
Copyright (c) 2014 Carnegie Mellon University.
A facade for Java platforms.
Definition: JavaPlatform.h:76
Interface for defining a bounds checker for Positions.
Definition: BasePlatform.h:109
virtual int orient(const pose::Orientation &target)
Rotates the platform to match a given angle.
Definition: BasePlatform.h:336
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
Copyright (c) 2014 Carnegie Mellon University.
std::map< std::string, PlatformStatus > Platforms
a map of sensor names to the sensor information
#define GAMS_EXPORT
Definition: GamsExport.h:20
virtual int move(const pose::Position &target)
Moves the platform to a location.
Definition: BasePlatform.h:308
Copyright (c) 2014 Carnegie Mellon University.
Copyright (c) 2014 Carnegie Mellon University.