Changes

Summary

  1. tos_msgs: PncConfiguration 新增堆场入口范围 access_lines 字段,添加 AccessLine 消息定义 (details)
  2. tos_msgs: AccessLine 字段 yard_id 重命名为 yard (details)
Commit 2b2e142c9000d957df8a263160e270ba2067121d by wuyanjun110
tos_msgs: PncConfiguration 新增堆场入口范围 access_lines 字段,添加 AccessLine 消息定义
The file was modifiedtos_msgs/CMakeLists.txt
The file was addedtos_msgs/msg/AccessLine.msg
The file was modifiedtos_msgs/msg/PncConfiguration.msg
Commit 84aa508cf8dfb205824c68f43f042c02060f8b1f by wuyanjun110
tos_msgs: AccessLine 字段 yard_id 重命名为 yard
The file was modifiedtos_msgs/msg/AccessLine.msg

Summary

  1. feat: 新增镇石(ZHEN_SHI)站点地理围栏, IMV前进进出站复用西联场景 (details)
  2. fix: 极限变道弯道tunnel沿参考线折线化, 补挂车offtracking裕量与急弯降级 (details)
  3. feat: 逆向车道快速接近凸包停车防护(cluster兜底) (details)
  4. chore: 逆向车道接近防护灰度默认打开 (details)
  5. fix: 窄会车限速HMI补绘制颜色, 原落到default暗红 (details)
  6. feat: 红绿灯实时灯态停车, 含倒计时通行判断与红灯缓行 (details)
  7. style: 灯相位改指定初始化器, 防字段顺序变动时静默错位 (details)
  8. feat: 地图标注红绿灯相位与倒计时, 挂动态层避免静态缓存不刷新 (details)
  9. build: Debug 调试信息拆到 .dwo, 链接改用 lld (details)
  10. fix: BETWEEN_YARD 条件增加前进方向判断, 倒车时不启用 (details)
  11. feat: 锁站方向判定增加终点在车后倒车分支 (details)
  12. fix: 途径点匹配改按横向距离绝对值取最近中心线 (details)
  13. fix: center_line 深度 review 一轮(判定修正+越界防护+去冗余拷贝+清死代码) (details)
  14. feat: HMI 显示 road boundary 的 shift type (details)
  15. fix: 修复 TrajectoryPoints 三处按弧长插值的参数误用 (details)
  16. fix: 修复 PJPO 变道横移走不完与跨两车道路径扭曲 (details)
  17. feat: 梁山港进料场景也使用通用牵引挂车泊车场景 (details)
  18. feat: 云端轨迹下发各 lane 的剩余长度与总长度 (details)
Commit ed38742ac3653b98bffbf6039acd113a38e5c05d by wuyanjun110
feat: 新增镇石(ZHEN_SHI)站点地理围栏, IMV前进进出站复用西联场景
The file was modifieddata/ssep/forward_ec.cpp
The file was modifieddata/config/cfg_region.cpp
The file was modifieddata/config/cfg_region.hpp
Commit a93cf96e88f3a7a11105b1445a36733642ee3fe7 by wuyanjun110
fix: 极限变道弯道tunnel沿参考线折线化, 补挂车offtracking裕量与急弯降级

极限变道的 tunnel 约束原本用单条长直线段近似弯曲车道, 弦误差为 L^2*kappa/8
(40m 直线在 R=100m 弯道上偏 2.0m), 而 end tunnel 的 HARD 管道半宽只有车道半宽
加 5cm(约2m), 弯道上管道与真实车道几乎不重叠, 起点/终点被墙关在外面, 导致
搜索必然失败。

- 折线化: 新增 AppendOffsetPolylineTunnel(沿参考线 2m 等 l 偏移折线) /
  AppendCrossLineTunnel(等 s 断面法向封口线) / CalcMaxCurvature(theta 差分
  带符号曲率), 替换四处弦近似: ConstructStartTunnel 两条侧墙+横切线、
  ConstructEndTunnel 左右管道+后端封口、ConstructObsTunnel、
  GetRealObstacleTunnel。横向量统一为 SL 约定(左正右负), 与旧
  GetParallelLine "线段方向右侧为正"、且纵向线反向构造致法向翻转的隐式约定等价
- 弯道裕量: end tunnel 补挂车 offtracking(L^2*kappa/2, 上限 1.2m, 按曲率符号
  只放宽弯道内侧, 仅带挂车型); 后向管道长度按曲率收缩(kappa>0.01 起, 最短 8m)
- 急弯兜底: kappa>0.02(R<50m) 且端约束为 HARD 且带挂时降级为 SOFT, IMV 不降级
- 顺带修: s 超出参考线长度时线段退化的隐患; SL 法向外推在 |l|*kappa 接近 1 时
  跨过曲率中心翻折成幽灵墙, 按局部曲率钳制横向跨度; 曲率采样改用插值的
  GetReferencePoint, 避免最近离散点致曲率被静默低估为 0

灰度 use_func_lc_tunnel_curvature_fit / use_func_lc_tunnel_curvature_margin,
cfg_func_sw 序列化 version 15。replay 与实车均未验证。
The file was modifieddata/config/cfg_func_sw.hpp
The file was modifieddata/config/cfg_func_sw.cpp
The file was modifieddata/ssep/ex_lane_change_ec.cpp
Commit 37e60d1fffdd460496b2b6249ed71c92517de4c9 by wuyanjun110
feat: 逆向车道快速接近凸包停车防护(cluster兜底)

对向来车未被感知分类为obj、只输出TYPE_CLUSTER时, PNC纵向决策对它完全无反应:
cluster不进interested因而无decider_attr, FromHis跳过它因而无历史, ST按静态建
且不进path_time_obstacles_, 唯一影响是写OGM当前占用->只限速不停车。对"点云少+
速度快"的逆向来车, 等它进自车path时已无刹停距离。

cluster无id概念、前后帧id不对应, 因此判据做成不依赖id的标量时序:
- 逆向车道链: 自车已驶入转弯lane(无逆向邻车道)时沿参考线回退到弯道前直道作
  锚点, 再沿直道predecessor往上游延伸, 终止条件是"自车上游累计长度够不够",
  不是级数/链总长(单条lane就可能几百米, 按总长封顶会一次都延伸不进去)
- 冲突区: 自车走廊与对向道路判定带的重叠段, 不用两条中心线求交 —— 车体有
  宽度, 中心线不相交时车照样扫过去
- 判据: cluster投影到逆向链自身量弧长(不碰guide的SL, 规避弯道投影问题),
  帧级批量关联维持航迹, 两车占用冲突区的时间窗交叠即触发

防误停三道门: 路沿侧边界内缩、接近速度死区、航迹成熟度。
停止线保持2s防判据抖动导致点头; 车头横向切入对向道路超阈则整体释放 —— 进区
后再停等于横在对向道上挡路, 比抢过去更危险。

灰度use_reverse_approach_stop默认关, 12项参数均可rosparam调。
HMI"逆向车道接近"菜单画链/道路边界/判定带/冲突区/命中cluster, 状态行给出各道
门的通过情况。
The file was modifieddata/config/cfg_safe_const.hpp
The file was modifieddata/config/cfg_hmi.hpp
The file was modifieddata/constrain/longitude_constrain.hpp
The file was modifieddata/constrain/longitude_constrain.cpp
The file was addedhmi/draw/draw_reverse_approach.hpp
The file was modifiedtasks/deciders/long_decider/constrain_decider.hpp
The file was modifiedhmi/node_hmi.cpp
The file was modifieddata/config/cfg_hmi.cpp
The file was modifieddata/app/fsm/stop_reason.cpp
The file was modifieddata/config/cfg_safe_const.cpp
The file was modifieddata/constrain/long_target.cpp
The file was addeddata/obstacle/reverse_lane_approach.hpp
The file was modifiedhmi/draw/draw_all.cpp
The file was modifieddata/plan_frame.cpp
The file was modifiedhmi/draw/draw_constrain.cpp
The file was modifiedcommon/util/express.cpp
The file was modifieddata/plan_frame.hpp
The file was modifiedhmi/widget/pnc_mat_shared.cpp
The file was modifieddata/config/cfg_func_sw.cpp
The file was addedhmi/draw/draw_reverse_approach.cpp
The file was modifiedtasks/deciders/long_decider/constrain_decider.cpp
The file was addeddata/obstacle/reverse_lane_approach.cpp
The file was modifieddata/config/cfg_func_sw.hpp
Commit b61c553c0f4ff9a36aedab5c5614f28b518af1c2 by wuyanjun110
chore: 逆向车道接近防护灰度默认打开

hpp 类内初始化与 cpp 的 rosparam 默认值一并改 true —— 前者在回放
version<16 的老 dump 时生效, 只改后者会让老包回放仍是关的。
The file was modifieddata/config/cfg_func_sw.hpp
Commit afa15f9f2342928ced17b1889a3035764b115244 by wuyanjun110
fix: 窄会车限速HMI补绘制颜色, 原落到default暗红
The file was modifiedhmi/draw/draw_constrain.cpp
Commit 29aab4d28dc68f370f38bc4787b9fa5c55d256b9 by wuyanjun110
feat: 红绿灯实时灯态停车, 含倒计时通行判断与红灯缓行

从 feat_traffic 移植实时灯态接入, 原逻辑只按地图判"路口有灯就停",
现改为按灯色放行:
- 新增 TrafficLightData 与 ROS 源, 订阅 traffic_light_det
- 按路口转向选相位判定停走, 补齐右转灯(未检出右转灯时维持放行)
- HMI 诊断显示灯态与倒计时

倒计时(感知复用 conf 字段承载)相关:
- 绿灯剩余不足以让车头驶出路口时提前停等; 已无法在停止线前停住
  则继续通过, 避免明知停不住仍急刹
- 红灯将结束时压低接近速度缓行; 停止线约束保留, 不会闯红灯

移植修正:
- FromMsg 补 clear(), 原实现跨帧累积会让历史绿灯命中 IsHaveStatus
- ROS 源补 mutex, 与其余数据源一致
- 未移植 NeedTrafficLightStop 里的调试用 return true(会架空灰度开关)

灰度 use_func_traffic_light_countdown / use_func_traffic_light_creep
默认关; PlanFrame 序列化升至 version 6, 新字段按版本追加。
The file was modifiedsource/module.cpp
The file was modifieddata/config/cfg_func_sw.cpp
The file was modifieddata/config/cfg_topic.cpp
The file was modifieddata/config/cfg_topic.hpp
The file was modifieddata/config/cfg_env_const.cpp
The file was modifieddata/constrain/longitude_constrain.hpp
The file was addeddata/vehicle/traffic_light_data.cpp
The file was modifiedtasks/deciders/long_decider/constrain_decider.hpp
The file was modifieddata/plan_frame.hpp
The file was addedsource/ros_source_traffic_light.hpp
The file was addedsource/ros_source_traffic_light.cpp
The file was modifieddata/config/cfg_env_const.hpp
The file was addeddata/vehicle/traffic_light_data.hpp
The file was modifieddata/constrain/disable_stop_range.hpp
The file was modifiedtasks/deciders/long_decider/constrain_decider.cpp
The file was modifiedhmi/draw/draw_constrain.cpp
The file was modifiedhmi/widget/diagnose.cpp
The file was modifiedcommon/util/express.cpp
The file was modifieddata/config/cfg_func_sw.hpp
The file was modifieddata/constrain/disable_stop_range.cpp
The file was modifieddata/constrain/longitude_constrain.cpp
Commit 9e7385a8a3484d64ba9b49974ca6230826de396e by wuyanjun110
style: 灯相位改指定初始化器, 防字段顺序变动时静默错位
The file was modifieddata/vehicle/traffic_light_data.cpp
Commit 23b1fbfac1ccccc0570406cec64bbe47367d9b69 by wuyanjun110
feat: 地图标注红绿灯相位与倒计时, 挂动态层避免静态缓存不刷新
The file was modifiedhmi/draw/draw_map.hpp
The file was modifiedhmi/draw/draw_map.cpp
Commit f7fe9b1838d7deb33e6534ab396cc6efefd484ad by wuyanjun110
build: Debug 调试信息拆到 .dwo, 链接改用 lld

-fstandalone-debug 让每个 .o 都带完整调试信息, 全量产出 819 个 .o 共 4.7GB、
可执行文件各 1.35GB, 结果 ccache 装不下一次全量(命中率仅 17%), 链接也很慢。
追加 -gsplit-dwarf 把调试信息拆到独立 .dwo, 不再进 .o 和最终二进制。两个 flag
各管一件事(前者决定类型完整性, 后者决定存放位置), 必须同时保留, 调试能力不变。
改动后 .o 总量降到 1.25GB, pnc_node 降到 768MB。

链接器在探测到 lld 时改用 lld, 链接阶段耗时占比从瓶颈降到 0.3%。lld 是独立包
不随 clang 一起装, 所以先问编译器能否使用再启用, 没装的机器回落系统默认链接器。

注意: .dwo 按相对路径记录, 调试器需从 build/ 目录启动才能定位。
The file was modifiedCMakeLists.txt
Commit d7c66ed883d6c439a310ea0f7569991cf1bf51ef by wuyanjun110
fix: BETWEEN_YARD 条件增加前进方向判断, 倒车时不启用
The file was modifiedscenarios/task_condition_evaluator.cpp
Commit b2f9bbd3d848b5a7587239e398db547471e9b00c by wuyanjun110
feat: 锁站方向判定增加终点在车后倒车分支

终点在车后且对齐余量超过 1m 时直接置为倒车方向, 避免落到
req_step_align 分支后按前进方向规划。
The file was modifieddata/plan/path_direction_data.cpp
Commit 555643794eb3726b03b06138afd7b43fecee2241 by wuyanjun110
fix: 途径点匹配改按横向距离绝对值取最近中心线

引桥/岸桥/park/buffer/lane_change 五处筛选中心线时, min_l 初值为 DBL_MAX
却用带符号的 l() 比较, 实际选出的是横向偏移最负(最靠右)的那条, 而非横向
最近的。外层已按 fabs(l()) < 2.0 过滤, 内层比较与之矛盾。改为与
UpdateDestAttr / UpdateCurrentAttr 一致的 fabs 写法。
The file was modifieddata/map/reference/center_line.cpp
Commit 55345aae591d63ec186a92ce017ada334467c55c by wuyanjun110
fix: center_line 深度 review 一轮(判定修正+越界防护+去冗余拷贝+清死代码)

判定:
- 变道左右邻的 distance 跨越数不同, 原 check_range 被右邻覆盖后左侧实线
  检查也复用它, 拆成 left/right 各算各的
- 引桥途径点 s 只算不用, 结果取到最后一个而非最近的, 补上筛选
- seaside/lane_change 比较用 start_match.s() 却存 end_match.s(), 下一轮
  比较基准错位, 统一回 start

越界与崩溃防护:
- RelationOfRefByIdx 两个重载空容器时 size()-1 下溢, 后面 CHECK 必失败,
  改优雅返回 INT32_MAX(46 处调用点已按此值处理)
- UpdateSwitchAttr 开头补 empty() 早退, 原先 back() 无保护
- JudgeIsInBlackLane 查的是邻车道, 补 idx==0 查左邻的边界判断
- GetBlackLaneDistanceFromEgo 的 count 是变道相对关系可为负, idx+count
  走 size_t 会下溢, 改 int64_t 中转后校验
- SwitchData::curr_lane_idx_/target_lane_idx_ 无类内初始化也不在构造列表,
  补 SIZE_MAX

冗余拷贝(均为每帧热路径, CenterLine 含完整点列):
- UpdateBlackLaneDistance 深拷贝整个 MltCenterLines
- GetBlackLaneDistanceFromEgo 首次 at(idx) 拷贝立即被覆盖
- JudgeIsInBlackLane 按值拷贝邻车道

死代码:
- 136 行注释掉的 lane_change 旧实现
- LaneChangePtIsInCurPath(条件括号错位致语义反转, 仅注释块内调用)
- buffer 途径点在 center_line 侧的链路(赋值处早已注释, 无消费者);
  AppReaction::buffer_passing_pts_ 仍在用, 未动
The file was modifieddata/map/reference/center_line.cpp
The file was modifieddata/map/reference/center_line.hpp
The file was modifieddata/plan/switch_data.hpp
Commit 5b27175f0138069d8f6b7d25750b6511d52adb1a by wuyanjun110
feat: HMI 显示 road boundary 的 shift type

在 road boundary 左边界点旁标注每段的 shift type, 类型跳变处各标一个,
同类型连续断面不重复标。

文字画在 cv::flip 之后(flip 前画会上下颠倒), 沿用 DrawReverseApproach
的两段式: Draw 阶段只缓存 UTM 锚点, DrawText 做坐标变换并出字。
The file was modifiedhmi/draw/draw_all.cpp
The file was modifiedhmi/draw/draw_path_boundary.cpp
The file was modifiedhmi/draw/draw_path_boundary.hpp
The file was modifiedhmi/widget/pnc_mat_shared.cpp
Commit 6d93e3a9c729dba971bb8b40f0600f479bffc180 by wuyanjun110
fix: 修复 TrajectoryPoints 三处按弧长插值的参数误用

MatchPtByt/MatchPtByS/MatchMultiPtsByMultiS 都把 [0,1] 的比例传给
InterpPtByLinearS, 而后者第三参是绝对弧长, 于是恒命中其 "p0.s() >= s - 0.01"
早退分支 —— 轨迹中段 s 是几十米量级、恒大于比例值, 插值从未真正生效, 取点一直
退化成按离散点向下取整。

- MatchPtByt: 把时间比例换算成对应弧长再传
- MatchPtByS / MatchMultiPtsByMultiS: 本就按 s 查, 直接传 s
- MatchMultiPtsByMultiS: 顺带修解引用 end() 的 UB 与 l/u 写反(该函数无调用方)
- InterpPtByLinearS: z_ 是被重载的字段(存挂车横摆角, 另有 10000 终止哨兵),
  插值真正生效后不能再盲目 lerp —— 任一端越界或两端相差超过 pi 时取下界点

影响面较大: obstacle 预测采样、DP 动态代价、走廊 s<->t 反查、lattice 停车轨迹、
cloud_trajectory 都从"取整"变为"真插值", 数值会有变化, 目前只验证过变道场景。
The file was modifieddata/common/trajectory_point.cpp
Commit d22a1c8ac945ee70b47bf11a0263366d995c84f9 by wuyanjun110
fix: 修复 PJPO 变道横移走不完与跨两车道路径扭曲

一、变道横移走不完(车挪 1~3m 就停住, 路径起点段变直)
车的横移速率 ≈ init_dl × v(每帧只执行路径最前约 0.5m), 所以起点斜率一旦被压到
0, 路径形状再对车也不动。两处把它压到 0:
- 起点 dl 在变道场景恢复硬约束(新增 soften_init_dl)。dcf2390c1 为治 side-pass
  的起点 kappa kink 把 init_dl 软化, 但变道恰恰需要起点持续保持朝目标的横移
  斜率, 软化后 QP 每帧把它拉回 0(kSoftInitPenalty 相对 l_ref 权重极低, 拉回几乎
  无代价), 实测逐帧 0.113 -> 0.0137 -> 0.00065。
- kInitDlOutwardMax 的"向外"判据改为相对 path_reference_l。原按 init_l 符号判,
  会把 PREPARE 段"正朝目标车道靠拢"误判成向外漂移(实测 ref_l=1.57/init_l=0.82/
  init_dl=0.06), 起点斜率被夹死在 0.05。
另新增 BoostLaneChangeInitDl: QP 每帧的解从起点起 dl 就单调递减, 而车只执行起点
段, 构成一阶惯性环节(指数收敛、尾巴无限长), 只能在入口给定横移速率下限打破。

二、跨两车道路径扭曲(变一道正常, 变两道路径扭、控制跟不住而触发曲率限速)
- 变道 dl 上限放宽到 0.8。单车道 S 曲线峰值仅 0.26, 跨两车道需 ~0.5, 恰好顶死
  ±0.5 上限, QP 在约束边界上滑动导致解非光滑。用同一帧 dump 离线扫描, dl 拐点
  数与触限程度严格对应: 0.3->7, 0.5->3, 0.8->1; 放宽后实际只用到 0.505。
- config_local 的 lane_change_weight.dl_weight 20->5000(不在本仓库, 需单独同步)
  压 dl 峰值治"急": 峰值 0.42->0.30, 拐点 2->0, 收敛距离 18m->44.5m。

三、连带修复
- init_dl 为硬约束时补上夹进 dl 边界。piecewise_jerk_problem 把 dx[0] 上下界同设
  为 init 值(硬等式), 与 dx 的 box 约束矛盾时 OSQP 直接 primal infeasible, 而变道
  关闭了 all_soft 兜底, 会一路掉到 last_path fallback。
- 起点 dl/ddl 增加 Frenet 直传(参考线几何未变时从上一帧解按 s 取), 绕开 Cartesian
  往返; 失败自动回退反算。
- PjpoConstraintOptions 序列化补 enable_all_soft_fallback(版本 2->3)。生产置 false
  而结构体默认 true, 之前从不入档, 离线回放会多挂 all_soft 档致复现不可信。
- 新增离线工具 AnalyzeDlBoundEffect(扫 dl 上限/权重, 打印 opt_dl 曲线与拐点数)与
  SidePassOutwardClampRegression(比对新旧向外判据并校验解是否退化)。

验证: 实车变道正常、曲率连续; side-pass 回归 72 例 0 退化, 其中 1 例判据差异是对
旧判据误夹的纠正(车朝走廊中点走却被当成向外漂移)。
The file was modifieddata/plan/start_point_data.cpp
The file was modifiedTesting/pjpo_case_test.cpp
The file was modifiedalgorithm/plan/pjpo.hpp
The file was modifiedtasks/plan/pjpo_task.cpp
The file was modifiedtasks/deciders/lat_decider/switching_bounds_decider.cpp
The file was modifiedalgorithm/plan/pjpo.cpp
Commit 494a4c03c12d713a4f2c572f39263f19537749f2 by wuyanjun110
feat: 梁山港进料场景也使用通用牵引挂车泊车场景

原先仅出料(BulkOut)时设为 kTractorTrailerGeneral, 现进料(BulkIn)同样适用。
The file was modifieddata/ssep/forward_ec.cpp
Commit 6b68ccaa05a2dfddc975df3c86c4ab8b783fa6d2 by wuyanjun110
feat: 云端轨迹下发各 lane 的剩余长度与总长度

Traj.msg 的 length_s/total_length_s 与 lane_ids 逐项对齐, 取值来自
第一条引导线的 line_infos: 自车所在 lane 只算未走完的部分, 其后的
lane 取引导线覆盖的全长; 变道备用引导线不下发长度。
The file was modifieddata/plan/cloud_trajectory.cpp
The file was modifieddata/plan/cloud_trajectory.hpp