No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro kilted. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.

autoware_behavior_path_bidirectional_traffic_module package from autoware_universe repo

autoware_adapi_specs autoware_agnocast_wrapper autoware_auto_common autoware_boundary_departure_checker autoware_component_interface_specs_universe autoware_component_interface_tools autoware_component_interface_utils autoware_cuda_dependency_meta autoware_fake_test_node autoware_glog_component autoware_goal_distance_calculator autoware_grid_map_utils autoware_path_distance_calculator autoware_polar_grid autoware_time_utils autoware_traffic_light_recognition_marker_publisher autoware_traffic_light_utils autoware_universe_utils tier4_api_utils autoware_autonomous_emergency_braking autoware_collision_detector autoware_control_performance_analysis autoware_control_validator autoware_external_cmd_selector autoware_joy_controller autoware_lane_departure_checker autoware_mpc_lateral_controller autoware_obstacle_collision_checker autoware_operation_mode_transition_manager autoware_pid_longitudinal_controller autoware_predicted_path_checker autoware_pure_pursuit autoware_shift_decider autoware_smart_mpc_trajectory_follower autoware_trajectory_follower_base autoware_trajectory_follower_node autoware_vehicle_cmd_gate autoware_control_evaluator autoware_kinematic_evaluator autoware_localization_evaluator autoware_perception_online_evaluator autoware_planning_evaluator autoware_scenario_simulator_v2_adapter tier4_autoware_api_launch tier4_control_launch tier4_localization_launch tier4_map_launch tier4_perception_launch tier4_planning_launch tier4_sensing_launch tier4_simulator_launch tier4_system_launch tier4_vehicle_launch autoware_geo_pose_projector autoware_ar_tag_based_localizer autoware_landmark_manager autoware_lidar_marker_localizer autoware_localization_error_monitor autoware_pose2twist autoware_pose_covariance_modifier autoware_pose_estimator_arbiter autoware_pose_instability_detector yabloc_common yabloc_image_processing yabloc_monitor yabloc_particle_filter yabloc_pose_initializer autoware_map_tf_generator autoware_bevfusion autoware_bytetrack autoware_cluster_merger autoware_compare_map_segmentation autoware_crosswalk_traffic_light_estimator autoware_detected_object_feature_remover autoware_detected_object_validation autoware_detection_by_tracker autoware_elevation_map_loader autoware_euclidean_cluster autoware_ground_segmentation autoware_image_projection_based_fusion autoware_lidar_apollo_instance_segmentation autoware_lidar_centerpoint autoware_lidar_transfusion autoware_map_based_prediction autoware_multi_object_tracker autoware_object_merger autoware_object_range_splitter autoware_object_velocity_splitter autoware_occupancy_grid_map_outlier_filter autoware_probabilistic_occupancy_grid_map autoware_radar_crossing_objects_noise_filter autoware_radar_fusion_to_detected_object autoware_radar_object_clustering autoware_radar_object_tracker autoware_radar_tracks_msgs_converter autoware_raindrop_cluster_filter autoware_shape_estimation autoware_simple_object_merger autoware_tensorrt_classifier autoware_tensorrt_common autoware_tensorrt_plugins autoware_tensorrt_yolox autoware_tracking_object_merger autoware_traffic_light_arbiter autoware_traffic_light_category_merger autoware_traffic_light_classifier autoware_traffic_light_fine_detector autoware_traffic_light_map_based_detector autoware_traffic_light_multi_camera_fusion autoware_traffic_light_occlusion_predictor autoware_traffic_light_selector autoware_traffic_light_visualization perception_utils autoware_costmap_generator autoware_external_velocity_limit_selector autoware_freespace_planner autoware_freespace_planning_algorithms autoware_hazard_lights_selector autoware_mission_planner_universe autoware_path_optimizer autoware_path_smoother autoware_remaining_distance_time_calculator autoware_rtc_interface autoware_scenario_selector autoware_surround_obstacle_checker autoware_behavior_path_avoidance_by_lane_change_module autoware_behavior_path_bidirectional_traffic_module autoware_behavior_path_dynamic_obstacle_avoidance_module autoware_behavior_path_external_request_lane_change_module autoware_behavior_path_goal_planner_module autoware_behavior_path_lane_change_module autoware_behavior_path_planner autoware_behavior_path_planner_common autoware_behavior_path_sampling_planner_module autoware_behavior_path_side_shift_module autoware_behavior_path_start_planner_module autoware_behavior_path_static_obstacle_avoidance_module autoware_behavior_velocity_blind_spot_module autoware_behavior_velocity_crosswalk_module autoware_behavior_velocity_detection_area_module autoware_behavior_velocity_intersection_module autoware_behavior_velocity_no_drivable_lane_module autoware_behavior_velocity_no_stopping_area_module autoware_behavior_velocity_occlusion_spot_module autoware_behavior_velocity_rtc_interface autoware_behavior_velocity_run_out_module autoware_behavior_velocity_speed_bump_module autoware_behavior_velocity_template_module autoware_behavior_velocity_traffic_light_module autoware_behavior_velocity_virtual_traffic_light_module autoware_behavior_velocity_walkway_module autoware_motion_velocity_dynamic_obstacle_stop_module autoware_motion_velocity_obstacle_cruise_module autoware_motion_velocity_obstacle_slow_down_module autoware_motion_velocity_obstacle_velocity_limiter_module autoware_motion_velocity_out_of_lane_module autoware_motion_velocity_run_out_module autoware_planning_validator autoware_planning_validator_latency_checker autoware_planning_validator_test_utils autoware_planning_validator_trajectory_checker autoware_bezier_sampler autoware_frenet_planner autoware_path_sampler autoware_sampler_common autoware_cuda_pointcloud_preprocessor autoware_cuda_utils autoware_image_diagnostics autoware_image_transport_decompressor autoware_imu_corrector autoware_pcl_extensions autoware_pointcloud_preprocessor autoware_radar_objects_adapter autoware_radar_scan_to_pointcloud2 autoware_radar_static_pointcloud_filter autoware_radar_threshold_filter autoware_radar_tracks_noise_filter autoware_livox_tag_filter autoware_carla_interface autoware_dummy_perception_publisher autoware_fault_injection autoware_learning_based_vehicle_model autoware_simple_planning_simulator autoware_vehicle_door_simulator tier4_dummy_object_rviz_plugin autoware_bluetooth_monitor autoware_component_monitor autoware_component_state_monitor autoware_adapi_adaptors autoware_adapi_visualizers autoware_automatic_pose_initializer autoware_default_adapi_universe autoware_diagnostic_graph_aggregator autoware_diagnostic_graph_utils autoware_dummy_diag_publisher autoware_dummy_infrastructure autoware_duplicated_node_checker autoware_hazard_status_converter autoware_mrm_comfortable_stop_operator autoware_mrm_emergency_stop_operator autoware_mrm_handler autoware_processing_time_checker autoware_system_monitor autoware_topic_relay_controller autoware_topic_state_monitor autoware_velodyne_monitor reaction_analyzer autoware_accel_brake_map_calibrator autoware_external_cmd_converter autoware_raw_vehicle_cmd_converter autoware_steer_offset_estimator autoware_bag_time_manager_rviz_plugin tier4_adapi_rviz_plugin tier4_camera_view_rviz_plugin tier4_control_mode_rviz_plugin tier4_datetime_rviz_plugin tier4_perception_rviz_plugin tier4_planning_factor_rviz_plugin tier4_state_rviz_plugin tier4_system_rviz_plugin tier4_traffic_light_rviz_plugin tier4_vehicle_rviz_plugin

Package Summary

Tags No category tags.
Version 0.1.0
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/autowarefoundation/autoware_universe.git
VCS Type git
VCS Version main
Last Updated 2025-06-06
Dev Status UNKNOWN
CI status No Continuous Integration
Released UNRELEASED
Tags planner ros calibration self-driving-car autonomous-driving autonomous-vehicles ros2 3d-map autoware
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

The autoware_behavior_path_bidirectional_traffic_module package

Additional Links

No additional links.

Maintainers

  • Yukinari Hisaki
  • Mamoru Sobue
  • Takayuki Murooka

Authors

  • Yukinari Hisaki

Bidirectional Traffic

This module enables trajectory planning for vehicles on “single-lane bidirectional traffic” roads in autonomous driving systems. Here, “single-lane bidirectional traffic” refers to roads without a centerline, such as those commonly found in residential areas, as shown in the image below.

BidirectionalTrafficShiojiri

In the following descriptions, the term bidirectional traffic refers specifically to such single-lane bidirectional roads as shown in the image above.

Purpose/Role

The main roles of this module are as follows:

  • Generating a driving trajectory along the left (or right) side of the road center

    This module provides a function to generate a trajectory along the left (or right) side of the road center on bidirectional traffic lanes. In some countries, traffic laws require vehicles to drive on the left or right side of the road center on bidirectional roads. For example, in Japan, Article 18, Paragraph 1 of the Road Traffic Act requires that vehicles must keep to the left side of the road center. Because of these legal requirements, this module provides the function to generate a trajectory that follows the left (or right) side of the road center on bidirectional roads.

  • Giving way to oncoming vehicles on bidirectional traffic roads

    This module provides the function for the ego vehicle to stop on the left side of the road and give way to oncoming vehicles in all situations where vehicles must pass each other on bidirectional roads. Bidirectional traffic roads are often narrow, and it is dangerous for both the ego vehicle and the oncoming vehicle to pass while moving simultaneously. To avoid such dangerous situations, this module enables the ego vehicle to stop on the left side of the road until the oncoming vehicle has completely passed.

The following video shows a demonstration of this module.

type:video

The representation of bidirectional traffic on a Lanelet map

Bidirectional lanelets are represented on a Lanelet map as two lanes with opposite directions that share the same LineString as their boundary. There is no need to assign any special tags to the lanelets.

BidirectionalTrafficMap

Limitations

This module does not support the following situations or functionalities.

  • Handling situations where passing is not possible

    Depending on factors such as lane width, the size of the ego vehicle and the oncoming vehicle, and the surrounding environment, simple behaviors like those shown in the video above may not be sufficient for passing. In such cases, special behaviours such as reversing or clearing an intersection may be required. However, this module does not provide such functionality.

  • When the oncoming vehicle is giving way or moving slowly

    In cases where the oncoming vehicle is trying to give way or is traveling at a low speed, it may be more appropriate for the ego vehicle to continue driving rather than stopping to give way. However, this module does not make any decision about whether to give way to the oncoming vehicle – it always pulls over to the left and stops.

  • Does not support the functionality of pulling into the shoulder to stop and give way

    Depending on the road width, the ego vehicle may need to enter the shoulder in order to give way to an oncoming vehicle. However, this module does not support such functionality.

Inner workings/Algorithms

This module does not support the following situations or functionalities.

Keep Left

This module detects bidirectional lanelets from the lanelet map and performs a keep left maneuver. When keeping left, the shift starts from the beginning of the lanelet immediately before the bidirectional lanelet, and ends at the end of the bidirectional lanelet.

KeepLeft

Give Way

State transition of GiveWay

To perform the give way maneuver, the GiveWay module has five internal states.

  • NoNeedToGiveWay

    No oncoming vehicles present and driving normally or oncoming vehicles are far away.

    NoNeedToGiveWay

  • ApproachingToShift

    If an oncoming vehicle is detected, it generates a path to shift left and pull over, approaching the shift start point.

    ApproachingToShift

  • ShiftingRoadside

    ShiftingRoadside

  • WaitingForOncomingCarsToPass

    The ego vehicle stops and waits until all oncoming vehicles have passed.

    WaitingForOncomingCarsToPass

  • BackToNormalLane

    After the oncoming vehicle has passed, the ego vehicle performs a shift to return to its original driving lane.

    BackToNormalLane

The state transition diagram of the GiveWay module is shown below.

@startuml
skinparam state {
  BackgroundColor White
  BorderColor Black
  FontName "Arial"
}

[*] --> NoNeedToGiveWay

state NoNeedToGiveWay : No oncoming vehicles,\ndriving normally
state ApproachingToShift : Oncoming vehicle detected,\napproaching shift start
state ShiftingRoadside : Shifting left to pull over
state WaitingForOncomingCarsToPass : Ego stopped,\nwaiting for oncoming vehicles to pass
state BackToNormalLane : Returning to original lane,\nafter oncoming vehicle passed


NoNeedToGiveWay --> ApproachingToShift : Oncoming vehicle detected
ApproachingToShift --> NoNeedToGiveWay : Oncoming vehicle disappeared
ApproachingToShift --> ShiftingRoadside : Passed shift start point
ShiftingRoadside --> WaitingForOncomingCarsToPass : Ego stopped
ShiftingRoadside --> BackToNormalLane : Oncoming vehicle disappeared
WaitingForOncomingCarsToPass --> BackToNormalLane : Oncoming vehicle disappeared
BackToNormalLane --> NoNeedToGiveWay : Passed shift end point
@enduml

How to decide shift length to pull over?

When an oncoming vehicle is detected, it is necessary to determine how much longitudinal distance to consume for the shift.

ShiftDistance

The figure above illustrates the distances related to lane shifting. The shift prepare distance is the distance required to prepare for shifting before reaching the shift start point, and it is calculated by multiplying the parameter time_to_prepare_pull_over by the ego_velocity.

These distances are calculated when the state is NoNeedToGiveWay. Once the ego vehicle enters the shift prepare distance, the state transitions to ApproachingToShift. When it enters the shift distance, the state transitions to ShiftingRoadside.

While in the NoNeedToGiveWay state, the calculation of the shift_distance and the corresponding state transitions are handled as follows.

@startuml
start

:Calculate lateral_shift_distance (1);
:Calculate allowed_longitudinal_distance (2);
:Calculate desired_pull_over_point (3);
:shift_prepare_distance = ego_speed * time_to_prepare_pull_over;

if (desired_pull_over_point < allowed_longitudinal_distance + shift_prepare_distance) then (yes)
  :shift_distance = allowed_longitudinal_distance;
  :Enter ApproachingToShift state;
else
  :Calculate max_longitudinal_distance (4);

  if (desired_pull_over_point < max_longitudinal_distance + shift_prepare_distance) then (yes)
    :shift_distance = allowed_longitudinal_distance;
    :Enter ApproachingToShift state;
  else
    :Output shifting trajectory;
    :Remain in NoNeedToGiveWay state;
  endif

endif

stop
@enduml

We now provide a detailed explanation of the following four calculations:

1. Calculate lateral_shift_distance

lateral_shift_distance is the lateral distance that the ego vehicle needs to shift. This value is calculated from min_distance_from_roadside and shift_distance_to_pull_over_from_center_line, based on road_width and vehicle_width, as follows:

\[\text{lateral_shift_distance} = \text{max}(\text{road_width} / 2 - \text{vehicle_width} / 2 - \text{min_distance_from_roadside}, \text{shift_distance_to_pull_over_from_center_line})\]
2. Calculate allowed_longitudinal_distance

allowed_longitudinal_distance is the minimum longitudinal distance required for the ego vehicle to perform the shift. Shifting in a shorter distance would require a sharp steering maneuver, which is unsafe. This distance is calculated such that the lateral jerk derived from lateral_shift_distance and ego_velocity does not exceed max_lateral_jerk:

\[\text{allowed_longitudinal_distance} = \text{calc_longitudinal_dist_from_jerk}(\text{lateral_shift_distance}, \text{max_lateral_jerk}, \text{ego_velocity})\]
3. Calculate desired_pull_over_point

If the shift starts too early, the ego vehicle may have to wait a long time for the oncoming vehicle to pass. If it starts too late, there is a risk of collision. To avoid both, the ideal point to begin the pull-over is calculated based on the ego speed and the oncoming vehicle’s speed, assuming the ego vehicle will stop and wait for wait_time_for_oncoming_car seconds:

\[\text{desired_pull_over_point} = \frac{(\text{distance_to_oncoming_car} - \text{oncoming_car_speed} \cdot \text{wait_time_for_oncoming_car}) \cdot \text{ego_speed}}{\text{ego_speed} + \text{oncoming_car_speed}}\]
4. Calculate max_longitudinal_distance

An overly long shift distance may appear unnatural. To prevent this, the maximum longitudinal distance is calculated based on the minimum lateral jerk:

\[\text{max_longitudinal_distance} = \text{calc_longitudinal_dist_from_jerk}(\text{lateral_shift_distance}, \text{min_lateral_jerk}, \text{ego_velocity})\]

Parameters

{{ json_to_markdown(“planning/behavior_path_planner/autoware_behavior_path_bidirectional_traffic_module/schema/bidirectional_traffic.schema.json”) }}

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_behavior_path_bidirectional_traffic_module at Robotics Stack Exchange

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.