| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640 |
- amcl:
- ros__parameters:
- use_sim_time: False
- alpha1: 0.04 # 减少旋转阶段的粒子发散,降低掉头收尾时的定位抖动
- alpha2: 0.04
- alpha3: 0.06
- alpha4: 0.06
- alpha5: 0.03
- base_frame_id: "base_footprint"
- beam_skip_distance: 0.3
- beam_skip_error_threshold: 0.8
- beam_skip_threshold: 0.25
- do_beamskip: false
- global_frame_id: "map"
- lambda_short: 0.1
- #0107 laser_likelihood_max_dist: 4.0
- laser_likelihood_max_dist: 4.0 #激光匹配最大距离
- laser_max_range: 8.0
- laser_min_range: 0.20
- laser_model_type: "beam"
- max_beams: 64
- max_particles: 2000
- min_particles: 300
- odom_frame_id: "lidar_odom"
- pf_err: 0.03
- pf_z: 0.99
- recovery_alpha_fast: 0.0
- recovery_alpha_slow: 0.0
- resample_interval: 2
- robot_model_type: "nav2_amcl::OmniMotionModel"
- save_pose_rate: 0.5
- sigma_hit: 0.20
- tf_broadcast: true
- transform_tolerance: 0.30
- # Keep AMCL publishing during low-speed stop-go motion so map->odom does
- # not age into multi-second stale output between small controller updates.
- update_min_a: 0.02
- update_min_d: 0.02
- z_hit: 0.75
- z_max: 0.05
- z_rand: 0.20
- z_short: 0.00
- scan_topic: scan
- amcl_map_client:
- ros__parameters:
- use_sim_time: False
- amcl_rclcpp_node:
- ros__parameters:
- use_sim_time: False
- #BT 导航树
- bt_navigator:
- ros__parameters:
- use_sim_time: False
- global_frame: map
- robot_base_frame: base_link
- odom_topic: /Odometry
- bt_loop_duration: 10
- default_server_timeout: 15
- plugin_lib_names:
- - nav2_compute_path_to_pose_action_bt_node
- - nav2_compute_path_through_poses_action_bt_node
- - nav2_smooth_path_action_bt_node
- - nav2_follow_path_action_bt_node
- - nav2_back_up_action_bt_node
- - nav2_spin_action_bt_node
- - nav2_wait_action_bt_node
- - nav2_clear_costmap_service_bt_node
- - nav2_is_stuck_condition_bt_node
- - nav2_goal_reached_condition_bt_node
- - nav2_goal_updated_condition_bt_node
- - nav2_initial_pose_received_condition_bt_node
- - nav2_reinitialize_global_localization_service_bt_node
- - nav2_rate_controller_bt_node
- - nav2_distance_controller_bt_node
- - nav2_speed_controller_bt_node
- - nav2_truncate_path_action_bt_node
- - nav2_goal_updater_node_bt_node
- - nav2_recovery_node_bt_node
- - nav2_pipeline_sequence_bt_node
- - nav2_round_robin_node_bt_node
- - nav2_transform_available_condition_bt_node
- - nav2_time_expired_condition_bt_node
- - nav2_distance_traveled_condition_bt_node
- - nav2_single_trigger_bt_node
- - nav2_is_battery_low_condition_bt_node
- - nav2_navigate_through_poses_action_bt_node
- - nav2_navigate_to_pose_action_bt_node
- - nav2_remove_passed_goals_action_bt_node
- - nav2_planner_selector_bt_node
- - nav2_controller_selector_bt_node
- - nav2_goal_checker_selector_bt_node
- bt_navigator_rclcpp_node:
- ros__parameters:
- use_sim_time: False
- #TEB 局部规划器
- controller_server:
- ros__parameters:
- cmd_vel_topic: cmd_vel
- odom_topic: /Odometry
- use_sim_time: False
- controller_frequency: 12.0
- min_x_velocity_threshold: 0.01
- min_y_velocity_threshold: 0.01
- min_theta_velocity_threshold: 0.02
- failure_tolerance: 0.3
- progress_checker_plugin: "progress_checker"
- goal_checker_plugins: ["goal_checker"]
- controller_plugins: ["FollowPath"]
- progress_checker:
- plugin: "nav2_controller::SimpleProgressChecker"
- required_movement_radius: 0.02
- movement_time_allowance: 30.0
- goal_checker:
- stateful: True
- plugin: "nav2_controller::SimpleGoalChecker"
- xy_goal_tolerance: 0.10
- yaw_goal_tolerance: 0.35
- FollowPath:
- plugin: teb_local_planner::TebLocalPlannerROS
- # https://github.com/rst-tu-dortmund/teb_local_planner/tree/ros2-master
- #*******************************************************************************
- # Trajectory
- #*******************************************************************************
- teb_autosize: 1.0 #是否自动调整轨迹大小。根据时间分辨率自动调整轨迹大小
- dt_ref: 0.12 #进一步提高轨迹分辨率,减少拐角前的直线外推
- dt_hysteresis: 0.04 #减小滞后,降低大幅左右摆动
- max_samples: 2000 #最大样本数量;警告:如果太小,离散化/分辨率可能不足以用于给定的机器人模型,或者避障不再有效。
- global_plan_overwrite_orientation: True #让局部轨迹按路径切线连续跟随,减少前进一下再补角一下
- allow_init_with_backwards_motion: False # 返回转角已出现贴墙碰撞,先收回初始化倒车试探
- #0107 max_global_plan_lookahead_dist: 10.0
- max_global_plan_lookahead_dist: 1.20 #恢复到更平衡的前瞻距离,减少低速段频繁补角和摆头
-
- force_reinit_new_goal_dist: 0.60 #减少频繁重初始化造成的左右切换
- force_reinit_new_goal_angular: 0.30 #放宽角度重初始化阈值,减轻摆头
- #0107 feasibility_check_no_poses: 5
- feasibility_check_no_poses: 5 #可行性检查的路径点数量,更严格检测碰撞 在预测路径上,每个采样间隔需要检查可行性的姿态数目
- #0107 feasibility_check_lookahead_distance: 5.0
- feasibility_check_lookahead_distance: 3.0 #缩短可行性检查距离,减少远端噪声导致的频繁局部重规划
-
- exact_arc_length: True #拐角时使用更准确弧长,减少离散直段与补角切换
- publish_feedback: False #关闭调试反馈,减少额外扰动
- visualize_with_time_as_z_axis_scale: 0.0 #在rviz里可看到优化使用的graph
- #*******************************************************************************
- # ViaPoints 中间点
- #*******************************************************************************
- global_plan_viapoint_sep: 0.12 #提高拐角处路径点密度,减少“切弯直冲”
- via_points_ordered: True #按顺序跟随路径点,降低直线拼接感
- #*******************************************************************************
- # Robot
- #*******************************************************************************
- footprint_model:
- type: "circular"
- radius: 0.35
- max_vel_x: 0.10 # 导航线速度下调到 0.10m/s
- max_vel_x_backwards: 0.03 # 同步收紧回退速度,避免低速场景下倒车仍偏快
- max_vel_theta: 0.20 # 继续保持 2:1 线角速度配比
- acc_lim_x: 0.10 # 与新的目标巡航速度对齐,避免起步过猛
- acc_lim_theta: 0.20 # 与角速度上限一致,保持转向响应平顺
- is_footprint_dynamic: False #如果为真,在检查轨迹可行性之前更新足迹
- use_proportional_saturation: False # P0.4: 关闭 TEB 比例饱和,避免与下游补偿链重复压速
- transform_tolerance: 0.30 #收紧控制器 TF 容差,减少转弯后按旧姿态投影局部障碍
- #*******************************************************************************
- # Robot/Carlike 此部分参数仅适用于类似汽车的机器人(如差速驱动机器人)
- #*******************************************************************************
- min_turning_radius: 0.0 #机器人的最小转弯半径。对于差速驱动机器人,此值为0
- wheelbase: 0.0 #驱动轮轴与转向轮轴之间的距离。后轮驱动机器人此值可能为负数。
- cmd_angle_instead_rotvel: False #是否用转向角代替控制指令消息中的旋转速度(需要结合轴距参数使用)
- #*******************************************************************************
- # Robot/Omni 此部分参数仅适用于全方位移动机器人
- #*******************************************************************************
- max_vel_y: 0.0
- acc_lim_y: 0.0
- min_vel_y: 0.0 # 先禁用横移,避免局部规划左右横冲
- dec_lim_y: 0.0
- weight_kinematics_nh: 10.0
- weight_max_vel_y: 50.0
- weight_acc_lim_y: 50.0
- #*******************************************************************************
- # GoalTolerance 目标容差
- #*******************************************************************************
- free_goal_vel: False #允许机器人以最大速度驶向目的地,为False时,车到达终点时的目标速度为0;
- xy_goal_tolerance: 0.10 # 与 goal_checker 保持一致,避免终点阶段反复切换
- yaw_goal_tolerance: 0.35 # Nav2 只做粗到位,最终朝向交给独立终点控制器精纠姿
- #*******************************************************************************
- # Obstacles 障碍物
- #*******************************************************************************
- #0107 min_obstacle_dist: 0.25
- min_obstacle_dist: 0.25 # 回退到更平衡的障碍距离,避免局部轨迹被过度挤压
- #obstacle_association_force_inclusion_factor: 40 # 距离小于min_obstacle_dist * obstacle_association_force_inclusion_factor值的障碍物点,被强制加入优化框架中
- #obstacle_association_cutoff_factor: 80 #距离大于min_sobstacle_dist * obstacle_association_cutoff_factor的障碍物点被直接抛弃不再考虑,然后在剩余的障碍物点中计算机器人左侧最小距离和右侧最小距离。
- inflation_dist: 0.30 # 缩小 TEB 膨胀带,减轻窄路中的左右试探
- dynamic_obstacle_inflation_dist: 0.20 #减小动态障碍膨胀,降低伪动态障碍放大效应
- include_dynamic_obstacles: False #当前未使用动态障碍跟踪插件,关闭预测动态障碍避免阴影残留
- include_costmap_obstacles: True #是否直接考虑代价地图中的障碍物 (如果没有单独的聚类和检测功能,则需要此选项)
- legacy_obstacle_association: False #是否严格遵循局部规划出来的路径。如果为真,则使用旧的关联策略 (为每个障碍物找到最近的 TEB 姿势),否则使用新的关联策略 (为每个 TEB 姿势仅找到“相关”障碍物)
- #0107 costmap_obstacles_behind_robot_dist: 0.8
- costmap_obstacles_behind_robot_dist: 0.25 # 新布局后后向几何更偏左,适度恢复后方障碍考虑距离
- obstacle_poses_affected: 10 #减少受障碍影响的轨迹点,降低局部震荡
- dynamic_obstacle_min_speed: 0.01 # 过滤低速动态障碍(如晃动的树枝),避免误判
- dynamic_obstacle_max_speed: 8.0 # 适配高速动态障碍(如行人、小车)
- # costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSMCCH"
- #costmap_converter_spin_thread: True
- #costmap_converter_rate: 10
- #*******************************************************************************
- # Obstacle - Velocity ratio parameters 该组包含用于根据障碍物 proximity 动态调整机器人速度的设置。
- #*******************************************************************************
- obstacle_proximity_ratio_max_vel: 0.35 # 放宽侧向邻障限速,避免窄路和会车时长期压在 0.1~0.2m/s
- obstacle_proximity_lower_bound: 0.18
- obstacle_proximity_upper_bound: 0.55
- #*******************************************************************************
- # Optimization 优化
- #*******************************************************************************
- no_inner_iterations: 15 #在外循环每次迭代中调用求解器迭代的次数
- no_outer_iterations: 10 #外循环每次迭代会自动调整轨迹大小,并使用指定的内部迭代次数调用内部优化器
- optimization_activate: True #启用优化功能
- optimization_verbose: False #打印详细的优化过程信息
- penalty_epsilon: 0.02 #避免与极小后退速度配置冲突,减少优化器异常警告
- #truncate_pose_distance: 3.0 # 新增,截断距离机器人0.5米外的无效路径,专注前方障碍
- # 权重参数
- obstacle_cost_exponent: 4.0
- weight_max_vel_x: 5.0 # 提高速度约束,防止速度被不断抬高
- weight_max_vel_theta: 3.0 # 适度降低角速度惩罚,允许拐角更积极转向
- weight_acc_lim_x: 2.5 # 恢复加速度惩罚,压住越跑越快
- weight_acc_lim_theta: 2.0 # 降低角加速度惩罚,减少角速度起落过慢
- weight_kinematics_forward_drive: 0.2 # 明显降低纯前进偏置,允许更自然的弧线和倒车修姿态
- weight_kinematics_turning_radius: 0.0 #强制最小转弯半径(小车型机器人)的优化权重
- weight_optimaltime: 0.5 # 进一步降低抢时间倾向,优先稳定
- weight_shortest_path: 0.5 #进一步降低最短路偏好,减少贴边切弯
- weight_obstacle: 120.0 # 维持较高障碍惩罚,但避免轨迹被挤得来回跳
- weight_inflation: 0.5 #优化轨迹并尽量避免膨胀区域的权重 (权重应设置较小)
- weight_dynamic_obstacle: 80.0 #降低动态障碍权重,避免局部规划被伪目标牵制
- weight_dynamic_obstacle_inflation: 1.0 #降低动态膨胀区影响
- weight_viapoint: 6.0 #让局部规划更愿意贴全局拐角路径而不是直切
- weight_adapt_factor: 1.5 #非线性障碍物代价的指数 (cost = linear_cost * obstacle_cost_exponent)。设置为 1 则禁用非线性代价 (默认值)
- #*******************************************************************************
- # Homotopy Class Planner
- #*******************************************************************************
- enable_homotopy_class_planning: False
- enable_multithreading: False #关闭多候选路径,先保证短距离跟踪稳定
- max_number_classes: 2 #保留较小候选数,避免频繁切换
- selection_cost_hysteresis: 1.0
- selection_prefer_initial_plan: 1.0
- selection_obst_cost_scale: 2.0
- selection_alternative_time_cost: False
- roadmap_graph_no_samples: 15 #指定为创建路线图而生成的样本数
- roadmap_graph_area_width: 5.0 #指定该区域的宽度
- roadmap_graph_area_length_scale: 1.0 #矩形区域的长度由起点和终点之间的距离决定。该参数会进一步缩放距离,使几何中心保持不变
- h_signature_prescaler: 0.5 #(0.2 < value <= 1)缩放用于区分同伦类的内部参数
- h_signature_threshold: 0.1 #如果实部和复部的差都低于规定的阈值,则假定两个h签名相等。
- obstacle_heading_threshold: 0.45 #为了将障碍物纳入探索范围,需要指定障碍物朝向和目标朝向的归一化点积的阈值
- switching_blocking_period: 1.5 #适中限制切换,降低轨迹锁死后的大幅纠偏
- viapoints_all_candidates: False #减少候选路径扰动,优先跟随当前稳定局部轨迹
- delete_detours_backwards: True
- max_ratio_detours_duration_best_duration: 3.0
- visualize_hc_graph: False #可视化用于探索新拓扑类的图
- shrink_horizon_backup: False #关闭 TEB 自带回退恢复,避免掉头时前后乱冲
- oscillation_recovery: False #关闭振荡恢复,避免局部规划反复触发试探动作
- #*******************************************************************************
- # Recovery
- #*******************************************************************************https://gitee.com/junhui-wang/light-map-navigation/invite_link?invite=2516aae5817802833fb03ca9138f1aaa05d0c8c29c41327eb7993663152babc5ad337913d8be2e1203eac9232b9ccfc5
- oscillation_omega_eps: 0.1 #(0,1)内的 normalized 角速度的平均值,判断机器人是否运动异常
- oscillation_recovery_min_duration: 5.0 #在这个时间内,是否再次发生FailureDetector检测的振荡
- oscillation_filter_duration: 5.0 #failure_detector_中buffer容器的大小为oscillation_filter_duration * controller_frequency
- controller_server_rclcpp_node:
- ros__parameters:
- use_sim_time: False
- local_costmap:
- local_costmap:
- ros__parameters:
- update_frequency: 8.0
- publish_frequency: 5.0
- global_frame: lidar_odom
- robot_base_frame: base_link
- use_sim_time: False
- rolling_window: true
- #0107 width: 8
- #0107 height: 8
- width: 8 #局部代价地图宽度
- height: 8 #局部代价地图高度
- transform_tolerance: 0.30 # 收紧局部图 TF 容差,减少转弯后局部图拖影与错位
- resolution: 0.05
- 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]]"
- footprint_padding: 0.02
- plugins: ["obstacle_layer", "inflation_layer"]
- obstacle_layer:
- plugin: "nav2_costmap_2d::ObstacleLayer"
- enabled: true
- # Keep the local obstacle layer on the lidar-based scan only. The ultrasonic
- # points are valuable for very-near stop behavior, but in practice they
- # introduce a left/right asymmetry that keeps steering the chassis off-line.
- observation_sources: scan low_obstacle_cloud
- scan:
- # Use a dedicated, milder filtered scan for the local costmap. The raw
- # scan reintroduces false corridor walls, while the aggressive filtered
- # scan suppresses too many front bins and destabilizes turning.
- topic: /scan_local_costmap_filtered
- #0107 raytrace_max_range: 12.0
- raytrace_max_range: 5.0 #适度保留清除范围,避免局部图剧烈闪动
- #0107 obstacle_max_range: 12.0
- obstacle_max_range: 4.0 #略收回障碍感知距离,减轻远端噪声牵引
- obstacle_min_range: 0.05
- max_obstacle_height: 1.0
- min_obstacle_height: -0.05
- #0107 clearing: false
- clearing: true #激光清除功能,避免残留障碍物标记
- marking: true
- inf_is_valid: true
- data_type: "LaserScan"
- combination_method: 1 # 保留障碍合并,避免零散点云干扰
- ultrasonic_points:
- topic: /ultrasonic/points
- data_type: "PointCloud2"
- raytrace_max_range: 0.6
- obstacle_max_range: 0.45
- obstacle_min_range: 0.05
- max_obstacle_height: 0.4
- min_obstacle_height: -0.2
- clearing: true
- marking: true
- inf_is_valid: false
- expected_update_rate: 8.0
- observation_persistence: 0.10
- low_obstacle_cloud:
- topic: /segmentation/obstacle
- data_type: "PointCloud2"
- obstacle_max_range: 1.6
- obstacle_min_range: 0.10
- raytrace_max_range: 0.0
- max_obstacle_height: 0.45
- min_obstacle_height: 0.02
- clearing: false
- marking: true
- inf_is_valid: false
- expected_update_rate: 0.0
- observation_persistence: 0.10
- inflation_layer:
- plugin: "nav2_costmap_2d::InflationLayer"
- #0107 cost_scaling_factor: 50.0
- cost_scaling_factor: 25.0
- inflation_radius: 0.38
- enable_gradient: true
- always_send_full_costmap: false
- local_costmap_rclcpp_node:
- ros__parameters:
- use_sim_time: False
- #全局代价地图 STVL 体素层
- global_costmap:
- global_costmap:
- ros__parameters:
- #0107 update_frequency: 4.0
- update_frequency: 4.0
- publish_frequency: 2.0
- global_frame: map
- robot_base_frame: base_link
- use_sim_time: False
- 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]]"
- footprint_padding: 0.02
- resolution: 0.05
- track_unknown_space: true
- plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
- stvl_layer:
- plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"
- # https://github.com/SteveMacenski/spatio_temporal_voxel_layer
- enabled: false
- #voxel_decay: 1.5
- voxel_decay: 1.5 # 延长体素保留时间,避免障碍忽隐忽现
- decay_model: 1 # 衰减模型,0=线性,1=指数,-1=持久
- #voxel_size: 0.02
- voxel_size: 0.03 # 每个体素的尺寸,单位为米
- track_unknown_space: true # default space is unknown
- mark_threshold: 1 # 过滤单体素毛刺
- update_footprint_enabled: true
- combination_method: 1 # 采用 max 合并,避免覆盖静态层
- origin_z: -0.15 # 单位为米
- publish_voxel_map: false # default false, 是否发布体素地图
- #transform_tolerance: 0.1
- transform_tolerance: 0.5 # 单位为秒
- mapping_mode: false # default off, saves map not for navigation
- map_save_duration: 60.0 # default 60s, how often to autosave
- observation_sources: ""
- livox_mark:
- data_type: PointCloud2
- topic: /segmentation/obstacle
- marking: true
- clearing: false
- #0107 obstacle_range: 15.0
- obstacle_range: 15.0 # meters 点云障碍物检测范围
- min_obstacle_height: 0.002 # default 0, meters
- max_obstacle_height: 0.9 # default 3, meters
- #expected_update_rate: 20.0
- expected_update_rate: 0.0 # default 0, if not updating at this rate at least, remove from buffer
- #observation_persistence: 0.5
- observation_persistence: 0.20 # 适度保留观测,减少动态障碍闪烁
- inf_is_valid: false # default false, for laser scans
- filter: "voxel" # default passthrough, apply "voxel", "passthrough", or no filter to sensor data, recommend on
- voxel_min_points: 2 # 过滤单点噪声
- clear_after_reading: true # default false, clear the buffer after the layer gets readings from it
- #Livox360 雷达的垂直视场角限制
- livox_clear:
- enabled: true # default true, can be toggled on/off with associated service call
- data_type: PointCloud2
- topic: /segmentation/obstacle
- marking: false
- clearing: true
- max_z: 0.9 # default 10, meters
- min_z: -0.05 # default 0, meters
- vertical_fov_angle: 1.0 # 垂直视场角,单位为弧度,For 3D lidars it's the symmetric FOV about the planar axis.
- vertical_fov_padding: 0.05 # 3D Lidar only. Default 0, in meters
- horizontal_fov_angle: 6.29 # 3D 激光雷达水平视场角
- #decay_acceleration: 8.0
- decay_acceleration: 20.0 # default 0, 1/s^2.
- model_type: 1 # 0=深度相机,1=3D激光雷达
- static_layer:
- plugin: "nav2_costmap_2d::StaticLayer"
- footprint_clearing_enabled: True
- map_subscribe_transient_local: True
- obstacle_layer:
- plugin: "nav2_costmap_2d::ObstacleLayer"
- enabled: true
- observation_sources: scan low_obstacle_cloud
- scan:
- # Keep the global scan conservative. Raw nav scan improves local turning,
- # but in the global costmap it reintroduces false corridor-blocking walls.
- topic: /scan_local_filtered
- raytrace_max_range: 5.5
- obstacle_max_range: 4.5
- obstacle_min_range: 0.05
- max_obstacle_height: 1.0
- min_obstacle_height: -0.05
- clearing: true
- marking: true
- inf_is_valid: true
- data_type: "LaserScan"
- combination_method: 1
- inflation_layer:
- plugin: "nav2_costmap_2d::InflationLayer"
- cost_scaling_factor: 28.0
- inflation_radius: 0.38
- enable_gradient: true
- always_send_full_costmap: false
- global_costmap_rclcpp_node:
- ros__parameters:
- use_sim_time: False
-
- #全局代价地图 STVL 体素层
- planner_server:
- ros__parameters:
- expected_planner_frequency: 10.0
- use_sim_time: False
- planner_plugins: ["GridBased"]
- GridBased:
- plugin: "nav2_navfn_planner/NavfnPlanner"
- tolerance: 0.3
- use_astar: true
- allow_unknown: true
- visualize_potential: false # 关闭势能可视化,降低计算量
- planner_window_x: 12.0 # 规划窗口大小,适配全向轮大运动范围
- planner_window_y: 12.0 # 规划窗口大小
- global_costmap:
- ros__parameters:
- update_frequency: 4.0
- publish_frequency: 2.0
- global_frame: map
- robot_base_frame: base_link
- use_sim_time: False
- 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]]"
- footprint_padding: 0.02
- resolution: 0.05
- track_unknown_space: true
- plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
- stvl_layer:
- plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"
- # https://github.com/SteveMacenski/spatio_temporal_voxel_layer
- enabled: false
- voxel_decay: 1.5 # 延长体素保留时间,避免障碍忽隐忽现
- decay_model: 1 # 衰减模型,0=线性,1=指数,-1=持久
- voxel_size: 0.03 # 每个体素的尺寸,单位为米
- track_unknown_space: true # default space is unknown
- mark_threshold: 1 # 过滤单体素毛刺
- update_footprint_enabled: true
- combination_method: 1 # 采用 max 合并,避免覆盖静态层
- origin_z: -0.15 # 单位为米
- publish_voxel_map: false # default false, 是否发布体素地图
- transform_tolerance: 0.5 # 单位为秒
- mapping_mode: false # default off, saves map not for navigation
- map_save_duration: 60.0 # default 60s, how often to autosave
- observation_sources: ""
- livox_mark:
- data_type: PointCloud2
- topic: /segmentation/obstacle
- marking: true
- clearing: false
- obstacle_range: 15.0 # meters 点云障碍物检测范围
- min_obstacle_height: 0.002 # default 0, meters
- max_obstacle_height: 0.9 # default 3, meters
- expected_update_rate: 0.0 # default 0, if not updating at this rate at least, remove from buffer
- observation_persistence: 0.20 # 适度保留观测,减少动态障碍闪烁
- inf_is_valid: false # default false, for laser scans
- filter: "voxel" # default passthrough, apply "voxel", "passthrough", or no filter to sensor data, recommend on
- voxel_min_points: 2 # 过滤单点噪声
- clear_after_reading: true # default false, clear the buffer after the layer gets readings from it
- #Livox360 雷达的垂直视场角限制
- livox_clear:
- enabled: true # default true, can be toggled on/off with associated service call
- data_type: PointCloud2
- topic: /segmentation/obstacle
- marking: false
- clearing: true
- max_z: 0.9 # default 10, meters
- min_z: -0.05 # default 0, meters
- vertical_fov_angle: 1.0 # 垂直视场角,单位为弧度,For 3D lidars it's the symmetric FOV about the planar axis.
- vertical_fov_padding: 0.05 # 3D Lidar only. Default 0, in meters
- horizontal_fov_angle: 6.29 # 3D 激光雷达水平视场角
- decay_acceleration: 20.0 # default 0, 1/s^2.
- model_type: 1 # 0=深度相机,1=3D激光雷达
- static_layer:
- plugin: "nav2_costmap_2d::StaticLayer"
- footprint_clearing_enabled: True
- map_subscribe_transient_local: True
- obstacle_layer:
- plugin: "nav2_costmap_2d::ObstacleLayer"
- enabled: true
- observation_sources: scan low_obstacle_cloud
- scan:
- topic: /scan_local_filtered
- raytrace_max_range: 5.5
- obstacle_max_range: 4.5
- obstacle_min_range: 0.05
- max_obstacle_height: 1.0
- min_obstacle_height: -0.05
- clearing: true
- marking: true
- inf_is_valid: true
- data_type: "LaserScan"
- combination_method: 1
- inflation_layer:
- plugin: "nav2_costmap_2d::InflationLayer"
- cost_scaling_factor: 28.0
- inflation_radius: 0.38
- enable_gradient: true
- always_send_full_costmap: false
- map_saver:
- ros__parameters:
- use_sim_time: False
- save_map_timeout: 5.0
- free_thresh_default: 0.25
- occupied_thresh_default: 0.65
- # map_subscribe_transient_local: True
- #恢复行为
- behavior_server:
- ros__parameters:
- costmap_topic: local_costmap/costmap_raw
- footprint_topic: local_costmap/published_footprint
- cycle_frequency: 5.0
- behavior_plugins: ["spin", "backup", "wait"]
- movement_time_allowance: 15.0 # 略放宽恢复触发,避免转角低速挪动被过早判定失败
- spin:
- plugin: "nav2_behaviors/Spin"
- backup:
- plugin: "nav2_behaviors/BackUp"
- backup_dist: 0.15
- backup_speed: 0.15
- wait:
- plugin: "nav2_behaviors/Wait"
- wait_time: 0.1 # 新增:等待1秒,让动态障碍移动
- global_frame: lidar_odom
- robot_base_frame: base_link
- transform_timeout: 0.5
- use_sim_time: False
- simulate_ahead_time: 1.0
- max_rotational_vel: 0.25
- min_rotational_vel: 0.10
- rotational_acc_lim: 0.50
- smoother_server:
- ros__parameters:
- use_sim_time: False
- smoother_plugins: ["SimpleSmoother"]
- SimpleSmoother:
- plugin: "nav2_smoother::SimpleSmoother"
- tolerance: 1.0e-10
- max_its: 1000
- do_refinement: True
- waypoint_follower:
- ros__parameters:
- loop_rate: 20
- stop_on_failure: false
- waypoint_task_executor_plugin: "wait_at_waypoint"
- wait_at_waypoint:
- plugin: "nav2_waypoint_follower::WaitAtWaypoint"
- enabled: True
- waypoint_pause_duration: 200
- map_server:
- ros__parameters:
- use_sim_time: False
- yaml_filename: ""
- velocity_smoother:
- ros__parameters:
- smoothing_frequency: 20.0
- scale_velocities: False
- feedback: "OPEN_LOOP"
- max_velocity: [0.10, 0.00, 0.20]
- min_velocity: [0.00, 0.00, -0.20]
- deadband_velocity: [0.02, 0.0, 0.02] # 增大线速度死区,抑制微小前后爬行
- velocity_timeout: 0.20 # 更快归零,降低到点后和碰撞前继续前冲
- max_accel: [0.10, 0.00, 0.20]
- max_decel: [-0.18, 0.00, -0.30]
- odom_topic: "/Odometry"
- odom_duration: 0.05
|