fix(minco_ws): LaunchConfiguration 全局撞名导致 step_blocker/chassis 读错 yaml
ROS 2 的 LaunchConfiguration 是**全局作用域**,两个独立 launch 文件里同名的
DeclareLaunchArgument 会互相串味:vehicle_bringup 先 include body_odom、后 include
step_blocker 与 chassis,后两者的 LaunchConfiguration('params_file') 全部解析成
body_odom.yaml。
实测后果:
- step_blocker 的 regions/wall_height/cell_size 全回落代码默认值(仅打印
'regions is empty -> pure passthrough' 警告,不会报错);
- chassis_serial_node 的 max_vx/vy/wz 回落代码默认 2.5/2.5/1.5,
**精心设的 0.5 限速被完全绕过**,且 log_velocity_frames 变 False
(整机日志里因此从未出现 TX 行 —— 该日志的'缺席'正是本 bug 的证据)。
修法:参数改名为 step_blocker 的 blocker_params_file、chassis 的 chassis_params_file。
body_odom 保留原名 —— 它是最先 include 的,属污染源而非受害者,行为正确。
This commit is contained in:
@@ -29,10 +29,12 @@ def generate_launch_description():
|
||||
default_params = os.path.join(share, 'config', 'step_blocker.yaml')
|
||||
|
||||
declared = [
|
||||
# 参数名必须是**唯一**的:LaunchConfiguration 是全局作用域,
|
||||
# 若这里叫 'params_file',而本文件被 vehicle_bringup 与 body_odom.launch.py
|
||||
# 依次 include,就会解析成 body_odom 的 yaml(实测踩过)。
|
||||
DeclareLaunchArgument(
|
||||
'params_file', default_value=default_params,
|
||||
description='参数文件(install 里是拷贝,改了 src 那份要重建;'
|
||||
'或把这里指向 src)'),
|
||||
'blocker_params_file', default_value=default_params,
|
||||
description='参数文件(--symlink-install 下直通 src;普通 build 是拷贝)'),
|
||||
DeclareLaunchArgument(
|
||||
'regions',
|
||||
default_value=_yaml_default(default_params, 'regions', ''),
|
||||
@@ -45,7 +47,7 @@ def generate_launch_description():
|
||||
name='step_blocker',
|
||||
output='screen',
|
||||
parameters=[
|
||||
LaunchConfiguration('params_file'),
|
||||
LaunchConfiguration('blocker_params_file'),
|
||||
{'regions': LaunchConfiguration('regions')},
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user