|
SMACC2
|
#include <smacc_signal_detector.hpp>

Public Member Functions | |
| SignalDetector (SmaccFifoScheduler *scheduler, ExecutionModel executionModel=ExecutionModel::SINGLE_THREAD_SPINNER) | |
| void | initialize (ISmaccStateMachine *stateMachine) |
| void | setProcessorHandle (SmaccFifoScheduler::processor_handle processorHandle) |
| void | runThread () |
| void | join () |
| void | stop () |
| void | terminateScheduler () |
| void | joinAsyncClientBehaviorThreads () |
| void | pollingLoop () |
| template<typename EventType > | |
| void | postEvent (EventType *ev) |
| void | queueWorkItem (const SmaccFifoWorker::work_item &item) |
| rclcpp::Node::SharedPtr | getNode () |
| rclcpp::Logger | getLogger () |
| void | notifyStateConfigured (ISmaccState *currentState) |
| void | notifyStateExited (ISmaccState *currentState) |
| void | notifyStateInitializationFailed () |
| void | notifyRosInitialized () |
Private Member Functions | |
| void | pollOnce () |
| void | findUpdatableClientsAndComponents () |
| void | findUpdatableStateElements (ISmaccState *currentState) |
Private Attributes | |
| ISmaccStateMachine * | smaccStateMachine_ = nullptr |
| std::vector< ISmaccUpdatable * > | updatableClients_ |
| std::vector< std::vector< ISmaccUpdatable * > > | updatableStateElements_ |
| double | loop_rate_hz = kDefaultLoopRateHz |
| std::atomic< bool > | end_ {false} |
| std::atomic< bool > | initialized_ {false} |
| std::atomic< bool > | rosInitialized_ {false} |
| rclcpp::Publisher< smacc2_msgs::msg::SmaccStatus >::SharedPtr | statusPub_ |
| SmaccFifoScheduler * | scheduler_ |
| SmaccFifoScheduler::processor_handle | processorHandle_ |
| boost::thread | signalDetectorThread_ |
| ExecutionModel | executionModel_ |
Static Private Attributes | |
| static constexpr double | kDefaultLoopRateHz = 20.0 |
| static constexpr double | kInitializationPollRateHz = 20.0 |
Definition at line 38 of file smacc_signal_detector.hpp.
| smacc2::SignalDetector::SignalDetector | ( | SmaccFifoScheduler * | scheduler, |
| ExecutionModel | executionModel = ExecutionModel::SINGLE_THREAD_SPINNER ) |
Definition at line 45 of file signal_detector.cpp.
|
private |
findUpdatableClientsAndComponents()
Definition at line 85 of file signal_detector.cpp.
References smacc2::introspection::demangleType(), getLogger(), smacc2::ISmaccStateMachine::getOrthogonals(), smaccStateMachine_, and updatableClients_.
Referenced by initialize(), and pollOnce().


|
private |
Definition at line 128 of file signal_detector.cpp.
References smacc2::introspection::demangleType(), smacc2::ISmaccState::getEventGenerators(), getLogger(), smacc2::ISmaccStateMachine::getOrthogonals(), smacc2::ISmaccState::getStateReactors(), smaccStateMachine_, and updatableStateElements_.
Referenced by notifyStateConfigured().


|
inline |
Definition at line 78 of file smacc_signal_detector.hpp.
References getNode().
Referenced by findUpdatableClientsAndComponents(), findUpdatableStateElements(), notifyRosInitialized(), pollingLoop(), pollOnce(), and terminateScheduler().


| rclcpp::Node::SharedPtr smacc2::SignalDetector::getNode | ( | ) |
Definition at line 50 of file signal_detector.cpp.
References smacc2::ISmaccStateMachine::getNode(), and smaccStateMachine_.
Referenced by getLogger(), initialize(), pollingLoop(), and pollOnce().


| void smacc2::SignalDetector::initialize | ( | ISmaccStateMachine * | stateMachine | ) |
Definition at line 57 of file signal_detector.cpp.
References findUpdatableClientsAndComponents(), getNode(), initialized_, kDefaultLoopRateHz, smaccStateMachine_, stop(), and terminateScheduler().
Referenced by smacc2::ISmaccStateMachine::ISmaccStateMachine().


| void smacc2::SignalDetector::join | ( | ) |
Definition at line 243 of file signal_detector.cpp.
References signalDetectorThread_.
| void smacc2::SignalDetector::joinAsyncClientBehaviorThreads | ( | ) |
joinAsyncClientBehaviorThreads()
Definition at line 257 of file signal_detector.cpp.
References smacc2::ISmaccStateMachine::joinAsyncClientBehaviorThreads(), and smaccStateMachine_.
Referenced by smacc2::run().


| void smacc2::SignalDetector::notifyRosInitialized | ( | ) |
Definition at line 212 of file signal_detector.cpp.
References getLogger(), and rosInitialized_.
Referenced by smacc2::ISmaccStateMachine::initializeROS().


| void smacc2::SignalDetector::notifyStateConfigured | ( | ISmaccState * | currentState | ) |
Updateable State Notifications
Definition at line 192 of file signal_detector.cpp.
References findUpdatableStateElements().
Referenced by smacc2::ISmaccStateMachine::notifyOnRuntimeConfigurationFinished().


| void smacc2::SignalDetector::notifyStateExited | ( | ISmaccState * | currentState | ) |
Definition at line 197 of file signal_detector.cpp.
References updatableStateElements_.
Referenced by smacc2::ISmaccStateMachine::notifyOnStateExited().

| void smacc2::SignalDetector::notifyStateInitializationFailed | ( | ) |
Definition at line 202 of file signal_detector.cpp.
References updatableStateElements_.
Referenced by smacc2::ISmaccStateMachine::notifyOnStateEntryEnd().

| void smacc2::SignalDetector::pollingLoop | ( | ) |
Definition at line 390 of file signal_detector.cpp.
References end_, executionModel_, getLogger(), getNode(), initialized_, kDefaultLoopRateHz, kInitializationPollRateHz, loop_rate_hz, pollOnce(), rosInitialized_, smacc2::SINGLE_THREAD_SPINNER, and smacc2::sleepUnlessShutdown().
Referenced by smacc2::run(), and runThread().


|
private |
Definition at line 284 of file signal_detector.cpp.
References smacc2::introspection::demangleType(), findUpdatableClientsAndComponents(), getLogger(), smacc2::ISmaccStateMachine::getNode(), getNode(), smacc2::ISmaccStateMachine::m_mutex_, smacc2_state_update_end, smacc2_state_update_start, smaccStateMachine_, smacc2::STATE_CONFIGURING, smacc2::STATE_ENTERING, smacc2::STATE_EXITING, smacc2::STATE_MACHINE_INITIALIZING, smacc2::ISmaccStateMachine::stateMachineCurrentAction, smacc2::TRANSITIONING, updatableClients_, and updatableStateElements_.
Referenced by pollingLoop().


|
inline |
Definition at line 65 of file smacc_signal_detector.hpp.
References processorHandle_, and scheduler_.
Referenced by smacc2::ISmaccStateMachine::postEvent().

|
inline |
Definition at line 72 of file smacc_signal_detector.hpp.
References scheduler_.
Referenced by smacc2::ISmaccStateMachine::postEvent().

| void smacc2::SignalDetector::runThread | ( | ) |
Definition at line 233 of file signal_detector.cpp.
References pollingLoop(), and signalDetectorThread_.

| void smacc2::SignalDetector::setProcessorHandle | ( | SmaccFifoScheduler::processor_handle | processorHandle | ) |
Definition at line 223 of file signal_detector.cpp.
References processorHandle_.
Referenced by smacc2::run().

| void smacc2::SignalDetector::stop | ( | ) |
Definition at line 250 of file signal_detector.cpp.
References end_.
Referenced by initialize().

| void smacc2::SignalDetector::terminateScheduler | ( | ) |
Definition at line 270 of file signal_detector.cpp.
References getLogger(), and scheduler_.
Referenced by initialize(), and smacc2::run().


|
private |
Definition at line 112 of file smacc_signal_detector.hpp.
Referenced by pollingLoop(), and stop().
|
private |
Definition at line 129 of file smacc_signal_detector.hpp.
Referenced by pollingLoop().
|
private |
Definition at line 114 of file smacc_signal_detector.hpp.
Referenced by initialize(), and pollingLoop().
|
staticconstexprprivate |
Definition at line 105 of file smacc_signal_detector.hpp.
Referenced by initialize(), and pollingLoop().
|
staticconstexprprivate |
Definition at line 107 of file smacc_signal_detector.hpp.
Referenced by pollingLoop().
|
private |
Definition at line 110 of file smacc_signal_detector.hpp.
Referenced by pollingLoop().
|
private |
Definition at line 125 of file smacc_signal_detector.hpp.
Referenced by postEvent(), and setProcessorHandle().
|
private |
Definition at line 117 of file smacc_signal_detector.hpp.
Referenced by notifyRosInitialized(), and pollingLoop().
|
private |
Definition at line 123 of file smacc_signal_detector.hpp.
Referenced by postEvent(), queueWorkItem(), and terminateScheduler().
|
private |
Definition at line 127 of file smacc_signal_detector.hpp.
Referenced by join(), and runThread().
|
private |
Definition at line 94 of file smacc_signal_detector.hpp.
Referenced by findUpdatableClientsAndComponents(), findUpdatableStateElements(), getNode(), initialize(), joinAsyncClientBehaviorThreads(), and pollOnce().
|
private |
Definition at line 119 of file smacc_signal_detector.hpp.
|
private |
Definition at line 96 of file smacc_signal_detector.hpp.
Referenced by findUpdatableClientsAndComponents(), and pollOnce().
|
private |
Definition at line 98 of file smacc_signal_detector.hpp.
Referenced by findUpdatableStateElements(), notifyStateExited(), notifyStateInitializationFailed(), and pollOnce().