GAMS  1.4.0
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:
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 
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 pose::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 pose::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_
Copyright(c) 2014 Carnegie Mellon University.
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.
The base platform for all platforms to use.
Definition: BasePlatform.h:113
virtual int orient(const pose::Orientation &target)
Rotates the platform to match a given angle.
Definition: BasePlatform.h:258
virtual int move(const pose::Position &target)
Moves the platform to a location.
Definition: BasePlatform.h:230
A facade for Java platforms.
Definition: JavaPlatform.h:77
virtual int sense(void) override
Polls the sensor environment for useful information.
virtual double get_accuracy() const override
Get the location aproximation value of what is considered close enough.
jobject get_java_instance(void)
Returns the Java instance that derives from BasePlatform.
JavaPlatform(jobject obj, madara::knowledge::KnowledgeBase *knowledge=0, variables::Sensors *sensors=0, variables::Platforms *platforms=0, variables::Self *self=0)
Constructor.
virtual int home(void) override
Instructs the agent to return home.
virtual int land(void) override
Instructs the platform to land.
virtual void set_move_speed(const double &speed) override
Set move speed.
virtual int orient(const pose::Orientation &axes, const pose::OrientationBounds &bounds) override
Rotates the platform an angle on a 3D axis.
jobject obj_
the Java object with callable methods
Definition: JavaPlatform.h:196
virtual double get_move_speed() const override
Get move speed.
virtual std::string get_name() const override
Gets the name of the platform.
virtual int takeoff(void) override
Instructs the platform to take off.
virtual int analyze(void) override
Analyzes platform information.
jclass class_
the class of the Java object obj_
Definition: JavaPlatform.h:199
virtual std::string get_id() const override
Gets the unique identifier of the platform.
virtual int move(const pose::Position &position, const pose::PositionBounds &bounds) override
Moves the platform to a position.
Interface for defining a bounds checker for Orientations.
Definition: Epsilon.h:80
Interface for defining a bounds checker for Positions.
Definition: Epsilon.h:68
A container for self referencing information.
Definition: Self.h:70
std::map< std::string, PlatformStatus > Platforms
a map of sensor names to the sensor information
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.