GAMS
1.2.2
|
A facade for Java platforms. More...
#include <JavaPlatform.h>
Public Member Functions | |
JavaPlatform (jobject obj, madara::knowledge::KnowledgeBase *knowledge=0, variables::Sensors *sensors=0, variables::Platforms *platforms=0, variables::Self *self=0) | |
Constructor. More... | |
~JavaPlatform () | |
Destructor. More... | |
virtual int | analyze (void) override |
Analyzes platform information. More... | |
virtual double | get_accuracy () const override |
Get the location aproximation value of what is considered close enough. More... | |
virtual const pose::ReferenceFrame & | get_frame (void) const |
Method for returning the platform's current frame. More... | |
virtual std::string | get_id () const override |
Gets the unique identifier of the platform. More... | |
jobject | get_java_instance (void) |
Returns the Java instance that derives from BasePlatform. More... | |
madara::knowledge::KnowledgeBase * | get_knowledge_base (void) const |
Gets the knowledge base. More... | |
pose::Position | get_location () const |
Gets Location of platform, within its parent frame. More... | |
virtual double | get_min_sensor_range () const |
Gets sensor radius. More... | |
virtual double | get_move_speed () const override |
Get move speed. More... | |
virtual std::string | get_name () const override |
Gets the name of the platform. More... | |
pose::Orientation | get_orientation () const |
Gets Orientation of platform, within its parent frame. More... | |
variables::PlatformStatus * | get_platform_status (void) |
Gets platform status information. More... | |
const variables::PlatformStatus * | get_platform_status (void) const |
Gets platform status information (const version) More... | |
pose::Pose | get_pose () const |
Gets Pose of platform, within its parent frame. More... | |
utility::Position * | get_position () |
Gets GPS position. More... | |
variables::Self * | get_self (void) const |
Gets self-referencing variables. More... | |
virtual const variables::Sensor & | get_sensor (const std::string &name) const |
Gets a sensor. More... | |
virtual void | get_sensor_names (variables::SensorNames &sensors) const |
Fills a list of sensor names with sensors available on the platform. More... | |
variables::Sensors * | get_sensors (void) const |
Gets the available sensor information. More... | |
virtual int | home (void) override |
Instructs the agent to return home. More... | |
virtual int | land (void) override |
Instructs the platform to land. More... | |
virtual int | move (const pose::Position &position, const PositionBounds &bounds) override |
Moves the platform to a position. More... | |
virtual int | move (const pose::Position &target) |
Moves the platform to a location. More... | |
int | move (const pose::Position &target, double epsilon) |
Moves the platform to a location. More... | |
void | operator= (const JavaPlatform &rhs) |
Assignment operator. More... | |
virtual int | orient (const pose::Orientation &axes, const OrientationBounds &bounds) override |
Rotates the platform an angle on a 3D axis. More... | |
virtual int | orient (const pose::Orientation &target) |
Rotates the platform to match a given angle. More... | |
int | orient (const pose::Orientation &target, double epsilon) |
Rotates the platform to match a given angle. More... | |
virtual void | pause_move (void) |
Pauses movement, keeps source and dest at current values. More... | |
virtual int | pose (const pose::Pose &target) |
Moves the platform to a pose (location and orientation) More... | |
virtual int | pose (const pose::Pose &target, const PoseBounds &bounds) |
Moves the platform to a pose (location and orientation) More... | |
int | pose (const pose::Pose &target, double loc_epsilon, double rot_epsilon=M_PI/16) |
Moves the platform to a pose (location and orientation) More... | |
virtual void | resume_move (void) |
Resumes movement status flags. More... | |
virtual void | resume_orientation (void) |
Resumes orientation status flags. More... | |
virtual int | sense (void) override |
Polls the sensor environment for useful information. More... | |
void | set_knowledge (madara::knowledge::KnowledgeBase *rhs) |
Sets the knowledge base to use for the platform. More... | |
virtual void | set_move_speed (const double &speed) override |
Set move speed. More... | |
virtual void | set_sensors (variables::Sensors *sensors) |
Sets the map of sensor names to sensor information. More... | |
virtual void | stop_move (void) |
Stops movement, resetting source and dest to current location. More... | |
virtual void | stop_orientation (void) |
Stops orientation, resetting source and dest angles to current angle. More... | |
virtual int | takeoff (void) override |
Instructs the platform to take off. More... | |
Protected Attributes | |
jclass | class_ |
the class of the Java object obj_ More... | |
madara::knowledge::KnowledgeBase * | knowledge_ |
provides access to variables and values More... | |
double | move_speed_ |
movement speed for platform in meters/second More... | |
jobject | obj_ |
the Java object with callable methods More... | |
variables::Self * | self_ |
provides access to self state More... | |
variables::Sensors * | sensors_ |
provides access to a sensor More... | |
variables::PlatformStatus | status_ |
provides access to status information for this platform More... | |
A facade for Java platforms.
Definition at line 76 of file JavaPlatform.h.
gams::platforms::JavaPlatform::JavaPlatform | ( | jobject | obj, |
madara::knowledge::KnowledgeBase * | knowledge = 0 , |
||
variables::Sensors * | sensors = 0 , |
||
variables::Platforms * | platforms = 0 , |
||
variables::Self * | self = 0 |
||
) |
Constructor.
obj | the Java object to call methods on |
knowledge | knowledge base |
sensors | map of sensor names to sensor information |
platforms | map of platform names to platform information |
self | agent variables that describe self state |
gams::platforms::JavaPlatform::~JavaPlatform | ( | ) |
Destructor.
|
overridevirtual |
Analyzes platform information.
Implements gams::platforms::BasePlatform.
|
overridevirtual |
Get the location aproximation value of what is considered close enough.
Reimplemented from gams::platforms::BasePlatform.
|
virtualinherited |
Method for returning the platform's current frame.
By default, returns pose::default_frame()
|
overridevirtual |
Gets the unique identifier of the platform.
This should be an alphanumeric identifier that can be used as part of a MADARA variable (e.g. vrep_ant, autonomous_snake, etc.)
Implements gams::platforms::BasePlatform.
jobject gams::platforms::JavaPlatform::get_java_instance | ( | void | ) |
Returns the Java instance that derives from BasePlatform.
|
inherited |
Gets the knowledge base.
|
inherited |
Gets Location of platform, within its parent frame.
|
virtualinherited |
Gets sensor radius.
|
overridevirtual |
Get move speed.
Reimplemented from gams::platforms::BasePlatform.
|
overridevirtual |
Gets the name of the platform.
Implements gams::platforms::BasePlatform.
|
inherited |
Gets Orientation of platform, within its parent frame.
|
inherited |
Gets platform status information.
|
inherited |
Gets platform status information (const version)
|
inherited |
Gets Pose of platform, within its parent frame.
|
inherited |
Gets GPS position.
|
inherited |
Gets self-referencing variables.
|
virtualinherited |
Gets a sensor.
name | identifier of sensor to get |
|
virtualinherited |
Fills a list of sensor names with sensors available on the platform.
sensors | list of sensors to fill |
|
inherited |
Gets the available sensor information.
|
overridevirtual |
Instructs the agent to return home.
Reimplemented from gams::platforms::BasePlatform.
|
overridevirtual |
Instructs the platform to land.
Reimplemented from gams::platforms::BasePlatform.
|
overridevirtual |
Moves the platform to a position.
position | the coordinate to move to |
proximity | minimum required distance between current and target before exiting |
Reimplemented from gams::platforms::BasePlatform.
|
inlinevirtualinherited |
Moves the platform to a location.
location | the coordinates to move to |
Definition at line 308 of file BasePlatform.h.
|
inlineinherited |
Moves the platform to a location.
location | the coordinates to move to |
epsilon | approximation value |
Definition at line 327 of file BasePlatform.h.
void gams::platforms::JavaPlatform::operator= | ( | const JavaPlatform & | rhs | ) |
Assignment operator.
rhs | values to copy |
|
overridevirtual |
Rotates the platform an angle on a 3D axis.
axes | the coordinates to move to |
Reimplemented from gams::platforms::BasePlatform.
|
inlinevirtualinherited |
Rotates the platform to match a given angle.
target | the orientation to move to |
Definition at line 336 of file BasePlatform.h.
|
inlineinherited |
Rotates the platform to match a given angle.
target | the orientation to move to |
epsilon | approximation value |
Definition at line 355 of file BasePlatform.h.
|
virtualinherited |
Pauses movement, keeps source and dest at current values.
|
inlinevirtualinherited |
Moves the platform to a pose (location and orientation)
This default implementation calls move and orient with the Location and Orientation portions of the target Pose. The return value is composed as follows: if either call returns ERROR (0), this call also returns ERROR (0). Otherwise, if BOTH calls return ARRIVED (2), this call also returns ARRIVED (2). Otherwise, this call returns MOVING (1)
Overrides might function differently.
target | the coordinates to move to |
Definition at line 374 of file BasePlatform.h.
|
virtualinherited |
Moves the platform to a pose (location and orientation)
This default implementation calls move and orient with the Location and Orientation portions of the target Pose. The return value is composed as follows: if either call returns ERROR (0), this call also returns ERROR (0). Otherwise, if BOTH calls return ARRIVED (2), this call also returns ARRIVED (2). Otherwise, this call returns MOVING (1)
Overrides might function differently.
target | the coordinates to move to |
bounds | object to compute if platform has arrived |
|
inlineinherited |
Moves the platform to a pose (location and orientation)
This default implementation calls move and orient with the Location and Orientation portions of the target Pose. The return value is composed as follows: if either call returns ERROR (0), this call also returns ERROR (0). Otherwise, if BOTH calls return ARRIVED (2), this call also returns ARRIVED (2). Otherwise, this call returns MOVING (1)
Overrides might function differently.
target | the coordinates to move to |
loc_epsilon | approximation value for the location |
rot_epsilon | approximation value for the orientation |
Definition at line 413 of file BasePlatform.h.
|
virtualinherited |
Resumes movement status flags.
|
virtualinherited |
Resumes orientation status flags.
|
overridevirtual |
Polls the sensor environment for useful information.
Implements gams::platforms::BasePlatform.
|
inherited |
Sets the knowledge base to use for the platform.
rhs | the new knowledge base to use |
|
overridevirtual |
Set move speed.
speed | new speed in meters/loop execution |
Reimplemented from gams::platforms::BasePlatform.
|
virtualinherited |
Sets the map of sensor names to sensor information.
sensors | map of sensor names to sensor information |
|
virtualinherited |
Stops movement, resetting source and dest to current location.
|
virtualinherited |
Stops orientation, resetting source and dest angles to current angle.
|
overridevirtual |
Instructs the platform to take off.
Reimplemented from gams::platforms::BasePlatform.
|
protected |
the class of the Java object obj_
Definition at line 199 of file JavaPlatform.h.
|
protectedinherited |
provides access to variables and values
Definition at line 517 of file BasePlatform.h.
|
protectedinherited |
movement speed for platform in meters/second
Definition at line 514 of file BasePlatform.h.
|
protected |
the Java object with callable methods
Definition at line 196 of file JavaPlatform.h.
|
protectedinherited |
provides access to self state
Definition at line 520 of file BasePlatform.h.
|
protectedinherited |
provides access to a sensor
Definition at line 523 of file BasePlatform.h.
|
protectedinherited |
provides access to status information for this platform
Definition at line 526 of file BasePlatform.h.