Service for command and control of single or multiple subsystems. More...
#include <subsystemcommand.h>
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 Discovery * | DiscoveryService () const |
Gets a pointer to the service. | |
Discovery * | DiscoveryService () |
Gets a pointer to the service. | |
const AccessControl * | AccessControlService () const |
Gets a pointer to the service. | |
AccessControl * | AccessControlService () |
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 Message * | CreateMessage (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. |
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.
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.
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.
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.
[in] | controlledComponent | The 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.
[in] | commandMessage | Command message to send. |
[in] | sendResumeFlag | If control is requested to send the command, and this is true, a Resume command is sent first. |
[in] | waitTimeMs | If control is requested, this is how long to wait for a response. |
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.
[in] | everyChange | If true, every change events are requested. |
[in] | desiredPeriodicRate | If 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.
double JAUS::SubsystemCommand::mDesiredPeriodicRateHz [protected] |
If requesting periodic events, this is the desired frequency.
Definition at line 120 of file subsystemcommand.h.
bool JAUS::SubsystemCommand::mOnChangeEventsFlag [protected] |
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.