Public Member Functions | Static Public Attributes

JAUS::GlobalWaypointDriver Class Reference

The Global Waypoint Driver allows for the driving of platform to a target waypoint. More...

#include <globalwaypointdriver.h>

Inheritance diagram for JAUS::GlobalWaypointDriver:
JAUS::Management::Child JAUS::AccessControl::Child JAUS::Events::Child JAUS::Service

List of all members.

Public Member Functions

 GlobalWaypointDriver ()
 Constructor.
virtual ~GlobalWaypointDriver ()
 Destructor.
virtual MessageGenerateDriveCommand (const Byte status)=0
virtual MessageGenerateIdleDriveCommand (const Byte status) const =0
virtual bool IsWaypointAchieved (const GlobalPose &currentPose, const JAUS::SetGlobalWaypoint &desiredWaypoint) const =0
virtual void WaypointDriverUpdateEvent (const unsigned int timeSinceLastUpdateMs)
virtual void WaypointAchieved (const JAUS::SetGlobalWaypoint &waypoint)=0
virtual bool SetGlobalWaypoint (const JAUS::SetGlobalWaypoint *command)
 Sets the current desired destination.
virtual bool SetDesiredTravelSpeed (const JAUS::SetTravelSpeed *command)
virtual bool SetDesiredTravelSpeed (const double speed)
 Sets the current desired destination.
virtual bool SetDriverToControl (const Address &driver)
 Sets the Address of the Driver to control.
virtual JAUS::SetGlobalWaypoint GetGlobalWaypoint () const
 Returns the current Global Waypoint command received.
virtual GlobalPose GetGlobalPose () const
 Returns the current Global Pose reported by the Global Pose sensor.
virtual VelocityState GetVelocityState () const
 Returns the current Velocity State reported by the Velocity State sensor.
virtual JAUS::SetTravelSpeed GetDesiredTravelSpeed () const
 Returns the desired Travel Speed command received.
virtual Time GetGlobalWaypointTime () const
virtual Time GetTravelSpeedTime () const
virtual Address GetControlledDriverID () const
virtual bool GenerateEvent (const Events::Subscription &info) const
 Generates an event for the given information.
virtual bool IsEventSupported (const Events::Type type, const double requestedPeriodicRate, const Message *queryMessage, double &confirmedPeriodicRate, std::string &errorMessage) const
 Checks if the event is supported by the Service.
virtual bool IsDiscoverable () const
virtual void Receive (const Message *message)
 Processes message received by the Service. If not supported, then message is passed to inheriting services depending on what type of control has been established for the component.
virtual MessageCreateMessage (const UShort messageCode) const
 Attempts to create the message desired. Only message supported by this Service can be created by this Service.
virtual void PrintStatus () const
 Prints the status of the Global Waypoint Driver.
virtual bool Resume ()
 Method called when transitioning to a resume state. Confirms subscription to Sensors, and control of Driver.
virtual bool Reset ()
 // Method called to transition due to reset. Release Control of Driver, clear all data.
virtual bool Standby ()
 Method called when transitioning to a standby state. Release Control of the Driver and remove subscriptions if any.
virtual bool SetEmergency ()
 Method called when transitioning to an emergency state. Try to send a Idle command to the controlled Driver. Afterwards, Release control of the Driver and remove subscriptions if any.
virtual bool ClearEmergency ()
 Method called when leaving the emergency state, try to resume the the Waypoint if any.
virtual bool ReleaseControl ()
 Method called when control is released. Does not stop operatoin of driver.

Static Public Attributes

static const std::string Name = "urn:jaus:jss:mobility:GlobalWaypointDriver"
 String name of the Service.

Detailed Description

The Global Waypoint Driver allows for the driving of platform to a target waypoint.

single target waypoint, desired travel speed, current platform pose and current velocity state. A single waypoint is provided via the Set Global Waypoint message. The waypoint remains unchanged until a new Set Global Waypoint message is received. A waypoint consists of the desired position and orientation of the platform. The second input consists of the desired travel speed. The travel speed remains unchanged unless a new Set Travel Speed Message is received. The travel speed may then be changed at any time during waypoint navigation. The travel speed is reset to zero for all transitions from the Ready State.

This implmentation of this service requires at a minimum a Global Pose and Velocity State sensor service on the same component that this service belongs to. The sensor services can be synchronizing versions of the services also (see example_synchronize.cpp for how to do this).

Definition at line 81 of file globalwaypointdriver.h.


Constructor & Destructor Documentation

GlobalWaypointDriver::GlobalWaypointDriver (  )

Constructor.

Definition at line 55 of file globalwaypointdriver.cpp.

GlobalWaypointDriver::~GlobalWaypointDriver (  ) [virtual]

Destructor.

Definition at line 70 of file globalwaypointdriver.cpp.


Member Function Documentation

bool GlobalWaypointDriver::ClearEmergency (  ) [virtual]

Method called when leaving the emergency state, try to resume the the Waypoint if any.

Reimplemented from JAUS::Management::Child.

Definition at line 529 of file globalwaypointdriver.cpp.

Message * GlobalWaypointDriver::CreateMessage ( const UShort  messageCode ) const [virtual]

Attempts to create the message desired. Only message supported by this Service can be created by this Service.

Parameters:
[in]messageCodeMessage to create.
Returns:
Pointer to newly allocated Message data, NULL if message is not supported by the Service.

Implements JAUS::Service.

Definition at line 392 of file globalwaypointdriver.cpp.

virtual Message* JAUS::GlobalWaypointDriver::GenerateDriveCommand ( const Byte  status ) [pure virtual]
bool GlobalWaypointDriver::GenerateEvent ( const Events::Subscription info ) const [virtual]

Generates an event for the given information.

Parameters:
[in]infoThe event information (ID, Sequence #, etc.) for generation.
Returns:
True if event generated, otherwise false.

Implements JAUS::Events::Child.

Definition at line 232 of file globalwaypointdriver.cpp.

virtual Message* JAUS::GlobalWaypointDriver::GenerateIdleDriveCommand ( const Byte  status ) const [pure virtual]
Address GlobalWaypointDriver::GetControlledDriverID (  ) const [virtual]
Returns:
The address of the Driver being controlled.

Definition at line 216 of file globalwaypointdriver.cpp.

SetTravelSpeed GlobalWaypointDriver::GetDesiredTravelSpeed (  ) const [virtual]

Returns the desired Travel Speed command received.

Returns:
The desired Travel Speed as a SetTravelSpeed message.

Definition at line 178 of file globalwaypointdriver.cpp.

GlobalPose GlobalWaypointDriver::GetGlobalPose (  ) const [virtual]

Returns the current Global Pose reported by the Global Pose sensor.

Returns:
The current Global Pose as a ReportGlobalPose message.

Definition at line 149 of file globalwaypointdriver.cpp.

SetGlobalWaypoint GlobalWaypointDriver::GetGlobalWaypoint (  ) const [virtual]

Returns the current Global Waypoint command received.

Returns:
The current Global Waypoint as a SetGlobalWaypoint message.

Definition at line 135 of file globalwaypointdriver.cpp.

Time GlobalWaypointDriver::GetGlobalWaypointTime (  ) const [virtual]
Returns:
The time (UTC seconds) that a Set Global Waypoint command was received.

Definition at line 191 of file globalwaypointdriver.cpp.

Time GlobalWaypointDriver::GetTravelSpeedTime (  ) const [virtual]
Returns:
The time (UTC seconds) that a Set Travel Speed command was received.

Definition at line 204 of file globalwaypointdriver.cpp.

VelocityState GlobalWaypointDriver::GetVelocityState (  ) const [virtual]

Returns the current Velocity State reported by the Velocity State sensor.

Returns:
The current Velocity State as a ReportVelocityState message.

Definition at line 164 of file globalwaypointdriver.cpp.

virtual bool JAUS::GlobalWaypointDriver::IsDiscoverable (  ) const [inline, virtual]

Implements JAUS::Service.

Definition at line 129 of file globalwaypointdriver.h.

bool GlobalWaypointDriver::IsEventSupported ( const Events::Type  type,
const double  requestedPeriodicRate,
const Message queryMessage,
double &  confirmedPeriodicRate,
std::string &  errorMessage 
) const [virtual]

Checks if the event is supported by the Service.

Parameters:
[in]typeThe event type (Periodic/EveryChange).
[in]requestedPeriodicRateIf type == Periodic, then this is the desired update rate.
[in]queryMessageThe query message associated with the event.
[out]confirmedPeriodicRateThis is the confirmed periodic rate supported by the Service.
[out]errorMessageIf not supported, this is an optional error message.
Returns:
True if event supported, otherwise false.

Implements JAUS::Events::Child.

Definition at line 286 of file globalwaypointdriver.cpp.

virtual bool JAUS::GlobalWaypointDriver::IsWaypointAchieved ( const GlobalPose currentPose,
const JAUS::SetGlobalWaypoint desiredWaypoint 
) const [pure virtual]
void GlobalWaypointDriver::PrintStatus (  ) const [virtual]

Prints the status of the Global Waypoint Driver.

Reimplemented from JAUS::Service.

Definition at line 428 of file globalwaypointdriver.cpp.

void GlobalWaypointDriver::Receive ( const Message message ) [virtual]

Processes message received by the Service. If not supported, then message is passed to inheriting services depending on what type of control has been established for the component.

This Service supports GlobalWaypointDriver related messages only.

Parameters:
[in]messageMessage data to process.

Reimplemented from JAUS::Service.

Definition at line 319 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::ReleaseControl (  ) [virtual]

Method called when control is released. Does not stop operatoin of driver.

Reimplemented from JAUS::Management::Child.

Definition at line 541 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::Reset (  ) [virtual]

// Method called to transition due to reset. Release Control of Driver, clear all data.

Implements JAUS::Management::Child.

Definition at line 473 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::Resume (  ) [virtual]

Method called when transitioning to a resume state. Confirms subscription to Sensors, and control of Driver.

Implements JAUS::Management::Child.

Definition at line 461 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::SetDesiredTravelSpeed ( const double  speed ) [virtual]

Sets the current desired destination.

Parameters:
[in]speedThe desired speed of the Platform.

Definition at line 97 of file globalwaypointdriver.cpp.

virtual bool JAUS::GlobalWaypointDriver::SetDesiredTravelSpeed ( const JAUS::SetTravelSpeed command ) [inline, virtual]

Definition at line 101 of file globalwaypointdriver.h.

bool GlobalWaypointDriver::SetDriverToControl ( const Address driver ) [virtual]

Sets the Address of the Driver to control.

Returns:
False if a problem was found with the change in driver.

Definition at line 114 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::SetEmergency (  ) [virtual]

Method called when transitioning to an emergency state. Try to send a Idle command to the controlled Driver. Afterwards, Release control of the Driver and remove subscriptions if any.

Reimplemented from JAUS::Management::Child.

Definition at line 508 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::SetGlobalWaypoint ( const JAUS::SetGlobalWaypoint command ) [virtual]

Sets the current desired destination.

Definition at line 80 of file globalwaypointdriver.cpp.

bool GlobalWaypointDriver::Standby (  ) [virtual]

Method called when transitioning to a standby state. Release Control of the Driver and remove subscriptions if any.

Implements JAUS::Management::Child.

Definition at line 495 of file globalwaypointdriver.cpp.

virtual void JAUS::GlobalWaypointDriver::WaypointAchieved ( const JAUS::SetGlobalWaypoint waypoint ) [pure virtual]
virtual void JAUS::GlobalWaypointDriver::WaypointDriverUpdateEvent ( const unsigned int  timeSinceLastUpdateMs ) [inline, virtual]

Definition at line 95 of file globalwaypointdriver.h.


Member Data Documentation

const std::string GlobalWaypointDriver::Name = "urn:jaus:jss:mobility:GlobalWaypointDriver" [static]

String name of the Service.

Definition at line 84 of file globalwaypointdriver.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines