#include <ROS2SensorComponentBase.h>
Inherits AZ::Component.
|
static void | Reflect (AZ::ReflectContext *context) |
|
static void | GetRequiredServices (AZ::ComponentDescriptor::DependencyArrayType &required) |
|
|
void | StartSensor (float sensorFrequency, typename EventSourceT::AdaptedCallbackType adaptedCallback, typename EventSourceT::SourceCallbackType sourceCallback=nullptr) |
|
void | StopSensor () |
| Stops sensor and disconnects event callbacks passed through RSO2::ROS2SensorComponentBase::StartSensor.
|
|
AZStd::string | GetNamespace () const |
| Returns a complete namespace for this sensor topics and frame ids.
|
|
AZStd::string | GetFrameID () const |
| Returns this sensor frame ID. The ID contains namespace.
|
|
|
SensorConfiguration | m_sensorConfiguration |
| Basic sensor configuration.
|
|
EventSourceAdapter< EventSourceT > | m_eventSourceAdapter |
| Adapter for selected event source (see this class documentation).
|
|
EventSourceT::SourceEventHandlerType | m_sourceEventHandler |
| Handler for source event. Requires manual assignment and connecting to source event in derived class.
|
|
EventSourceT::AdaptedEventHandlerType | m_adaptedEventHandler |
| Handler for adapted event. Requires manual assignment and connecting to adapted event in derived class.
|
|
template<class EventSourceT>
class ROS2::ROS2SensorComponentBase< EventSourceT >
Base sensor component class for all specific sensor implementations. Developer working on the new sensor should derive from this class, defining necessary event source type (EventSourceT template parameter). Available sources are e.g. TickBasedSource or PhysicsBasedSource. Chosen event source is wrapped into EventSourceAdapter, making it possible to work with specific frequency. Derived implementation should call ROS2::ROS2SensorComponentBase::StartSensor at the end of Activate (or whenever sensor configuration is already set up) and StopSensor in Deactivate. Starting sensor base requires passing two parameters:
- sensor working frequency - how often sensor logic should be processed,
- adapted event callback - what should be done in sensor logic processing. Optionally, user can pass third parameter, which is source event callback - this will be called with source event frequency (check chosen event source implementation).
- See also
- ROS2::TickBasedSource
-
ROS2::PhysicsBasedSource
◆ StartSensor()
template<class EventSourceT >
void ROS2::ROS2SensorComponentBase< EventSourceT >::StartSensor |
( |
float |
sensorFrequency, |
|
|
typename EventSourceT::AdaptedCallbackType |
adaptedCallback, |
|
|
typename EventSourceT::SourceCallbackType |
sourceCallback = nullptr |
|
) |
| |
|
inlineprotected |
Starts sensor with passed frequency and adapted event callback. Optionally, user can pass source event callback, that will be called with event source frequency.
- Parameters
-
sensorFrequency | Sensor working frequency. |
adaptedCallback | Adapted event callback - called with sensor working frequency. |
sourceCallback | Source event callback - called with event source frequency. |
The documentation for this class was generated from the following file:
- Gems/ROS2/Code/Include/ROS2/Sensor/ROS2SensorComponentBase.h