Classes | Public Member Functions | Static Public Attributes | Protected Attributes

JAUS::SubsystemCommand Class Reference

Service for command and control of single or multiple subsystems. More...

#include <subsystemcommand.h>

Inheritance diagram for JAUS::SubsystemCommand:
JAUS::Management::Child JAUS::Discovery::Callback JAUS::AccessControl::Child JAUS::Transport::Callback JAUS::Events::Child JAUS::Service

List of all members.

Classes

class  GlobalPoseCallback
 Callback used to update Vehicle Pose information in Discovery when ReportGlobalPose message are received.

Public Member Functions

 SubsystemCommand (const Service::ID &id)
 Constructor, initializes default values.
virtual ~SubsystemCommand ()
 Destructor.
virtual void Initialize ()
 Registers a callback to get system state information from the discovery service.
void SetGlobalPoseSubscriptionType (const bool everyChange=false, const double desiredPeriodicRateHz=25)
 Sets the type of global pose subscriptions to make. Choices are every change or periodic.
virtual bool Resume ()
virtual bool Reset ()
virtual bool Standby ()
virtual bool SetEmergency ()
virtual bool ClearEmergency ()
virtual bool ReleaseControl ()
 Method called whenever control of the parent component has been released.
const DiscoveryDiscoveryService () const
 Gets a pointer to the service.
DiscoveryDiscoveryService ()
 Gets a pointer to the service.
const AccessControlAccessControlService () const
 Gets a pointer to the service.
AccessControlAccessControlService ()
 Gets a pointer to the service.
virtual bool SendCommand (const Message *commandMessage, const bool sendResumeFlag, const unsigned int waitTimeMs=Service::DefaultWaitMs)
 Sends a command, and if control is not present, it is automatically requested.
virtual void ProcessAcquisitionOfControl (const Address &controlledComponent)
 This method is called whenever the parent component (or service) establishes control of a component (or re-establishes).
virtual bool IsDiscoverable () const
virtual bool GenerateEvent (const Events::Subscription &info) const
virtual bool IsEventSupported (const Events::Type type, const double requestedPeriodicRate, const Message *queryMessage, double &confirmedPeriodicRate, std::string &errorMessage) const
virtual void Receive (const Message *message)
 Processes messages received by the component.
virtual MessageCreateMessage (const UShort messageCode) const
 Creates messages supported by the service.
virtual void CheckServiceStatus (const unsigned int timeSinceLastCheckMs)
 Checks if the service has global pose subscriptions from newly discovered vehicles.
virtual void PrintStatus () const
 Prints service status to console.

Static Public Attributes

static const std::string Name = "urn:jaus:jss:jpp:extras:SubsystemCommand"
 Name of the Service.

Protected Attributes

bool mOnChangeEventsFlag
 If true, use EveryChange events for Global Pose.
double mDesiredPeriodicRateHz
 If requesting periodic events, this is the desired frequency.

Detailed Description

Service for command and control of single or multiple subsystems.

It is up to the developer to add specific other options and capabilities to this Service. However, it does add capabilities that are most likely common for all command interfaces. For example, SubsystemCommand will collect Global Pose and state information for all discovered Mobility platforms.

Definition at line 62 of file subsystemcommand.h.


Constructor & Destructor Documentation

SubsystemCommand::SubsystemCommand ( const Service::ID id )

Constructor, initializes default values.

Definition at line 56 of file subsystemcommand.cpp.

SubsystemCommand::~SubsystemCommand (  ) [virtual]

Destructor.

Definition at line 70 of file subsystemcommand.cpp.


Member Function Documentation

const AccessControl * SubsystemCommand::AccessControlService (  ) const

Gets a pointer to the service.

Definition at line 141 of file subsystemcommand.cpp.

AccessControl * SubsystemCommand::AccessControlService (  )

Gets a pointer to the service.

Definition at line 152 of file subsystemcommand.cpp.

void SubsystemCommand::CheckServiceStatus ( const unsigned int  timeSinceLastCheckMs ) [virtual]

Checks if the service has global pose subscriptions from newly discovered vehicles.

Reimplemented from JAUS::Service.

Definition at line 223 of file subsystemcommand.cpp.

virtual bool JAUS::SubsystemCommand::ClearEmergency (  ) [inline, virtual]

Reimplemented from JAUS::Management::Child.

Definition at line 83 of file subsystemcommand.h.

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

Creates messages supported by the service.

Implements JAUS::Service.

Definition at line 198 of file subsystemcommand.cpp.

const Discovery * SubsystemCommand::DiscoveryService (  ) const

Gets a pointer to the service.

Definition at line 119 of file subsystemcommand.cpp.

Discovery * SubsystemCommand::DiscoveryService (  )

Gets a pointer to the service.

Definition at line 130 of file subsystemcommand.cpp.

virtual bool JAUS::SubsystemCommand::GenerateEvent ( const Events::Subscription info ) const [inline, virtual]

Implements JAUS::Events::Child.

Definition at line 103 of file subsystemcommand.h.

void SubsystemCommand::Initialize (  ) [virtual]

Registers a callback to get system state information from the discovery service.

Reimplemented from JAUS::Service.

Definition at line 86 of file subsystemcommand.cpp.

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

Implements JAUS::Service.

Definition at line 101 of file subsystemcommand.h.

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

Implements JAUS::Events::Child.

Definition at line 105 of file subsystemcommand.h.

void SubsystemCommand::PrintStatus (  ) const [virtual]

Prints service status to console.

Reimplemented from JAUS::Service.

Definition at line 233 of file subsystemcommand.cpp.

virtual void JAUS::SubsystemCommand::ProcessAcquisitionOfControl ( const Address controlledComponent ) [inline, virtual]

This method is called whenever the parent component (or service) establishes control of a component (or re-establishes).

Overload this method to be notified when control is established so you can send Resume commands, etc.

Parameters:
[in]controlledComponentThe ID of the component control has been acquired for.

Reimplemented from JAUS::AccessControl::Child.

Definition at line 99 of file subsystemcommand.h.

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

Processes messages received by the component.

Reimplemented from JAUS::Service.

Definition at line 188 of file subsystemcommand.cpp.

virtual bool JAUS::SubsystemCommand::ReleaseControl (  ) [inline, virtual]

Method called whenever control of the parent component has been released.

Reimplemented from JAUS::Management::Child.

Definition at line 85 of file subsystemcommand.h.

virtual bool JAUS::SubsystemCommand::Reset (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 77 of file subsystemcommand.h.

virtual bool JAUS::SubsystemCommand::Resume (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 75 of file subsystemcommand.h.

bool SubsystemCommand::SendCommand ( const Message commandMessage,
const bool  sendResumeFlag,
const unsigned int  waitTimeMs = Service::DefaultWaitMs 
) [virtual]

Sends a command, and if control is not present, it is automatically requested.

Parameters:
[in]commandMessageCommand message to send.
[in]sendResumeFlagIf control is requested to send the command, and this is true, a Resume command is sent first.
[in]waitTimeMsIf control is requested, this is how long to wait for a response.
Returns:
True if message is sent successfully.

Definition at line 172 of file subsystemcommand.cpp.

virtual bool JAUS::SubsystemCommand::SetEmergency (  ) [inline, virtual]

Reimplemented from JAUS::Management::Child.

Definition at line 81 of file subsystemcommand.h.

void SubsystemCommand::SetGlobalPoseSubscriptionType ( const bool  everyChange = false,
const double  desiredPeriodicRate = 25 
)

Sets the type of global pose subscriptions to make. Choices are every change or periodic.

This method must be called before the Component/Service is initialized.

Parameters:
[in]everyChangeIf true, every change events are requested.
[in]desiredPeriodicRateIf periodic events, this is the desired rate.

Definition at line 103 of file subsystemcommand.cpp.

virtual bool JAUS::SubsystemCommand::Standby (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 79 of file subsystemcommand.h.


Member Data Documentation

If requesting periodic events, this is the desired frequency.

Definition at line 120 of file subsystemcommand.h.

If true, use EveryChange events for Global Pose.

Definition at line 119 of file subsystemcommand.h.

const std::string SubsystemCommand::Name = "urn:jaus:jss:jpp:extras:SubsystemCommand" [static]

Name of the Service.

Definition at line 66 of file subsystemcommand.h.


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