From 1a635b74999d3313df8fa6d050ca5e2ac5318f4d Mon Sep 17 00:00:00 2001 From: Takayuki Murooka Date: Mon, 15 Aug 2022 19:14:56 +0900 Subject: [PATCH] add nearest search param Signed-off-by: Takayuki Murooka --- .../config/common/nearest_search.param.yaml | 5 +++++ launch/tier4_control_launch/launch/control.launch.py | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 launch/tier4_control_launch/config/common/nearest_search.param.yaml diff --git a/launch/tier4_control_launch/config/common/nearest_search.param.yaml b/launch/tier4_control_launch/config/common/nearest_search.param.yaml new file mode 100644 index 0000000000000..eb6709764ce3e --- /dev/null +++ b/launch/tier4_control_launch/config/common/nearest_search.param.yaml @@ -0,0 +1,5 @@ +/**: + ros__parameters: + # ego + ego_nearest_dist_threshold: 3.0 # [m] + ego_nearest_yaw_threshold: 1.046 # [rad] = 60 [deg] diff --git a/launch/tier4_control_launch/launch/control.launch.py b/launch/tier4_control_launch/launch/control.launch.py index e1dbc769deab8..150482dbb7505 100644 --- a/launch/tier4_control_launch/launch/control.launch.py +++ b/launch/tier4_control_launch/launch/control.launch.py @@ -44,6 +44,14 @@ def launch_setup(context, *args, **kwargs): with open(lat_controller_param_path, "r") as f: lat_controller_param = yaml.safe_load(f)["/**"]["ros__parameters"] + nearest_search_param_path = os.path.join( + LaunchConfiguration("tier4_control_launch_param_path").perform(context), + "common", + "nearest_search.param.yaml", + ) + with open(nearest_search_param_path, "r") as f: + nearest_search_param = yaml.safe_load(f)["/**"]["ros__parameters"] + lon_controller_param_path = os.path.join( LaunchConfiguration("tier4_control_launch_param_path").perform(context), "trajectory_follower", @@ -94,6 +102,7 @@ def launch_setup(context, *args, **kwargs): "ctrl_period": 0.03, "lateral_controller_mode": LaunchConfiguration("lateral_controller_mode"), }, + nearest_search_param, lon_controller_param, lat_controller_param, vehicle_info_param, @@ -117,7 +126,7 @@ def launch_setup(context, *args, **kwargs): "/control/trajectory_follower/lateral/predicted_trajectory", ), ], - parameters=[lane_departure_checker_param, vehicle_info_param], + parameters=[nearest_search_param_path, lane_departure_checker_param, vehicle_info_param], extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], ) @@ -203,6 +212,7 @@ def launch_setup(context, *args, **kwargs): ("control_mode_request", "/control/control_mode_request"), ], parameters=[ + nearest_search_param_path, operation_mode_transition_manager_param, vehicle_info_param, ],