Trajectory Validator#
Purpose/Role#
This package provides a pluginlib-based C++ library for evaluating candidate trajectories against a configurable set of safety and traffic-rule filters. Each filter plugin receives a world-state context snapshot (ValidatorContext) and returns a feasibility verdict for a single trajectory. Trajectories rejected by any enforced plugin are removed from the output set. The library is embedded in autoware_trajectory_selector.
Algorithm Overview#
For each input CandidateTrajectories message the library runs every loaded plugin against every trajectory:
- Plugin evaluation: each plugin's
is_feasible()is called with the trajectory points and the currentValidatorContext(odometry, predicted objects, acceleration, HD map, traffic light states). - Feasibility decision: a trajectory survives if every plugin listed in
filter_namesreturnsis_feasible = true. Plugins listed inshadow_mode_filter_namesare evaluated and reported but never remove a trajectory. - Diagnostics: the wrapper publishes an Autoware diagnostics status —
OKif all trajectories pass all enforced plugins,WARNif at least one is rejected,ERRORif none survive.
Built-in Plugins#
| Class name | Category | Description |
|---|---|---|
safety::VehicleConstraintFilter |
safety |
Rejects trajectories that exceed maximum speed, acceleration, deceleration, steering angle, or steering rate. |
safety::UncrossableBoundaryDepartureFilter |
safety |
Rejects trajectories whose footprint crosses an uncrossable map boundary (e.g., road borders). |
traffic_rule::TrafficLightFilter |
traffic_rule |
Rejects trajectories that cross red, amber, or configured unknown traffic-light stop lines. |
Interface#
This package is a C++ library. The topics below are subscribed to by the hosting node (trajectory_selector_node) and passed to the validator as a ValidatorContext.
Topics#
| Direction | Topic name | Message Type | Description |
|---|---|---|---|
| Subscriber | ~/input/odometry |
nav_msgs/msg/Odometry |
Current ego pose and velocity (mandatory) |
| Subscriber | ~/input/acceleration |
geometry_msgs/msg/AccelWithCovarianceStamped |
Current ego acceleration (mandatory) |
| Subscriber | ~/input/objects |
autoware_perception_msgs/msg/PredictedObjects |
Surrounding dynamic obstacles (mandatory) |
| Subscriber | ~/input/traffic_signals |
autoware_perception_msgs/msg/TrafficLightGroupArray |
Traffic light states (optional; absent data does not block validation) |
| Subscriber | ~/input/route |
autoware_planning_msgs/msg/LaneletRoute |
Route with the lanelets followed by ego (only required by the TrafficLightFilter) |
| Subscriber | ~/input/lanelet2_map |
autoware_map_msgs/msg/LaneletMapBin |
HD map loaded once at startup (transient local QoS; mandatory) |
| Publisher | ~/debug/validation_reports |
autoware_trajectory_validator/msg/ValidationReportArray |
Per-trajectory validation verdict and per-metric values |
| Publisher | ~/debug/markers/<plugin_name> |
visualization_msgs/msg/MarkerArray |
Per-plugin debug visualization markers |
| Publisher | ~/debug/plugin_report_text |
visualization_msgs/msg/MarkerArray |
Text overlay summarizing how many paths each plugin filtered |
| Publisher | ~/debug/processing_time_ms |
autoware_internal_debug_msgs/msg/Float64Stamped |
Total validator processing time [ms] |
| Publisher | ~/debug/<plugin_name>/processing_time_ms |
autoware_internal_debug_msgs/msg/Float64Stamped |
Per-plugin processing time [ms] |
| Publisher | ~/debug/processing_time_text |
autoware_internal_debug_msgs/msg/StringStamped |
Human-readable processing time breakdown |
Parameters#
| Name | Type | Description | Default | Range |
|---|---|---|---|---|
| filter_names | array | List of validator plugin class names to enforce. Trajectories rejected by any plugin in this list are removed from the output. | [''] | N/A |
| shadow_mode_filter_names | array | List of validator plugin class names that run in shadow mode: results are evaluated, logged, and reported via diagnostics but do not affect the output trajectory set. | [''] | N/A |
| vehicle_constraint.max_speed | float | Maximum allowed longitudinal speed [m/s]. | 16.7 | ≥0.0 |
| vehicle_constraint.max_acceleration | float | Maximum allowed longitudinal acceleration [m/s²]. | 5.0 | ≥0.0 |
| vehicle_constraint.max_deceleration | float | Maximum allowed deceleration magnitude [m/s²] (positive value representing deceleration). | 5.0 | ≥0.0 |
| vehicle_constraint.max_steering_angle | float | Maximum allowed front-wheel steering angle [rad]. | 0.8 | ≥0.0 |
| vehicle_constraint.max_steering_rate | float | Maximum allowed steering rate [rad/s]. | 0.3 | ≥0.0 |
| traffic_light.deceleration_limit | float | Deceleration limit used to decide whether ego can safely stop before an amber stop line [m/s²]. A trajectory crossing an amber light is rejected if ego could stop within this deceleration. | 2.8 | N/A |
| traffic_light.jerk_limit | float | Jerk limit used together with deceleration_limit to compute the minimum stopping distance [m/s³]. |
5.0 | N/A |
| traffic_light.delay_response_time | float | Driver/system response delay used to estimate the earliest possible start of braking [s]. | 0.5 | ≥0.0 |
| traffic_light.crossing_time_limit | float | A trajectory crossing an amber light is rejected unless ego can fully clear the stop line within this time [s]. | 2.75 | ≥0.0 |
| traffic_light.treat_amber_light_as_red_light | boolean | When true, amber lights are treated identically to red lights (no dilemma-zone logic is applied). | True | N/A |
| traffic_light.treat_unknown_light_as_red_light | boolean | When true, UNKNOWN lights are treated identically to red lights. | False | N/A |
| traffic_light.stop_overshoot_margin | float | Maximum allowed distance between the trajectory's stop point and the stop line for the trajectory to be considered as stopping correctly [m]. | 0.5 | ≥0.0 |
| traffic_light.allow_if_cannot_stop_distance | float | allow crossing a stop line within this distance if ego cannot stop before the line plus its margin [m]. | 0.0 | ≥0.0 |
| traffic_light.stable_duration_threshold_red | float | Minimum duration a RED light must be seen before it is considered active (only when ego is moving) [s]. | 0.0 | ≥0.0 |
| traffic_light.stable_duration_threshold_amber | float | Minimum duration an AMBER light must be seen before it is considered active (only when ego is moving) [s]. | 0.0 | ≥0.0 |
| traffic_light.stable_duration_threshold_unknown | float | Minimum duration an UNKNOWN light must be seen before it is considered active (only when ego is moving) [s]. | 0.0 | ≥0.0 |
| traffic_light.amber_rejection_hysteresis_duration | float | Duration to persist an AMBER rejection state to prevent flipping [s]. | 0.0 | ≥0.0 |
| traffic_light.ego_stopped_velocity_threshold | float | Velocity threshold below which stability and hysteresis filters are bypassed [m/s]. | 0.01 | ≥0.0 |
| checked_trajectory_length.deceleration_limit | float | Deceleration limit used to compute the trajectory length scanned for traffic light stop lines [m/s²]. | 2.0 | N/A |
| checked_trajectory_length.jerk_limit | float | Jerk limit used together with deceleration_limit to compute the trajectory scan length [m/s³]. |
2.0 | N/A |
| boundary_departure.lateral_margin_m | float | Lateral clearance margin from an uncrossable boundary [m]. Trajectories whose footprint comes within this margin are rejected. | 0.01 | N/A |
| boundary_departure.longitudinal_margin_m | float | Longitudinal look-ahead margin applied when projecting the vehicle footprint along the trajectory [m]. | 1.0 | N/A |
| boundary_departure.max_deceleration_mps2 | float | Maximum deceleration (negative value) used to compute whether ego can stop before the boundary [m/s²]. | -4.0 | N/A |
| boundary_departure.max_jerk_mps3 | float | Maximum jerk (negative value) used together with max_deceleration_mps2 for the stopping distance estimate [m/s³]. |
-5.0 | N/A |
| boundary_departure.brake_delay_s | float | Braking response delay [s]. | 1.0 | ≥0.0 |
| boundary_departure.time_to_departure_cutoff_s | float | Time-to-boundary-crossing threshold below which a trajectory is flagged as departing [s]. | 2.0 | ≥0.0 |
| boundary_departure.on_time_buffer_s | float | Hysteresis buffer before activating boundary-departure detection [s]. | 0.15 | ≥0.0 |
| boundary_departure.off_time_buffer_s | float | Hysteresis buffer before deactivating boundary-departure detection [s]. | 0.15 | ≥0.0 |
| boundary_departure.enable_developer_marker | boolean | Publish diagnostic visualization markers intended for developer use. | True | N/A |
| boundary_departure.boundary_types | array | List of lanelet boundary type strings to treat as uncrossable (e.g., 'road_border'). | ['road_border'] | N/A |