GAMS
1.4.0
|
The base platform for all platforms to use. More...
#include <BasePlatform.h>
Public Member Functions | |
BasePlatform (madara::knowledge::KnowledgeBase *knowledge=0, variables::Sensors *sensors=0, variables::Self *self=0) | |
Constructor. More... | |
virtual | ~BasePlatform () |
Destructor. More... | |
virtual int | analyze (void)=0 |
Analyzes platform information. More... | |
virtual double | get_accuracy (void) const |
Gets the position accuracy in meters. More... | |
virtual const pose::ReferenceFrame & | get_frame (void) const |
Method for returning the platform's current frame. More... | |
virtual std::string | get_id () const =0 |
Gets the unique identifier of the platform. 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 |
Gets move speed. More... | |
virtual std::string | get_name () const =0 |
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) |
Instructs the agent to return home. More... | |
virtual int | land (void) |
Instructs the agent to land. More... | |
virtual int | move (const pose::Position &target) |
Moves the platform to a location. More... | |
virtual int | move (const pose::Position &target, const pose::PositionBounds &bounds) |
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 BasePlatform &rhs) |
Assignment operator. More... | |
virtual int | orient (const pose::Orientation &target) |
Rotates the platform to match a given angle. More... | |
virtual int | orient (const pose::Orientation &target, const pose::OrientationBounds &bounds) |
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 pose::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)=0 |
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) |
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) |
Instructs the agent to take off. More... | |
Protected Attributes | |
madara::knowledge::KnowledgeBase * | knowledge_ |
provides access to variables and values More... | |
double | move_speed_ |
movement speed for platform in meters/second 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... | |
Friends | |
class | controllers::BaseController |
class | controllers::Multicontroller |
The base platform for all platforms to use.
Definition at line 112 of file BasePlatform.h.
gams::platforms::BasePlatform::BasePlatform | ( | madara::knowledge::KnowledgeBase * | knowledge = 0 , |
variables::Sensors * | sensors = 0 , |
||
variables::Self * | self = 0 |
||
) |
Constructor.
knowledge | context containing variables and values |
sensors | map of sensor names to sensor information |
self | self referencing variables for the agent |
|
virtual |
Destructor.
|
pure virtual |
Analyzes platform information.
Implemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
virtual |
Gets the position accuracy in meters.
Reimplemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
virtual |
Method for returning the platform's current frame.
By default, returns pose::default_frame()
|
pure virtual |
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.)
Implemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
madara::knowledge::KnowledgeBase* gams::platforms::BasePlatform::get_knowledge_base | ( | void | ) | const |
Gets the knowledge base.
pose::Position gams::platforms::BasePlatform::get_location | ( | ) | const |
Gets Location of platform, within its parent frame.
|
virtual |
Gets sensor radius.
|
virtual |
Gets move speed.
Reimplemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
pure virtual |
Gets the name of the platform.
Implemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
pose::Orientation gams::platforms::BasePlatform::get_orientation | ( | ) | const |
Gets Orientation of platform, within its parent frame.
variables::PlatformStatus* gams::platforms::BasePlatform::get_platform_status | ( | void | ) |
Gets platform status information.
const variables::PlatformStatus* gams::platforms::BasePlatform::get_platform_status | ( | void | ) | const |
Gets platform status information(const version)
pose::Pose gams::platforms::BasePlatform::get_pose | ( | ) | const |
Gets Pose of platform, within its parent frame.
utility::Position* gams::platforms::BasePlatform::get_position | ( | ) |
Gets GPS position.
variables::Self* gams::platforms::BasePlatform::get_self | ( | void | ) | const |
Gets self-referencing variables.
|
virtual |
Gets a sensor.
name | identifier of sensor to get |
|
virtual |
Fills a list of sensor names with sensors available on the platform.
sensors | list of sensors to fill |
variables::Sensors* gams::platforms::BasePlatform::get_sensors | ( | void | ) | const |
Gets the available sensor information.
|
virtual |
Instructs the agent to return home.
Reimplemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
virtual |
Instructs the agent to land.
Reimplemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
inlinevirtual |
Moves the platform to a location.
location | the coordinates to move to |
Definition at line 230 of file BasePlatform.h.
|
virtual |
Moves the platform to a location.
location | the coordinates to move to |
bounds | object to compute if platform has arrived |
Reimplemented in gams::platforms::PlatformCollection, gams::platforms::NullPlatform, gams::platforms::JavaPlatform, and gams::platforms::DebugPlatform.
|
inline |
Moves the platform to a location.
location | the coordinates to move to |
epsilon | approximation value |
Definition at line 249 of file BasePlatform.h.
void gams::platforms::BasePlatform::operator= | ( | const BasePlatform & | rhs | ) |
Assignment operator.
rhs | values to copy |
|
inlinevirtual |
Rotates the platform to match a given angle.
target | the orientation to move to |
Definition at line 258 of file BasePlatform.h.
|
virtual |
Rotates the platform to match a given angle.
target | the orientation to move to |
bounds | object to compute if platform has arrived |
Reimplemented in gams::platforms::JavaPlatform.
|
inline |
Rotates the platform to match a given angle.
target | the orientation to move to |
epsilon | approximation value |
Definition at line 277 of file BasePlatform.h.
|
virtual |
Pauses movement, keeps source and dest at current values.
|
inlinevirtual |
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 296 of file BasePlatform.h.
|
virtual |
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 |
|
inline |
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 335 of file BasePlatform.h.
|
virtual |
Resumes movement status flags.
|
virtual |
Resumes orientation status flags.
|
pure virtual |
Polls the sensor environment for useful information.
Implemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
void gams::platforms::BasePlatform::set_knowledge | ( | madara::knowledge::KnowledgeBase * | rhs | ) |
Sets the knowledge base to use for the platform.
rhs | the new knowledge base to use |
|
virtual |
Set move speed.
speed | new speed in meters/second |
Reimplemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
virtual |
Sets the map of sensor names to sensor information.
sensors | map of sensor names to sensor information |
|
virtual |
Stops movement, resetting source and dest to current location.
|
virtual |
Stops orientation, resetting source and dest angles to current angle.
|
virtual |
Instructs the agent to take off.
Reimplemented in gams::platforms::NullPlatform, gams::platforms::JavaPlatform, gams::platforms::DebugPlatform, and gams::platforms::PlatformCollection.
|
friend |
Definition at line 116 of file BasePlatform.h.
|
friend |
Definition at line 117 of file BasePlatform.h.
|
protected |
provides access to variables and values
Definition at line 439 of file BasePlatform.h.
|
protected |
movement speed for platform in meters/second
Definition at line 436 of file BasePlatform.h.
|
protected |
provides access to self state
Definition at line 442 of file BasePlatform.h.
|
protected |
provides access to a sensor
Definition at line 445 of file BasePlatform.h.
|
protected |
provides access to status information for this platform
Definition at line 448 of file BasePlatform.h.