nav2_params_real_clean.yaml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. amcl:
  2. ros__parameters:
  3. use_sim_time: False
  4. alpha1: 0.04 # 减少旋转阶段的粒子发散,降低掉头收尾时的定位抖动
  5. alpha2: 0.04
  6. alpha3: 0.06
  7. alpha4: 0.06
  8. alpha5: 0.03
  9. base_frame_id: "base_footprint"
  10. beam_skip_distance: 0.3
  11. beam_skip_error_threshold: 0.8
  12. beam_skip_threshold: 0.25
  13. do_beamskip: false
  14. global_frame_id: "map"
  15. lambda_short: 0.1
  16. #0107 laser_likelihood_max_dist: 4.0
  17. laser_likelihood_max_dist: 4.0 #激光匹配最大距离
  18. laser_max_range: 8.0
  19. laser_min_range: 0.20
  20. laser_model_type: "beam"
  21. max_beams: 64
  22. max_particles: 2000
  23. min_particles: 300
  24. odom_frame_id: "lidar_odom"
  25. pf_err: 0.03
  26. pf_z: 0.99
  27. recovery_alpha_fast: 0.0
  28. recovery_alpha_slow: 0.0
  29. resample_interval: 2
  30. robot_model_type: "nav2_amcl::OmniMotionModel"
  31. save_pose_rate: 0.5
  32. sigma_hit: 0.20
  33. tf_broadcast: true
  34. transform_tolerance: 0.30
  35. # Keep AMCL publishing during low-speed stop-go motion so map->odom does
  36. # not age into multi-second stale output between small controller updates.
  37. update_min_a: 0.02
  38. update_min_d: 0.02
  39. z_hit: 0.75
  40. z_max: 0.05
  41. z_rand: 0.20
  42. z_short: 0.00
  43. scan_topic: scan
  44. amcl_map_client:
  45. ros__parameters:
  46. use_sim_time: False
  47. amcl_rclcpp_node:
  48. ros__parameters:
  49. use_sim_time: False
  50. #BT 导航树
  51. bt_navigator:
  52. ros__parameters:
  53. use_sim_time: False
  54. global_frame: map
  55. robot_base_frame: base_link
  56. odom_topic: /Odometry
  57. bt_loop_duration: 10
  58. default_server_timeout: 15
  59. plugin_lib_names:
  60. - nav2_compute_path_to_pose_action_bt_node
  61. - nav2_compute_path_through_poses_action_bt_node
  62. - nav2_smooth_path_action_bt_node
  63. - nav2_follow_path_action_bt_node
  64. - nav2_back_up_action_bt_node
  65. - nav2_spin_action_bt_node
  66. - nav2_wait_action_bt_node
  67. - nav2_clear_costmap_service_bt_node
  68. - nav2_is_stuck_condition_bt_node
  69. - nav2_goal_reached_condition_bt_node
  70. - nav2_goal_updated_condition_bt_node
  71. - nav2_initial_pose_received_condition_bt_node
  72. - nav2_reinitialize_global_localization_service_bt_node
  73. - nav2_rate_controller_bt_node
  74. - nav2_distance_controller_bt_node
  75. - nav2_speed_controller_bt_node
  76. - nav2_truncate_path_action_bt_node
  77. - nav2_goal_updater_node_bt_node
  78. - nav2_recovery_node_bt_node
  79. - nav2_pipeline_sequence_bt_node
  80. - nav2_round_robin_node_bt_node
  81. - nav2_transform_available_condition_bt_node
  82. - nav2_time_expired_condition_bt_node
  83. - nav2_distance_traveled_condition_bt_node
  84. - nav2_single_trigger_bt_node
  85. - nav2_is_battery_low_condition_bt_node
  86. - nav2_navigate_through_poses_action_bt_node
  87. - nav2_navigate_to_pose_action_bt_node
  88. - nav2_remove_passed_goals_action_bt_node
  89. - nav2_planner_selector_bt_node
  90. - nav2_controller_selector_bt_node
  91. - nav2_goal_checker_selector_bt_node
  92. bt_navigator_rclcpp_node:
  93. ros__parameters:
  94. use_sim_time: False
  95. #TEB 局部规划器
  96. controller_server:
  97. ros__parameters:
  98. cmd_vel_topic: cmd_vel
  99. odom_topic: /Odometry
  100. use_sim_time: False
  101. controller_frequency: 12.0
  102. min_x_velocity_threshold: 0.01
  103. min_y_velocity_threshold: 0.01
  104. min_theta_velocity_threshold: 0.02
  105. failure_tolerance: 0.3
  106. progress_checker_plugin: "progress_checker"
  107. goal_checker_plugins: ["goal_checker"]
  108. controller_plugins: ["FollowPath"]
  109. progress_checker:
  110. plugin: "nav2_controller::SimpleProgressChecker"
  111. required_movement_radius: 0.02
  112. movement_time_allowance: 30.0
  113. goal_checker:
  114. stateful: True
  115. plugin: "nav2_controller::SimpleGoalChecker"
  116. xy_goal_tolerance: 0.10
  117. yaw_goal_tolerance: 0.35
  118. FollowPath:
  119. plugin: teb_local_planner::TebLocalPlannerROS
  120. # https://github.com/rst-tu-dortmund/teb_local_planner/tree/ros2-master
  121. #*******************************************************************************
  122. # Trajectory
  123. #*******************************************************************************
  124. teb_autosize: 1.0 #是否自动调整轨迹大小。根据时间分辨率自动调整轨迹大小
  125. dt_ref: 0.12 #进一步提高轨迹分辨率,减少拐角前的直线外推
  126. dt_hysteresis: 0.04 #减小滞后,降低大幅左右摆动
  127. max_samples: 2000 #最大样本数量;警告:如果太小,离散化/分辨率可能不足以用于给定的机器人模型,或者避障不再有效。
  128. global_plan_overwrite_orientation: True #让局部轨迹按路径切线连续跟随,减少前进一下再补角一下
  129. allow_init_with_backwards_motion: False # 返回转角已出现贴墙碰撞,先收回初始化倒车试探
  130. #0107 max_global_plan_lookahead_dist: 10.0
  131. max_global_plan_lookahead_dist: 1.20 #恢复到更平衡的前瞻距离,减少低速段频繁补角和摆头
  132. force_reinit_new_goal_dist: 0.60 #减少频繁重初始化造成的左右切换
  133. force_reinit_new_goal_angular: 0.30 #放宽角度重初始化阈值,减轻摆头
  134. #0107 feasibility_check_no_poses: 5
  135. feasibility_check_no_poses: 5 #可行性检查的路径点数量,更严格检测碰撞 在预测路径上,每个采样间隔需要检查可行性的姿态数目
  136. #0107 feasibility_check_lookahead_distance: 5.0
  137. feasibility_check_lookahead_distance: 3.0 #缩短可行性检查距离,减少远端噪声导致的频繁局部重规划
  138. exact_arc_length: True #拐角时使用更准确弧长,减少离散直段与补角切换
  139. publish_feedback: False #关闭调试反馈,减少额外扰动
  140. visualize_with_time_as_z_axis_scale: 0.0 #在rviz里可看到优化使用的graph
  141. #*******************************************************************************
  142. # ViaPoints 中间点
  143. #*******************************************************************************
  144. global_plan_viapoint_sep: 0.12 #提高拐角处路径点密度,减少“切弯直冲”
  145. via_points_ordered: True #按顺序跟随路径点,降低直线拼接感
  146. #*******************************************************************************
  147. # Robot
  148. #*******************************************************************************
  149. footprint_model:
  150. type: "circular"
  151. radius: 0.35
  152. max_vel_x: 0.10 # 导航线速度下调到 0.10m/s
  153. max_vel_x_backwards: 0.03 # 同步收紧回退速度,避免低速场景下倒车仍偏快
  154. max_vel_theta: 0.20 # 继续保持 2:1 线角速度配比
  155. acc_lim_x: 0.10 # 与新的目标巡航速度对齐,避免起步过猛
  156. acc_lim_theta: 0.20 # 与角速度上限一致,保持转向响应平顺
  157. is_footprint_dynamic: False #如果为真,在检查轨迹可行性之前更新足迹
  158. use_proportional_saturation: False # P0.4: 关闭 TEB 比例饱和,避免与下游补偿链重复压速
  159. transform_tolerance: 0.30 #收紧控制器 TF 容差,减少转弯后按旧姿态投影局部障碍
  160. #*******************************************************************************
  161. # Robot/Carlike 此部分参数仅适用于类似汽车的机器人(如差速驱动机器人)
  162. #*******************************************************************************
  163. min_turning_radius: 0.0 #机器人的最小转弯半径。对于差速驱动机器人,此值为0
  164. wheelbase: 0.0 #驱动轮轴与转向轮轴之间的距离。后轮驱动机器人此值可能为负数。
  165. cmd_angle_instead_rotvel: False #是否用转向角代替控制指令消息中的旋转速度(需要结合轴距参数使用)
  166. #*******************************************************************************
  167. # Robot/Omni 此部分参数仅适用于全方位移动机器人
  168. #*******************************************************************************
  169. max_vel_y: 0.0
  170. acc_lim_y: 0.0
  171. min_vel_y: 0.0 # 先禁用横移,避免局部规划左右横冲
  172. dec_lim_y: 0.0
  173. weight_kinematics_nh: 10.0
  174. weight_max_vel_y: 50.0
  175. weight_acc_lim_y: 50.0
  176. #*******************************************************************************
  177. # GoalTolerance 目标容差
  178. #*******************************************************************************
  179. free_goal_vel: False #允许机器人以最大速度驶向目的地,为False时,车到达终点时的目标速度为0;
  180. xy_goal_tolerance: 0.10 # 与 goal_checker 保持一致,避免终点阶段反复切换
  181. yaw_goal_tolerance: 0.35 # Nav2 只做粗到位,最终朝向交给独立终点控制器精纠姿
  182. #*******************************************************************************
  183. # Obstacles 障碍物
  184. #*******************************************************************************
  185. #0107 min_obstacle_dist: 0.25
  186. min_obstacle_dist: 0.25 # 回退到更平衡的障碍距离,避免局部轨迹被过度挤压
  187. #obstacle_association_force_inclusion_factor: 40 # 距离小于min_obstacle_dist * obstacle_association_force_inclusion_factor值的障碍物点,被强制加入优化框架中
  188. #obstacle_association_cutoff_factor: 80 #距离大于min_sobstacle_dist * obstacle_association_cutoff_factor的障碍物点被直接抛弃不再考虑,然后在剩余的障碍物点中计算机器人左侧最小距离和右侧最小距离。
  189. inflation_dist: 0.30 # 缩小 TEB 膨胀带,减轻窄路中的左右试探
  190. dynamic_obstacle_inflation_dist: 0.20 #减小动态障碍膨胀,降低伪动态障碍放大效应
  191. include_dynamic_obstacles: False #当前未使用动态障碍跟踪插件,关闭预测动态障碍避免阴影残留
  192. include_costmap_obstacles: True #是否直接考虑代价地图中的障碍物 (如果没有单独的聚类和检测功能,则需要此选项)
  193. legacy_obstacle_association: False #是否严格遵循局部规划出来的路径。如果为真,则使用旧的关联策略 (为每个障碍物找到最近的 TEB 姿势),否则使用新的关联策略 (为每个 TEB 姿势仅找到“相关”障碍物)
  194. #0107 costmap_obstacles_behind_robot_dist: 0.8
  195. costmap_obstacles_behind_robot_dist: 0.25 # 新布局后后向几何更偏左,适度恢复后方障碍考虑距离
  196. obstacle_poses_affected: 10 #减少受障碍影响的轨迹点,降低局部震荡
  197. dynamic_obstacle_min_speed: 0.01 # 过滤低速动态障碍(如晃动的树枝),避免误判
  198. dynamic_obstacle_max_speed: 8.0 # 适配高速动态障碍(如行人、小车)
  199. # costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSMCCH"
  200. #costmap_converter_spin_thread: True
  201. #costmap_converter_rate: 10
  202. #*******************************************************************************
  203. # Obstacle - Velocity ratio parameters 该组包含用于根据障碍物 proximity 动态调整机器人速度的设置。
  204. #*******************************************************************************
  205. obstacle_proximity_ratio_max_vel: 0.35 # 放宽侧向邻障限速,避免窄路和会车时长期压在 0.1~0.2m/s
  206. obstacle_proximity_lower_bound: 0.18
  207. obstacle_proximity_upper_bound: 0.55
  208. #*******************************************************************************
  209. # Optimization 优化
  210. #*******************************************************************************
  211. no_inner_iterations: 15 #在外循环每次迭代中调用求解器迭代的次数
  212. no_outer_iterations: 10 #外循环每次迭代会自动调整轨迹大小,并使用指定的内部迭代次数调用内部优化器
  213. optimization_activate: True #启用优化功能
  214. optimization_verbose: False #打印详细的优化过程信息
  215. penalty_epsilon: 0.02 #避免与极小后退速度配置冲突,减少优化器异常警告
  216. #truncate_pose_distance: 3.0 # 新增,截断距离机器人0.5米外的无效路径,专注前方障碍
  217. # 权重参数
  218. obstacle_cost_exponent: 4.0
  219. weight_max_vel_x: 5.0 # 提高速度约束,防止速度被不断抬高
  220. weight_max_vel_theta: 3.0 # 适度降低角速度惩罚,允许拐角更积极转向
  221. weight_acc_lim_x: 2.5 # 恢复加速度惩罚,压住越跑越快
  222. weight_acc_lim_theta: 2.0 # 降低角加速度惩罚,减少角速度起落过慢
  223. weight_kinematics_forward_drive: 0.2 # 明显降低纯前进偏置,允许更自然的弧线和倒车修姿态
  224. weight_kinematics_turning_radius: 0.0 #强制最小转弯半径(小车型机器人)的优化权重
  225. weight_optimaltime: 0.5 # 进一步降低抢时间倾向,优先稳定
  226. weight_shortest_path: 0.5 #进一步降低最短路偏好,减少贴边切弯
  227. weight_obstacle: 120.0 # 维持较高障碍惩罚,但避免轨迹被挤得来回跳
  228. weight_inflation: 0.5 #优化轨迹并尽量避免膨胀区域的权重 (权重应设置较小)
  229. weight_dynamic_obstacle: 80.0 #降低动态障碍权重,避免局部规划被伪目标牵制
  230. weight_dynamic_obstacle_inflation: 1.0 #降低动态膨胀区影响
  231. weight_viapoint: 6.0 #让局部规划更愿意贴全局拐角路径而不是直切
  232. weight_adapt_factor: 1.5 #非线性障碍物代价的指数 (cost = linear_cost * obstacle_cost_exponent)。设置为 1 则禁用非线性代价 (默认值)
  233. #*******************************************************************************
  234. # Homotopy Class Planner
  235. #*******************************************************************************
  236. enable_homotopy_class_planning: False
  237. enable_multithreading: False #关闭多候选路径,先保证短距离跟踪稳定
  238. max_number_classes: 2 #保留较小候选数,避免频繁切换
  239. selection_cost_hysteresis: 1.0
  240. selection_prefer_initial_plan: 1.0
  241. selection_obst_cost_scale: 2.0
  242. selection_alternative_time_cost: False
  243. roadmap_graph_no_samples: 15 #指定为创建路线图而生成的样本数
  244. roadmap_graph_area_width: 5.0 #指定该区域的宽度
  245. roadmap_graph_area_length_scale: 1.0 #矩形区域的长度由起点和终点之间的距离决定。该参数会进一步缩放距离,使几何中心保持不变
  246. h_signature_prescaler: 0.5 #(0.2 < value <= 1)缩放用于区分同伦类的内部参数
  247. h_signature_threshold: 0.1 #如果实部和复部的差都低于规定的阈值,则假定两个h签名相等。
  248. obstacle_heading_threshold: 0.45 #为了将障碍物纳入探索范围,需要指定障碍物朝向和目标朝向的归一化点积的阈值
  249. switching_blocking_period: 1.5 #适中限制切换,降低轨迹锁死后的大幅纠偏
  250. viapoints_all_candidates: False #减少候选路径扰动,优先跟随当前稳定局部轨迹
  251. delete_detours_backwards: True
  252. max_ratio_detours_duration_best_duration: 3.0
  253. visualize_hc_graph: False #可视化用于探索新拓扑类的图
  254. shrink_horizon_backup: False #关闭 TEB 自带回退恢复,避免掉头时前后乱冲
  255. oscillation_recovery: False #关闭振荡恢复,避免局部规划反复触发试探动作
  256. #*******************************************************************************
  257. # Recovery
  258. #*******************************************************************************https://gitee.com/junhui-wang/light-map-navigation/invite_link?invite=2516aae5817802833fb03ca9138f1aaa05d0c8c29c41327eb7993663152babc5ad337913d8be2e1203eac9232b9ccfc5
  259. oscillation_omega_eps: 0.1 #(0,1)内的 normalized 角速度的平均值,判断机器人是否运动异常
  260. oscillation_recovery_min_duration: 5.0 #在这个时间内,是否再次发生FailureDetector检测的振荡
  261. oscillation_filter_duration: 5.0 #failure_detector_中buffer容器的大小为oscillation_filter_duration * controller_frequency
  262. controller_server_rclcpp_node:
  263. ros__parameters:
  264. use_sim_time: False
  265. local_costmap:
  266. local_costmap:
  267. ros__parameters:
  268. update_frequency: 8.0
  269. publish_frequency: 5.0
  270. global_frame: lidar_odom
  271. robot_base_frame: base_link
  272. use_sim_time: False
  273. rolling_window: true
  274. #0107 width: 8
  275. #0107 height: 8
  276. width: 8 #局部代价地图宽度
  277. height: 8 #局部代价地图高度
  278. transform_tolerance: 0.30 # 收紧局部图 TF 容差,减少转弯后局部图拖影与错位
  279. resolution: 0.05
  280. footprint: "[[0.34, 0.16], [0.16, 0.34], [-0.16, 0.34], [-0.34, 0.16], [-0.34, -0.16], [-0.16, -0.34], [0.16, -0.34], [0.34, -0.16]]"
  281. footprint_padding: 0.02
  282. plugins: ["obstacle_layer", "inflation_layer"]
  283. obstacle_layer:
  284. plugin: "nav2_costmap_2d::ObstacleLayer"
  285. enabled: true
  286. # Keep the local obstacle layer on the lidar-based scan only. The ultrasonic
  287. # points are valuable for very-near stop behavior, but in practice they
  288. # introduce a left/right asymmetry that keeps steering the chassis off-line.
  289. observation_sources: scan low_obstacle_cloud
  290. scan:
  291. # Use a dedicated, milder filtered scan for the local costmap. The raw
  292. # scan reintroduces false corridor walls, while the aggressive filtered
  293. # scan suppresses too many front bins and destabilizes turning.
  294. topic: /scan_local_costmap_filtered
  295. #0107 raytrace_max_range: 12.0
  296. raytrace_max_range: 5.0 #适度保留清除范围,避免局部图剧烈闪动
  297. #0107 obstacle_max_range: 12.0
  298. obstacle_max_range: 4.0 #略收回障碍感知距离,减轻远端噪声牵引
  299. obstacle_min_range: 0.05
  300. max_obstacle_height: 1.0
  301. min_obstacle_height: -0.05
  302. #0107 clearing: false
  303. clearing: true #激光清除功能,避免残留障碍物标记
  304. marking: true
  305. inf_is_valid: true
  306. data_type: "LaserScan"
  307. combination_method: 1 # 保留障碍合并,避免零散点云干扰
  308. ultrasonic_points:
  309. topic: /ultrasonic/points
  310. data_type: "PointCloud2"
  311. raytrace_max_range: 0.6
  312. obstacle_max_range: 0.45
  313. obstacle_min_range: 0.05
  314. max_obstacle_height: 0.4
  315. min_obstacle_height: -0.2
  316. clearing: true
  317. marking: true
  318. inf_is_valid: false
  319. expected_update_rate: 8.0
  320. observation_persistence: 0.10
  321. low_obstacle_cloud:
  322. topic: /segmentation/obstacle
  323. data_type: "PointCloud2"
  324. obstacle_max_range: 1.6
  325. obstacle_min_range: 0.10
  326. raytrace_max_range: 0.0
  327. max_obstacle_height: 0.45
  328. min_obstacle_height: 0.02
  329. clearing: false
  330. marking: true
  331. inf_is_valid: false
  332. expected_update_rate: 0.0
  333. observation_persistence: 0.10
  334. inflation_layer:
  335. plugin: "nav2_costmap_2d::InflationLayer"
  336. #0107 cost_scaling_factor: 50.0
  337. cost_scaling_factor: 25.0
  338. inflation_radius: 0.38
  339. enable_gradient: true
  340. always_send_full_costmap: false
  341. local_costmap_rclcpp_node:
  342. ros__parameters:
  343. use_sim_time: False
  344. #全局代价地图 STVL 体素层
  345. global_costmap:
  346. global_costmap:
  347. ros__parameters:
  348. #0107 update_frequency: 4.0
  349. update_frequency: 4.0
  350. publish_frequency: 2.0
  351. global_frame: map
  352. robot_base_frame: base_link
  353. use_sim_time: False
  354. footprint: "[[0.34, 0.16], [0.16, 0.34], [-0.16, 0.34], [-0.34, 0.16], [-0.34, -0.16], [-0.16, -0.34], [0.16, -0.34], [0.34, -0.16]]"
  355. footprint_padding: 0.02
  356. resolution: 0.05
  357. track_unknown_space: true
  358. plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
  359. stvl_layer:
  360. plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"
  361. # https://github.com/SteveMacenski/spatio_temporal_voxel_layer
  362. enabled: false
  363. #voxel_decay: 1.5
  364. voxel_decay: 1.5 # 延长体素保留时间,避免障碍忽隐忽现
  365. decay_model: 1 # 衰减模型,0=线性,1=指数,-1=持久
  366. #voxel_size: 0.02
  367. voxel_size: 0.03 # 每个体素的尺寸,单位为米
  368. track_unknown_space: true # default space is unknown
  369. mark_threshold: 1 # 过滤单体素毛刺
  370. update_footprint_enabled: true
  371. combination_method: 1 # 采用 max 合并,避免覆盖静态层
  372. origin_z: -0.15 # 单位为米
  373. publish_voxel_map: false # default false, 是否发布体素地图
  374. #transform_tolerance: 0.1
  375. transform_tolerance: 0.5 # 单位为秒
  376. mapping_mode: false # default off, saves map not for navigation
  377. map_save_duration: 60.0 # default 60s, how often to autosave
  378. observation_sources: ""
  379. livox_mark:
  380. data_type: PointCloud2
  381. topic: /segmentation/obstacle
  382. marking: true
  383. clearing: false
  384. #0107 obstacle_range: 15.0
  385. obstacle_range: 15.0 # meters 点云障碍物检测范围
  386. min_obstacle_height: 0.002 # default 0, meters
  387. max_obstacle_height: 0.9 # default 3, meters
  388. #expected_update_rate: 20.0
  389. expected_update_rate: 0.0 # default 0, if not updating at this rate at least, remove from buffer
  390. #observation_persistence: 0.5
  391. observation_persistence: 0.20 # 适度保留观测,减少动态障碍闪烁
  392. inf_is_valid: false # default false, for laser scans
  393. filter: "voxel" # default passthrough, apply "voxel", "passthrough", or no filter to sensor data, recommend on
  394. voxel_min_points: 2 # 过滤单点噪声
  395. clear_after_reading: true # default false, clear the buffer after the layer gets readings from it
  396. #Livox360 雷达的垂直视场角限制
  397. livox_clear:
  398. enabled: true # default true, can be toggled on/off with associated service call
  399. data_type: PointCloud2
  400. topic: /segmentation/obstacle
  401. marking: false
  402. clearing: true
  403. max_z: 0.9 # default 10, meters
  404. min_z: -0.05 # default 0, meters
  405. vertical_fov_angle: 1.0 # 垂直视场角,单位为弧度,For 3D lidars it's the symmetric FOV about the planar axis.
  406. vertical_fov_padding: 0.05 # 3D Lidar only. Default 0, in meters
  407. horizontal_fov_angle: 6.29 # 3D 激光雷达水平视场角
  408. #decay_acceleration: 8.0
  409. decay_acceleration: 20.0 # default 0, 1/s^2.
  410. model_type: 1 # 0=深度相机,1=3D激光雷达
  411. static_layer:
  412. plugin: "nav2_costmap_2d::StaticLayer"
  413. footprint_clearing_enabled: True
  414. map_subscribe_transient_local: True
  415. obstacle_layer:
  416. plugin: "nav2_costmap_2d::ObstacleLayer"
  417. enabled: true
  418. observation_sources: scan low_obstacle_cloud
  419. scan:
  420. # Keep the global scan conservative. Raw nav scan improves local turning,
  421. # but in the global costmap it reintroduces false corridor-blocking walls.
  422. topic: /scan_local_filtered
  423. raytrace_max_range: 5.5
  424. obstacle_max_range: 4.5
  425. obstacle_min_range: 0.05
  426. max_obstacle_height: 1.0
  427. min_obstacle_height: -0.05
  428. clearing: true
  429. marking: true
  430. inf_is_valid: true
  431. data_type: "LaserScan"
  432. combination_method: 1
  433. inflation_layer:
  434. plugin: "nav2_costmap_2d::InflationLayer"
  435. cost_scaling_factor: 28.0
  436. inflation_radius: 0.38
  437. enable_gradient: true
  438. always_send_full_costmap: false
  439. global_costmap_rclcpp_node:
  440. ros__parameters:
  441. use_sim_time: False
  442. #全局代价地图 STVL 体素层
  443. planner_server:
  444. ros__parameters:
  445. expected_planner_frequency: 10.0
  446. use_sim_time: False
  447. planner_plugins: ["GridBased"]
  448. GridBased:
  449. plugin: "nav2_navfn_planner/NavfnPlanner"
  450. tolerance: 0.3
  451. use_astar: true
  452. allow_unknown: true
  453. visualize_potential: false # 关闭势能可视化,降低计算量
  454. planner_window_x: 12.0 # 规划窗口大小,适配全向轮大运动范围
  455. planner_window_y: 12.0 # 规划窗口大小
  456. global_costmap:
  457. ros__parameters:
  458. update_frequency: 4.0
  459. publish_frequency: 2.0
  460. global_frame: map
  461. robot_base_frame: base_link
  462. use_sim_time: False
  463. footprint: "[[0.34, 0.16], [0.16, 0.34], [-0.16, 0.34], [-0.34, 0.16], [-0.34, -0.16], [-0.16, -0.34], [0.16, -0.34], [0.34, -0.16]]"
  464. footprint_padding: 0.02
  465. resolution: 0.05
  466. track_unknown_space: true
  467. plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
  468. stvl_layer:
  469. plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"
  470. # https://github.com/SteveMacenski/spatio_temporal_voxel_layer
  471. enabled: false
  472. voxel_decay: 1.5 # 延长体素保留时间,避免障碍忽隐忽现
  473. decay_model: 1 # 衰减模型,0=线性,1=指数,-1=持久
  474. voxel_size: 0.03 # 每个体素的尺寸,单位为米
  475. track_unknown_space: true # default space is unknown
  476. mark_threshold: 1 # 过滤单体素毛刺
  477. update_footprint_enabled: true
  478. combination_method: 1 # 采用 max 合并,避免覆盖静态层
  479. origin_z: -0.15 # 单位为米
  480. publish_voxel_map: false # default false, 是否发布体素地图
  481. transform_tolerance: 0.5 # 单位为秒
  482. mapping_mode: false # default off, saves map not for navigation
  483. map_save_duration: 60.0 # default 60s, how often to autosave
  484. observation_sources: ""
  485. livox_mark:
  486. data_type: PointCloud2
  487. topic: /segmentation/obstacle
  488. marking: true
  489. clearing: false
  490. obstacle_range: 15.0 # meters 点云障碍物检测范围
  491. min_obstacle_height: 0.002 # default 0, meters
  492. max_obstacle_height: 0.9 # default 3, meters
  493. expected_update_rate: 0.0 # default 0, if not updating at this rate at least, remove from buffer
  494. observation_persistence: 0.20 # 适度保留观测,减少动态障碍闪烁
  495. inf_is_valid: false # default false, for laser scans
  496. filter: "voxel" # default passthrough, apply "voxel", "passthrough", or no filter to sensor data, recommend on
  497. voxel_min_points: 2 # 过滤单点噪声
  498. clear_after_reading: true # default false, clear the buffer after the layer gets readings from it
  499. #Livox360 雷达的垂直视场角限制
  500. livox_clear:
  501. enabled: true # default true, can be toggled on/off with associated service call
  502. data_type: PointCloud2
  503. topic: /segmentation/obstacle
  504. marking: false
  505. clearing: true
  506. max_z: 0.9 # default 10, meters
  507. min_z: -0.05 # default 0, meters
  508. vertical_fov_angle: 1.0 # 垂直视场角,单位为弧度,For 3D lidars it's the symmetric FOV about the planar axis.
  509. vertical_fov_padding: 0.05 # 3D Lidar only. Default 0, in meters
  510. horizontal_fov_angle: 6.29 # 3D 激光雷达水平视场角
  511. decay_acceleration: 20.0 # default 0, 1/s^2.
  512. model_type: 1 # 0=深度相机,1=3D激光雷达
  513. static_layer:
  514. plugin: "nav2_costmap_2d::StaticLayer"
  515. footprint_clearing_enabled: True
  516. map_subscribe_transient_local: True
  517. obstacle_layer:
  518. plugin: "nav2_costmap_2d::ObstacleLayer"
  519. enabled: true
  520. observation_sources: scan low_obstacle_cloud
  521. scan:
  522. topic: /scan_local_filtered
  523. raytrace_max_range: 5.5
  524. obstacle_max_range: 4.5
  525. obstacle_min_range: 0.05
  526. max_obstacle_height: 1.0
  527. min_obstacle_height: -0.05
  528. clearing: true
  529. marking: true
  530. inf_is_valid: true
  531. data_type: "LaserScan"
  532. combination_method: 1
  533. inflation_layer:
  534. plugin: "nav2_costmap_2d::InflationLayer"
  535. cost_scaling_factor: 28.0
  536. inflation_radius: 0.38
  537. enable_gradient: true
  538. always_send_full_costmap: false
  539. map_saver:
  540. ros__parameters:
  541. use_sim_time: False
  542. save_map_timeout: 5.0
  543. free_thresh_default: 0.25
  544. occupied_thresh_default: 0.65
  545. # map_subscribe_transient_local: True
  546. #恢复行为
  547. behavior_server:
  548. ros__parameters:
  549. costmap_topic: local_costmap/costmap_raw
  550. footprint_topic: local_costmap/published_footprint
  551. cycle_frequency: 5.0
  552. behavior_plugins: ["spin", "backup", "wait"]
  553. movement_time_allowance: 15.0 # 略放宽恢复触发,避免转角低速挪动被过早判定失败
  554. spin:
  555. plugin: "nav2_behaviors/Spin"
  556. backup:
  557. plugin: "nav2_behaviors/BackUp"
  558. backup_dist: 0.15
  559. backup_speed: 0.15
  560. wait:
  561. plugin: "nav2_behaviors/Wait"
  562. wait_time: 0.1 # 新增:等待1秒,让动态障碍移动
  563. global_frame: lidar_odom
  564. robot_base_frame: base_link
  565. transform_timeout: 0.5
  566. use_sim_time: False
  567. simulate_ahead_time: 1.0
  568. max_rotational_vel: 0.25
  569. min_rotational_vel: 0.10
  570. rotational_acc_lim: 0.50
  571. smoother_server:
  572. ros__parameters:
  573. use_sim_time: False
  574. smoother_plugins: ["SimpleSmoother"]
  575. SimpleSmoother:
  576. plugin: "nav2_smoother::SimpleSmoother"
  577. tolerance: 1.0e-10
  578. max_its: 1000
  579. do_refinement: True
  580. waypoint_follower:
  581. ros__parameters:
  582. loop_rate: 20
  583. stop_on_failure: false
  584. waypoint_task_executor_plugin: "wait_at_waypoint"
  585. wait_at_waypoint:
  586. plugin: "nav2_waypoint_follower::WaitAtWaypoint"
  587. enabled: True
  588. waypoint_pause_duration: 200
  589. map_server:
  590. ros__parameters:
  591. use_sim_time: False
  592. yaml_filename: ""
  593. velocity_smoother:
  594. ros__parameters:
  595. smoothing_frequency: 20.0
  596. scale_velocities: False
  597. feedback: "OPEN_LOOP"
  598. max_velocity: [0.10, 0.00, 0.20]
  599. min_velocity: [0.00, 0.00, -0.20]
  600. deadband_velocity: [0.02, 0.0, 0.02] # 增大线速度死区,抑制微小前后爬行
  601. velocity_timeout: 0.20 # 更快归零,降低到点后和碰撞前继续前冲
  602. max_accel: [0.10, 0.00, 0.20]
  603. max_decel: [-0.18, 0.00, -0.30]
  604. odom_topic: "/Odometry"
  605. odom_duration: 0.05