Class CollisionMonitor
Defined in File collision_monitor_node.hpp
Inheritance Relationships
Base Type
public nav2_util::LifecycleNode
Class Documentation
Collision Monitor ROS2 node.
Public Functions
Constructor for the nav2_collision_safery::CollisionMonitor.
- Parameters:
options – Additional options to control creation of the node.
Destructor for the nav2_collision_safery::CollisionMonitor.
Protected Functions
: Initializes and obtains ROS-parameters, creates main subscribers and publishers, creates polygons and data sources objects
- Parameters:
state – Lifecycle Node’s state
- Returns:
Success or Failure
: Activates LifecyclePublishers, polygons and main processor, creates bond connection
- Parameters:
state – Lifecycle Node’s state
- Returns:
Success or Failure
: Deactivates LifecyclePublishers, polygons and main processor, destroys bond connection
- Parameters:
state – Lifecycle Node’s state
- Returns:
Success or Failure
: Resets all subscribers/publishers, polygons/data sources arrays
- Parameters:
state – Lifecycle Node’s state
- Returns:
Success or Failure
Called in shutdown state.
- Parameters:
state – Lifecycle Node’s state
- Returns:
Success or Failure
Callback for input cmd_vel.
- Parameters:
msg – Input cmd_vel message
Publishes output cmd_vel. If robot was stopped more than stop_pub_timeout_ seconds, quit to publish 0-velocity.
- Parameters:
robot_action – Robot action to publish
Supporting routine obtaining all ROS-parameters.
- Parameters:
cmd_vel_in_topic – Output name of cmd_vel_in topic
cmd_vel_out_topic – Output name of cmd_vel_out topic is required.
- Returns:
True if all parameters were obtained or false in failure case
Supporting routine creating and configuring all polygons.
- Parameters:
base_frame_id – Robot base frame ID
transform_tolerance – Transform tolerance
- Returns:
True if all polygons were configured successfully or false in failure case
Supporting routine creating and configuring all data sources.
- Parameters:
base_frame_id – Robot base frame ID
odom_frame_id – Odometry frame ID. Used as global frame to get source->base time inerpolated transform.
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
- Returns:
True if all sources were configured successfully or false in failure case
Main processing routine.
- Parameters:
cmd_vel_in – Input desired robot velocity
Processes the polygon of STOP, SLOWDOWN and LIMIT action type.
- Parameters:
polygon – Polygon to process
collision_points – Array of 2D obstacle points
velocity – Desired robot velocity
robot_action – Output processed robot action
- Returns:
True if returned action is caused by current polygon, otherwise false
Processes APPROACH action type.
- Parameters:
polygon – Polygon to process
collision_points – Array of 2D obstacle points
velocity – Desired robot velocity
robot_action – Output processed robot action
- Returns:
True if returned action is caused by current polygon, otherwise false
Log and publish current robot action and polygon.
- Parameters:
robot_action – Robot action to notify
action_polygon – Pointer to a polygon causing a selected action
Polygons publishing routine. Made for visualization.
Protected Attributes
TF buffer.
TF listener.
Polygons array.
Data sources array.
@beirf Input cmd_vel subscriber
Output cmd_vel publisher.
CollisionMonitor state publisher.
Whether main routine is active.
Previous robot action.
Latest timestamp when robot has 0-velocity.
Timeout after which 0-velocity ceases to be published.