Class Source
Defined in File source.hpp
Inheritance Relationships
Derived Types
public nav2_collision_monitor::PointCloud
(Class PointCloud)public nav2_collision_monitor::PolygonSource
(Class PolygonSource)public nav2_collision_monitor::Range
(Class Range)public nav2_collision_monitor::Scan
(Class Scan)
Class Documentation
Basic data source class.
Subclassed by nav2_collision_monitor::PointCloud, nav2_collision_monitor::PolygonSource, nav2_collision_monitor::Range, nav2_collision_monitor::Scan
Public Functions
Source constructor.
- Parameters:
node – Collision Monitor node pointer
source_name – Name of data source
tf_buffer – Shared pointer to a TF buffer
base_frame_id – Robot base frame ID. The output data will be transformed into this frame.
global_frame_id – Global frame ID for correct transform calculation
transform_tolerance – Transform tolerance
source_timeout – Maximum time interval in which data is considered valid
base_shift_correction – Whether to correct source data towards to base frame movement, considering the difference between current time and latest source time
Source destructor.
Adds latest data from source to the data array. Empty virtual method intended to be used in child implementations.
- Parameters:
curr_time – Current node time for data interpolation
data – Array where the data from source to be added. Added data is transformed to base_frame_id_ coordinate system at curr_time.
- Returns:
false if an invalid source should block the robot
Obtains source enabled state.
- Returns:
Whether source is enabled
Obtains the name of the data source.
- Returns:
Name of the data source
Obtains the source_timeout parameter of the data source.
- Returns:
source_timeout parameter value of the data source
Protected Functions
Source configuration routine.
- Returns:
True in case of everything is configured correctly, or false otherwise
Supporting routine obtaining ROS-parameters common for all data sources.
- Parameters:
source_topic – Output name of source subscription topic
Checks whether the source data might be considered as valid.
- Parameters:
source_time – Timestamp of latest obtained data
curr_time – Current node time for source verification
- Returns:
True if data source is valid, otherwise false
Callback executed when a parameter change is detected.
- Parameters:
event – ParameterEvent message
Obtain the transform to get data from source frame and time where it was received to the base frame and current time (if base_shift_correction_ is true) or the transform without time shift considered which is less accurate but much more faster option not dependent on state estimation frames.
- Parameters:
curr_time – Current node time
data_header – Current header which contains the frame_id and the stamp
tf_transform – Output source->base_frame_id_ transform
- Returns:
True if got correct transform, otherwise false
Protected Attributes
Collision Monitor node.
Collision monitor node logger stored for further usage.
Dynamic parameters handler.
Name of data source.
TF buffer.
Robot base frame ID.
Global frame ID for correct transform calculation.
Transform tolerance.
Maximum time interval in which data is considered valid.
Whether to correct source data towards to base frame movement, considering the difference between current time and latest source time.
Whether source is enabled.