#include <EventSourceAdapter.h>
|
static void | Reflect (AZ::ReflectContext *context) |
|
template<class EventSourceT>
class ROS2::EventSourceAdapter< EventSourceT >
Class adapting event source (ROS2::SensorEventSource) to configurable working frequency. This is handled via adapted event, in a similar manner like it is done in SensorEventSource. EventSourceAdapter has its internal handler that connects to SensorEventSource source event, and signals adapted event according to frequency set (ROS2::EventSourceAdapter::SetFrequency). User can connect to this event using ROS2::EventSourceAdapter::ConnectToAdaptedEvent method. This class should be used, instead of using directly a class derived from SensorEventSource, when specific working frequency is required. Following this path, user can still use source event - ROS2::EventSourceAdapter::ConnectToSourceEvent. This template has to be resolved using a class derived from SensorEventSource specialization.
- See also
- ROS2::SensorEventSource
◆ ConnectToAdaptedEvent()
template<class EventSourceT >
void ROS2::EventSourceAdapter< EventSourceT >::ConnectToAdaptedEvent |
( |
typename EventSourceT::AdaptedEventHandlerType & |
adaptedEventHandler | ) |
|
|
inline |
◆ ConnectToSourceEvent()
template<class EventSourceT >
void ROS2::EventSourceAdapter< EventSourceT >::ConnectToSourceEvent |
( |
typename EventSourceT::SourceEventHandlerType & |
sourceEventHandler | ) |
|
|
inline |
◆ SetFrequency()
template<class EventSourceT >
Sets adapter working frequency. By design, adapter will not work correctly, if this frequency will be greater than used event source frequency - e.g. adapter will be requested to work in 60Hz, when using event source working in 30Hz. In general, adapted frequency should be equal or lower than event source frequency - this is forced internally (ROS2::EventSourceAdapter::IsPublicationDeadline). Optimal (highest precision in timing events) working conditions take place when event source frequency is an integer multiple of adapted frequency.
- Parameters
-
adaptedFrequency | Adapter working frequency. When set to zero or less adapter will be assumed to work in 1Hz. |
◆ Start()
template<class EventSourceT >
◆ Stop()
template<class EventSourceT >
Stops event source adapter - stops event source and disconnects internal adapted event handler from source event. If it will be necessary, this implementation allows multiple consecutive calls of Start / Stop, however user must also investigate specific event source implementation with such case in mind.
The documentation for this class was generated from the following file:
- Gems/ROS2/Code/Include/ROS2/Sensor/Events/EventSourceAdapter.h