diff --git a/src/navigation/obstacle_nav2/config/nav2_params.bak.yaml b/src/navigation/obstacle_nav2/config/nav2_params.bak.yaml new file mode 100755 index 0000000..4427208 --- /dev/null +++ b/src/navigation/obstacle_nav2/config/nav2_params.bak.yaml @@ -0,0 +1,334 @@ +# ============================================================================ # 文件头:说明这是 obstacle_nav2 使用的 Nav2 参数文件。 +# nav2_params.yaml - Odometry-only obstacle navigation # 文件名和用途:只用里程计坐标系做避障导航。 +# # 分隔说明:本配置不依赖静态地图定位。 +# No static map, no AMCL, no SLAM. # 不启动 map_server、AMCL 或 slam_toolbox。 +# Both costmaps are rolling windows in odom. The launch file can rewrite every # 局部/全局代价地图都在 odom 中滚动,launch 可重写 global_frame。 +# global_frame leaf when a different connected odometry frame is required. # 如果换成其他连续里程计坐标系,可通过 launch 参数统一替换。 +# Global planner: Smac Hybrid A* (Reeds-Shepp) # 全局规划器使用适合阿克曼/可倒车模型的 Hybrid A*。 +# Local controller: MPPI (Ackermann) # 局部控制器使用 MPPI,并按阿克曼运动模型采样。 +# ============================================================================ # 文件头结束。 +# # 空行注释:下面开始 BT Navigator 配置。 +bt_navigator: # Nav2 行为树导航器节点参数。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间;仿真时才改为 True。 + global_frame: odom # 导航全局参考坐标系;当前为无地图 odom 导航。 + robot_base_frame: base_footprint # 机器人底盘坐标系,用于 TF 和 footprint 计算。 + odom_topic: /odom_combined # 行为树/控制相关里程计输入话题。 + bt_loop_duration: 50 # 行为树 tick 周期,单位 ms;50ms 约等于 20Hz。 + default_server_timeout: 20 # 行为树调用服务/动作的默认超时时间,单位 s。 + # Injected by obstacle_nav2.launch.py from this package's share directory. # launch 会把该路径重写成本包里的 Ackermann 行为树 XML。 + default_nav_to_pose_bt_xml: "" # NavigateToPose 默认行为树 XML,启动时由 launch 注入。 + plugin_lib_names: # 行为树可加载的 BT 节点插件列表。 + - nav2_compute_path_to_pose_action_bt_node # 计算单目标路径的 BT action 节点。 + - nav2_compute_path_through_poses_action_bt_node # 计算多目标路径的 BT action 节点。 + - nav2_smooth_path_action_bt_node # 路径平滑 BT action 节点。 + - nav2_follow_path_action_bt_node # 跟随路径 BT action 节点,会调用 controller_server。 + - nav2_spin_action_bt_node # 原地旋转恢复动作节点;阿克曼车实际能力需谨慎。 + - nav2_wait_action_bt_node # 等待动作节点。 + - nav2_back_up_action_bt_node # 倒车恢复动作节点;狭窄道路要确认后方安全。 + - nav2_drive_on_heading_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_globally_updated_goal_condition_bt_node # 检测全局目标更新的条件节点。 + - nav2_is_path_valid_condition_bt_node # 检测当前路径是否仍有效的条件节点。 + - nav2_initial_pose_received_condition_bt_node # 检测初始位姿是否已接收的条件节点。 + - nav2_reinitialize_global_localization_service_bt_node # 重新初始化全局定位服务节点;本配置通常不用 AMCL。 + - nav2_rate_controller_bt_node # 限制子树执行频率的控制节点。 + - nav2_distance_controller_bt_node # 按行驶距离触发子树的控制节点。 + - nav2_speed_controller_bt_node # 按速度调节子树 tick 的控制节点。 + - nav2_truncate_path_action_bt_node # 截断路径动作节点。 + - nav2_truncate_path_local_action_bt_node # 截断局部路径动作节点。 + - nav2_goal_updater_node_bt_node # 更新目标的 BT 节点。 + - nav2_recovery_node_bt_node # 恢复行为控制节点。 + - nav2_pipeline_sequence_bt_node # 管线式顺序执行节点。 + - nav2_round_robin_node_bt_node # 轮询执行多个恢复行为的节点。 + - nav2_transform_available_condition_bt_node # 检测 TF 是否可用的条件节点。 + - nav2_time_expired_condition_bt_node # 检测时间是否过期的条件节点。 + - nav2_path_expiring_timer_condition # 检测路径是否需要刷新/过期的条件节点。 + - 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 # 多路点导航 action 节点。 + - nav2_navigate_to_pose_action_bt_node # 单目标导航 action 节点。 + - nav2_remove_passed_goals_action_bt_node # 多目标导航中移除已通过目标点。 + - nav2_planner_selector_bt_node # 运行时选择 planner 的 BT 节点。 + - nav2_controller_selector_bt_node # 运行时选择 controller 的 BT 节点。 + - nav2_goal_checker_selector_bt_node # 运行时选择 goal checker 的 BT 节点。 + - nav2_controller_cancel_bt_node # 取消 controller action 的 BT 节点。 + - nav2_path_longer_on_approach_bt_node # 接近目标时检测路径是否异常变长。 + - nav2_wait_cancel_bt_node # 取消等待动作的 BT 节点。 + - nav2_spin_cancel_bt_node # 取消旋转动作的 BT 节点。 + - nav2_back_up_cancel_bt_node # 取消倒车动作的 BT 节点。 + - nav2_drive_on_heading_cancel_bt_node # 取消沿朝向行驶动作的 BT 节点。 +# # 空行注释:下面是 bt_navigator 的 rclcpp 辅助节点。 +bt_navigator_rclcpp_node: # BT navigator 内部 rclcpp 节点参数。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 该辅助节点同样使用真实时间。 +# # 空行注释:下面开始 controller_server 和 MPPI 参数。 +controller_server: # Nav2 控制服务器,负责把路径转换为速度命令。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 控制器使用真实时间。 + controller_frequency: 20.0 # 控制频率 20Hz;和 model_dt=0.05 对齐。 + FollowPath: # controller 插件实例名,行为树 FollowPath 会调用它。 + plugin: "nav2_mppi_controller::MPPIController" # 使用 Nav2 MPPI 控制器插件。 + time_steps: 36 # MPPI 预测步数;36*0.05=1.8s 预测时域。 + model_dt: 0.05 # 每个预测步长 0.05s;需接近控制周期。 + batch_size: 1000 # 每周期采样 1000 条控制序列;越大越能找到转弯解但越耗 CPU。 + vx_std: 0.22 # 前后速度采样标准差;影响速度探索范围。 + vy_std: 0.0 # 横向速度采样标准差;阿克曼车不能横移所以为 0。 + wz_std: 0.5 # 角速度采样标准差;转弯不积极时常先看这个是否太小。 + vx_max: 0.40 # 最大前进速度,单位 m/s。 + vx_min: -0.75 # 最大倒车速度下限,负值允许倒车。 + vy_max: 0.0 # 最大横向速度;阿克曼车为 0。 + wz_max: 2.0 # 最大角速度,单位 rad/s;还会受阿克曼最小转弯半径约束。 + iteration_count: 1 # 每周期优化迭代次数;MPPI 常用 1 以保证实时性。 + temperature: 0.3 # softmax 温度;越低越偏向最低代价轨迹。 + gamma: 0.015 # 控制代价权重;影响控制序列平滑和探索保守程度。 + motion_model: "Ackermann" # 使用阿克曼运动学模型。 + visualize: false # 是否发布 MPPI 候选轨迹 Marker;调试时可改 true。 + TrajectoryVisualizer: # MPPI 轨迹可视化降采样参数。 + trajectory_step: 5 # 每隔几条候选轨迹显示一次,减轻 RViz 压力。 + time_step: 3 # 每条轨迹每隔几个时间步显示一次。 + AckermannConstraints: # 阿克曼模型专用约束。 + min_turning_r: 0.4 # 最小转弯半径,单位 m;过大时车会显得不愿转弯。 + critics: ["ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic"] # MPPI 代价函数执行顺序。 + ConstraintCritic: # 运动学/动力学约束代价,惩罚超限控制。 + enabled: true # 启用约束 critic。 + cost_power: 1 # 代价幂次;1 表示线性惩罚。 + cost_weight: 4.0 # 约束代价权重;过高会强烈压制急转/急变速。 + GoalCritic: # 目标位置吸引代价。 + enabled: true # 启用目标位置 critic。 + cost_power: 1 # 目标距离代价幂次。 + cost_weight: 3.0 # 目标位置权重。 + threshold_to_consider: 1.4 # 距目标 1.4m 内开始更明显考虑目标位置。 + GoalAngleCritic: # 目标朝向代价。 + enabled: true # 启用目标朝向 critic。 + cost_power: 1 # 朝向误差代价幂次。 + cost_weight: 3.0 # 目标朝向权重。 + threshold_to_consider: 1.2 # 距目标 xxm 内开始考虑最终朝向。 + PreferForwardCritic: # 前进偏好代价。 + enabled: true # 启用前进偏好。 + cost_power: 1 # 前进偏好代价幂次。 + cost_weight: 8.0 # 前进偏好权重;过高会不愿倒车/掉头。 + threshold_to_consider: 5.0 # 接近目标 0.5m 后才重点考虑该 critic。 + CostCritic: # costmap 障碍物/高代价区域 critic。 + enabled: true # 启用代价地图 critic。 + cost_power: 1 # costmap 代价幂次。 + cost_weight: 3.0 # costmap 权重;越高越远离障碍/道路边界。 + critical_cost: 300.0 # 超过该代价会被视为非常危险。 + consider_footprint: true # 用完整车体 footprint 检查代价,而不是只看中心点。 + collision_cost: 1000000.0 # 碰撞轨迹的巨大惩罚。 + near_goal_distance: 1.0 # 近目标距离内可调整 cost critic 行为。 + trajectory_point_step: 2 # 评估轨迹时每隔 2 个点检查一次,降低计算量。 + PathAlignCritic: # 路径贴合 critic,鼓励候选轨迹贴近全局路径。 + enabled: true # 启用路径贴合。 + cost_power: 2 # 路径贴合代价幂次。 + cost_weight: 14.0 # 路径贴合权重;过高时车可能不愿为了转弯偏离路径。 + max_path_occupancy_ratio: 0.05 # 路径附近占据比例超过阈值时可降低该 critic 影响。 + trajectory_point_step: 4 # 路径贴合评估的轨迹点间隔。 + threshold_to_consider: 0.5 # 距目标超过 0.5m 时考虑路径贴合。 + offset_from_furthest: 20 # 从最远路径进展点再向前偏移,用于对齐目标点选择。 + use_path_orientations: true # 不使用路径自带朝向,仅按几何路径对齐。 + PathFollowCritic: # 路径前进 critic,鼓励沿路径向前推进。 + enabled: true # 启用路径跟随。 + cost_power: 1 # 路径前进代价幂次。 + cost_weight: 9.0 # 路径前进权重。 + offset_from_furthest: 5 # 选择最远进展点前方 5 个点作为跟随参考。 + threshold_to_consider: 1.4 # 距目标超过 1.4m 时考虑路径前进。 + PathAngleCritic: # 路径朝向 critic,约束车头与路径方向关系。 + enabled: true # 启用路径朝向。 + cost_power: 1 # 路径朝向代价幂次。 + cost_weight: 6.0 # 路径朝向权重;过高可能压制可行的切弯姿态。 + offset_from_furthest: 4 # 用路径前方第 4 个点估计方向。 + threshold_to_consider: 0.5 # 距目标超过 0.5m 时考虑路径朝向。 + max_angle_to_furthest: 1.0 # 到前方路径点最大允许角度,单位 rad。 + forward_preference: true # 偏好前进方向,false允许更灵活的路径角度。 +# # 空行注释:下面是 controller_server 的 rclcpp 辅助节点。 +controller_server_rclcpp_node: # controller server 内部 rclcpp 节点参数。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 +# # 空行注释:下面开始局部代价地图配置。 +local_costmap: # 局部代价地图顶层命名空间。 + local_costmap: # Nav2 costmap node 名称。 + ros__parameters: # ROS2 参数命名空间。 + update_frequency: 5.0 # 局部 costmap 更新频率 5Hz。 + publish_frequency: 2.0 # 局部 costmap 发布频率 2Hz。 + transform_tolerance: 0.5 # TF 允许延迟 0.5s。 + global_frame: odom # 局部 costmap 参考坐标系。 + robot_base_frame: base_footprint # 机器人底盘坐标系。 + use_sim_time: False # 使用真实时间。 + rolling_window: true # 使用跟随机器人移动的滚动窗口。 + width: 3 # 局部 costmap 宽 3m。 + height: 3 # 局部 costmap 高 3m。 + resolution: 0.05 # 栅格分辨率 5cm。 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" # 车体矩形轮廓,单位 m。 + footprint_padding: 0.02 # footprint 额外膨胀 2cm,提供安全余量。 + track_unknown_space: false # 不把未知区域作为需要跟踪的未知空间。 + plugins: ["obstacle_array_layer", "inflation_layer"] # 局部 costmap 插件顺序。 + obstacle_array_layer: # 自定义障碍物数组层。 + plugin: "obstacle_nav2::ObstacleArrayLayer" # 使用 obstacle_nav2 包里的自定义 costmap layer。 + enabled: true # 启用障碍物层。 + topic: /obstacles # 从 obstacle_scanner 发布的障碍物话题读取。 + obstacle_timeout: 0.5 # 障碍物 0.5s 未更新后过期。 + transform_tolerance: 0.2 # 障碍物坐标 TF 容忍时间 0.2s。 + default_obstacle_radius: 0.05 # 默认障碍物半径 5cm。 + minimum_obstacle_radius: 0.02 # 障碍物最小半径 2cm。 + maximum_obstacle_radius: 0.06 # 局部层障碍物最大半径 6cm。 + extra_inflation: 0.02 # 自定义层额外障碍膨胀 2cm。 + inflation_layer: # 标准 Nav2 膨胀层。 + plugin: "nav2_costmap_2d::InflationLayer" # 使用 Nav2 内置 InflationLayer。 + cost_scaling_factor: 3.0 # 膨胀代价衰减速度;越大衰减越快。 + inflation_radius: 0.15 # 局部障碍膨胀半径 20cm。 + always_send_full_costmap: True # 每次发布完整 costmap,便于调试但带宽更高。 + local_costmap_client: # 局部 costmap 参数客户端节点。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 + local_costmap_rclcpp_node: # 局部 costmap 内部 rclcpp 节点。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 +# # 空行注释:下面开始全局代价地图配置。 +global_costmap: # 全局代价地图顶层命名空间。 + global_costmap: # Nav2 global costmap node 名称。 + ros__parameters: # ROS2 参数命名空间。 + update_frequency: 1.0 # 全局 costmap 更新频率 1Hz。 + publish_frequency: 1.0 # 全局 costmap 发布频率 1Hz。 + transform_tolerance: 0.5 # TF 允许延迟 0.5s。 + global_frame: odom # 全局 costmap 参考坐标系;此处仍为 odom 滚动窗口。 + robot_base_frame: base_footprint # 机器人底盘坐标系。 + use_sim_time: False # 使用真实时间。 + rolling_window: true # 全局 costmap 也采用滚动窗口,不依赖静态地图。 + width: 10 # 全局 costmap 宽 10m。 + height: 10 # 全局 costmap 高 10m。 + resolution: 0.05 # 栅格分辨率 5cm。 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" # 车体矩形轮廓,单位 m。 + footprint_padding: 0.02 # footprint 额外膨胀 2cm。 + track_unknown_space: false # 不跟踪未知空间,适合无静态地图滚动导航。 + plugins: ["obstacle_array_layer", "inflation_layer"] # 全局 costmap 插件顺序。 + obstacle_array_layer: # 自定义障碍物数组层。 + plugin: "obstacle_nav2::ObstacleArrayLayer" # 使用 obstacle_nav2 自定义 layer。 + enabled: true # 启用障碍物层。 + topic: /obstacles # 障碍物输入话题。 + obstacle_timeout: 0.5 # 障碍物数据过期时间 0.5s。 + transform_tolerance: 0.2 # 障碍物 TF 容忍时间 0.2s。 + default_obstacle_radius: 0.05 # 默认障碍物半径 5cm。 + minimum_obstacle_radius: 0.02 # 障碍物最小半径 2cm。 + maximum_obstacle_radius: 0.50 # 全局层允许更大的障碍物半径,最大 50cm。 + extra_inflation: 0.02 # 自定义层额外膨胀 2cm。 + inflation_layer: # 标准 Nav2 膨胀层。 + plugin: "nav2_costmap_2d::InflationLayer" # 使用 Nav2 内置 InflationLayer。 + cost_scaling_factor: 3.0 # 膨胀代价衰减速度。 + inflation_radius: 0.55 # 全局障碍膨胀半径 55cm,规划会更保守。 + always_send_full_costmap: True # 每次发布完整全局 costmap。 + global_costmap_client: # 全局 costmap 参数客户端节点。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 + global_costmap_rclcpp_node: # 全局 costmap 内部 rclcpp 节点。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 +# # 空行注释:下面开始全局规划器配置。 +planner_server: # Nav2 全局规划服务器。 + ros__parameters: # ROS2 参数命名空间。 + planner_plugins: ["GridBased"] # 注册一个名为 GridBased 的 planner。 + use_sim_time: False # 使用真实时间。 + GridBased: # GridBased planner 插件参数。 + plugin: "nav2_smac_planner/SmacPlannerHybrid" # 使用 Smac Hybrid A* 规划器。 + downsample_costmap: false # 不降采样 costmap,保留 5cm 精度。 + downsampling_factor: 1 # 降采样倍率为 1,即不降采样。 + tolerance: 0.25 # 目标容忍半径 25cm,目标附近可接受近似解。 + allow_unknown: false # 不允许规划穿过未知区域。 + max_iterations: 1000000 # 最大搜索迭代次数。 + max_on_approach_iterations: 1000 # 接近目标后额外搜索迭代次数。 + max_planning_time: 5.0 # 单次规划最大时间 5s。 + motion_model_for_search: "REEDS_SHEPP" # 搜索模型支持前进和倒车。 + angle_quantization_bins: 72 # 角度离散成 72 档,每档约 5 度。 + analytic_expansion_ratio: 3.5 # 解析扩展尝试频率比例。 + analytic_expansion_max_length: 3.0 # 解析扩展最大长度 3m。 + minimum_turning_radius: 0.60 # 规划器最小转弯半径,应和 MPPI min_turning_r 接近。 + reverse_penalty: 1.9 # 倒车惩罚;越高越不愿倒车。 + change_penalty: 1.0 # 前进/倒车方向切换惩罚。 + non_straight_penalty: 1.2 # 非直线运动惩罚;过高会让路径偏直。 + cost_penalty: 4.0 # costmap 高代价区域惩罚;越高越远离障碍。 + retrospective_penalty: 0.015 # 回溯惩罚,用于改善搜索效率/路径偏好。 + # 5 m covers the rolling planning horizon without the startup and memory # 说明 lookup_table_size 为什么设为 5m。 + # cost of the previous 20 m (401-cell) Hybrid-A* lookup table. # 旧的 20m 查找表启动和内存成本更高。 + lookup_table_size: 5.0 # Hybrid A* 启发式查找表尺寸 5m。 + cache_obstacle_heuristic: false # 不缓存障碍启发式,适合滚动障碍环境。 + viz_expansions: false # 不发布搜索扩展可视化;调试规划器时可打开。 + smooth_path: True # 对规划结果做平滑。 + smoother: # Smac planner 内部 smoother 参数。 + max_iterations: 1000 # 平滑器最大迭代次数。 + w_smooth: 0.3 # 平滑项权重。 + w_data: 0.2 # 保持原路径数据项权重。 + tolerance: 1.0e-10 # 平滑收敛阈值。 + do_refinement: true # 启用额外细化。 + refinement_num: 2 # 平滑细化轮数。 +# # 空行注释:下面是 planner_server 的 rclcpp 辅助节点。 +planner_server_rclcpp_node: # planner server 内部 rclcpp 节点。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 +# # 空行注释:下面开始 smoother_server 配置。 +smoother_server: # Nav2 独立路径平滑服务器。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 + smoother_plugins: ["simple_smoother"] # 注册 simple_smoother 插件。 + simple_smoother: # SimpleSmoother 插件参数。 + plugin: "nav2_smoother::SimpleSmoother" # 使用 Nav2 内置简单平滑器。 + tolerance: 1.0e-10 # 平滑收敛阈值。 + max_its: 1000 # 最大迭代次数。 + do_refinement: True # 启用额外细化。 +# # 空行注释:下面开始行为服务器配置。 +behavior_server: # Nav2 恢复/行为服务器。 + ros__parameters: # ROS2 参数命名空间。 + costmap_topic: local_costmap/costmap_raw # 行为服务器使用的局部 costmap 原始话题。 + footprint_topic: local_costmap/published_footprint # 行为服务器使用的机器人 footprint 话题。 + cycle_frequency: 10.0 # 行为服务器运行频率 10Hz。 + behavior_plugins: ["spin", "backup", "wait"] # 注册旋转、倒车、等待三个行为。 + spin: # 旋转行为参数。 + plugin: "nav2_behaviors/Spin" # 使用 Nav2 Spin 行为。 + backup: # 倒车行为参数。 + plugin: "nav2_behaviors/BackUp" # 使用 Nav2 BackUp 行为。 + backup_dist: 0.8 # 默认倒车距离 0.8m。 + backup_speed: 0.18 # 默认倒车速度 0.18m/s。 + wait: # 等待行为参数。 + plugin: "nav2_behaviors/Wait" # 使用 Nav2 Wait 行为。 + wait_duration: 0.5 # 默认等待 0.5s。 + global_frame: odom # 行为服务器全局参考坐标系。 + robot_base_frame: base_footprint # 机器人底盘坐标系。 + transform_tolerance: 0.5 # TF 容忍时间 0.5s。 + use_sim_time: False # 使用真实时间。 + simulate_ahead_time: 2.0 # 行为碰撞检查向前模拟 2s。 + max_rotational_vel: 1.0 # 行为服务器最大旋转速度 1rad/s。 + min_rotational_vel: 0.4 # 行为服务器最小旋转速度 0.4rad/s。 + rotational_acc_lim: 3.2 # 行为服务器旋转加速度限制 3.2rad/s^2。 +# # 空行注释:下面是 robot_state_publisher 参数。 +robot_state_publisher: # 机器人状态发布器。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 +# # 空行注释:下面开始 waypoint_follower 配置。 +waypoint_follower: # Nav2 路点跟随服务器。 + ros__parameters: # ROS2 参数命名空间。 + loop_rate: 20 # 路点跟随循环频率 20Hz。 + use_sim_time: False # 使用真实时间。 + stop_on_failure: false # 单个路点失败时不停止整个任务。 + waypoint_task_executor_plugin: "wait_at_waypoint" # 每个路点执行等待插件。 + wait_at_waypoint: # 路点等待插件参数。 + plugin: "nav2_waypoint_follower::WaitAtWaypoint" # 使用 Nav2 内置等待插件。 + enabled: True # 启用到点等待。 + waypoint_pause_duration: 200 # 每个路点等待 200ms。 +# # 空行注释:下面开始 velocity_smoother 配置。 +velocity_smoother: # Nav2 速度平滑器。 + ros__parameters: # ROS2 参数命名空间。 + use_sim_time: False # 使用真实时间。 + smoothing_frequency: 20.0 # 速度平滑频率 20Hz。 + scale_velocities: False # 不按比例缩放各轴速度,直接按限制裁剪。 + feedback: "OPEN_LOOP" # 开环平滑,不用实时里程计速度闭环修正。 + max_velocity: [0.40, 0.0, 2.5] # 最大速度 [vx, vy, wz]。 + min_velocity: [-0.75, 0.0, -2.5] # 最小速度 [vx, vy, wz],负 vx 允许倒车。 + max_accel: [2.5, 0.0, 3.2] # 最大加速度 [ax, ay, aw]。 + max_decel: [-0.5, 0.0, -0.5] # 最大减速度;负值表示减速方向限制。 + odom_topic: /odom_combined # 平滑器读取里程计的话题。 + odom_duration: 0.1 # 里程计速度估计时间窗口 0.1s。 + deadband_velocity: [0.03, 0.0, 0.03] # 小于死区的速度会被压到 0。 + velocity_timeout: 1.0 # 1s 未收到速度命令则停止输出。 diff --git a/src/navigation/obstacle_nav2/config/nav2_params.yaml b/src/navigation/obstacle_nav2/config/nav2_params.yaml index 0c195b1..50f984e 100755 --- a/src/navigation/obstacle_nav2/config/nav2_params.yaml +++ b/src/navigation/obstacle_nav2/config/nav2_params.yaml @@ -1,11 +1,12 @@ # ============================================================================ -# nav2_params.yaml — Odometry-only obstacle navigation +# nav2_params_basic_tracking.yaml # -# No static map, no AMCL, no SLAM. -# Both costmaps are rolling windows in odom. The launch file can rewrite every -# global_frame leaf when a different connected odometry frame is required. -# Global planner: Smac Hybrid A* (Reeds-Shepp) -# Local controller: MPPI (Ackermann) +# Basic stable trajectory-following profile for obstacle_nav2. +# This file is intentionally conservative: low speed, longer MPPI horizon, +# smoother acceleration, moderate path tracking weights, and Ackermann limits. +# +# It does not replace nav2_params.yaml. To use it, launch Nav2 with this params +# file or add a launch argument later. # ============================================================================ bt_navigator: @@ -16,7 +17,6 @@ bt_navigator: odom_topic: /odom_combined bt_loop_duration: 50 default_server_timeout: 20 - # Injected by obstacle_nav2.launch.py from this package's share directory. default_nav_to_pose_bt_xml: "" plugin_lib_names: - nav2_compute_path_to_pose_action_bt_node @@ -71,81 +71,98 @@ controller_server: ros__parameters: use_sim_time: False controller_frequency: 20.0 + FollowPath: plugin: "nav2_mppi_controller::MPPIController" - time_steps: 36 + + # Longer horizon and moderate sampling make turns easier to discover. + time_steps: 48 model_dt: 0.05 batch_size: 1000 - vx_std: 0.22 - vy_std: 0.0 - wz_std: 0.5 - vx_max: 0.40 - vx_min: -0.75 - vy_max: 0.0 - wz_max: 2.0 iteration_count: 1 - temperature: 0.3 - gamma: 0.015 + + # Conservative velocity exploration. Speed is deliberately not optimized. + vx_std: 0.20 + vy_std: 0.0 + wz_std: 0.85 + vx_max: 0.50 + vx_min: -0.15 + vy_max: 0.0 + wz_max: 1.8 + + # Lower temperature makes selection steadier; gamma damps rough controls. + temperature: 0.25 + gamma: 0.02 + motion_model: "Ackermann" visualize: false TrajectoryVisualizer: trajectory_step: 5 time_step: 3 AckermannConstraints: - min_turning_r: 0.6 + min_turning_r: 0.60 + critics: ["ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic"] - ConstraintCritic: - enabled: true - cost_power: 1 - cost_weight: 4.0 - GoalCritic: + + ConstraintCritic: enabled: true cost_power: 1 cost_weight: 3.0 - threshold_to_consider: 1.4 - GoalAngleCritic: - enabled: true - cost_power: 1 - cost_weight: 3.0 - threshold_to_consider: 0.5 - PreferForwardCritic: - enabled: true - cost_power: 1 - cost_weight: 6.0 - threshold_to_consider: 0.5 + CostCritic: enabled: true cost_power: 1 - cost_weight: 3.81 + cost_weight: 4.5 critical_cost: 300.0 consider_footprint: true collision_cost: 1000000.0 - near_goal_distance: 1.0 + near_goal_distance: 0.8 trajectory_point_step: 2 + + GoalCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 1.0 + + GoalAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 0.45 + PathAlignCritic: enabled: true cost_power: 1 - cost_weight: 14.0 - max_path_occupancy_ratio: 0.05 + cost_weight: 16.0 + max_path_occupancy_ratio: 0.07 trajectory_point_step: 4 - threshold_to_consider: 0.5 - offset_from_furthest: 20 + threshold_to_consider: 0.45 + offset_from_furthest: 8 use_path_orientations: false + PathFollowCritic: - enabled: true - cost_power: 1 - cost_weight: 5.0 - offset_from_furthest: 5 - threshold_to_consider: 1.4 - PathAngleCritic: enabled: true cost_power: 1 cost_weight: 6.0 offset_from_furthest: 4 - threshold_to_consider: 0.5 - max_angle_to_furthest: 1.0 + threshold_to_consider: 1.0 + + PathAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 6.0 + offset_from_furthest: 5 + threshold_to_consider: 0.45 + max_angle_to_furthest: 1.2 forward_preference: false + PreferForwardCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 0.4 + controller_server_rclcpp_node: ros__parameters: use_sim_time: False @@ -153,15 +170,15 @@ controller_server_rclcpp_node: local_costmap: local_costmap: ros__parameters: - update_frequency: 5.0 - publish_frequency: 2.0 + update_frequency: 8.0 + publish_frequency: 4.0 transform_tolerance: 0.5 global_frame: odom robot_base_frame: base_footprint use_sim_time: False rolling_window: true - width: 3 - height: 3 + width: 4 + height: 4 resolution: 0.05 footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" footprint_padding: 0.02 @@ -180,7 +197,7 @@ local_costmap: inflation_layer: plugin: "nav2_costmap_2d::InflationLayer" cost_scaling_factor: 3.0 - inflation_radius: 0.2 + inflation_radius: 0.25 always_send_full_costmap: True local_costmap_client: ros__parameters: @@ -192,7 +209,7 @@ local_costmap: global_costmap: global_costmap: ros__parameters: - update_frequency: 1.0 + update_frequency: 2.0 publish_frequency: 1.0 transform_tolerance: 0.5 global_frame: odom @@ -219,7 +236,7 @@ global_costmap: inflation_layer: plugin: "nav2_costmap_2d::InflationLayer" cost_scaling_factor: 3.0 - inflation_radius: 0.55 + inflation_radius: 0.45 always_send_full_costmap: True global_costmap_client: ros__parameters: @@ -236,7 +253,7 @@ planner_server: plugin: "nav2_smac_planner/SmacPlannerHybrid" downsample_costmap: false downsampling_factor: 1 - tolerance: 0.25 + tolerance: 0.20 allow_unknown: false max_iterations: 1000000 max_on_approach_iterations: 1000 @@ -244,23 +261,21 @@ planner_server: motion_model_for_search: "REEDS_SHEPP" angle_quantization_bins: 72 analytic_expansion_ratio: 3.5 - analytic_expansion_max_length: 3.0 + analytic_expansion_max_length: 2.0 minimum_turning_radius: 0.60 - reverse_penalty: 1.9 - change_penalty: 1.0 - non_straight_penalty: 1.2 - cost_penalty: 4.0 + reverse_penalty: 2.2 + change_penalty: 0.5 + non_straight_penalty: 0.85 + cost_penalty: 4.5 retrospective_penalty: 0.015 - # 5 m covers the rolling planning horizon without the startup and memory - # cost of the previous 20 m (401-cell) Hybrid-A* lookup table. lookup_table_size: 5.0 cache_obstacle_heuristic: false viz_expansions: false smooth_path: True smoother: max_iterations: 1000 - w_smooth: 0.3 - w_data: 0.2 + w_smooth: 0.35 + w_data: 0.25 tolerance: 1.0e-10 do_refinement: true refinement_num: 2 @@ -289,8 +304,8 @@ behavior_server: plugin: "nav2_behaviors/Spin" backup: plugin: "nav2_behaviors/BackUp" - backup_dist: 0.8 - backup_speed: 0.18 + backup_dist: 0.30 + backup_speed: 0.08 wait: plugin: "nav2_behaviors/Wait" wait_duration: 0.5 @@ -299,9 +314,9 @@ behavior_server: transform_tolerance: 0.5 use_sim_time: False simulate_ahead_time: 2.0 - max_rotational_vel: 1.0 - min_rotational_vel: 0.4 - rotational_acc_lim: 3.2 + max_rotational_vel: 0.8 + min_rotational_vel: 0.2 + rotational_acc_lim: 1.5 robot_state_publisher: ros__parameters: @@ -324,11 +339,11 @@ velocity_smoother: smoothing_frequency: 20.0 scale_velocities: False feedback: "OPEN_LOOP" - max_velocity: [0.40, 0.0, 2.5] - min_velocity: [-0.75, 0.0, -2.5] - max_accel: [2.5, 0.0, 3.2] - max_decel: [-0.5, 0.0, -0.5] + max_velocity: [0.50, 0.0, 1.8] + min_velocity: [-0.15, 0.0, -1.8] + max_accel: [0.50, 0.0, 1.50] + max_decel: [-0.60, 0.0, -1.80] odom_topic: /odom_combined odom_duration: 0.1 - deadband_velocity: [0.03, 0.0, 0.03] + deadband_velocity: [0.02, 0.0, 0.02] velocity_timeout: 1.0 diff --git a/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak.20260804-1444 b/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak.20260804-1444 new file mode 100755 index 0000000..0c195b1 --- /dev/null +++ b/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak.20260804-1444 @@ -0,0 +1,334 @@ +# ============================================================================ +# nav2_params.yaml — Odometry-only obstacle navigation +# +# No static map, no AMCL, no SLAM. +# Both costmaps are rolling windows in odom. The launch file can rewrite every +# global_frame leaf when a different connected odometry frame is required. +# Global planner: Smac Hybrid A* (Reeds-Shepp) +# Local controller: MPPI (Ackermann) +# ============================================================================ + +bt_navigator: + ros__parameters: + use_sim_time: False + global_frame: odom + robot_base_frame: base_footprint + odom_topic: /odom_combined + bt_loop_duration: 50 + default_server_timeout: 20 + # Injected by obstacle_nav2.launch.py from this package's share directory. + default_nav_to_pose_bt_xml: "" + 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_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_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_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_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_truncate_path_local_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_path_expiring_timer_condition + - 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 + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: False + +controller_server: + ros__parameters: + use_sim_time: False + controller_frequency: 20.0 + FollowPath: + plugin: "nav2_mppi_controller::MPPIController" + time_steps: 36 + model_dt: 0.05 + batch_size: 1000 + vx_std: 0.22 + vy_std: 0.0 + wz_std: 0.5 + vx_max: 0.40 + vx_min: -0.75 + vy_max: 0.0 + wz_max: 2.0 + iteration_count: 1 + temperature: 0.3 + gamma: 0.015 + motion_model: "Ackermann" + visualize: false + TrajectoryVisualizer: + trajectory_step: 5 + time_step: 3 + AckermannConstraints: + min_turning_r: 0.6 + critics: ["ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic"] + ConstraintCritic: + enabled: true + cost_power: 1 + cost_weight: 4.0 + GoalCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + threshold_to_consider: 1.4 + GoalAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + threshold_to_consider: 0.5 + PreferForwardCritic: + enabled: true + cost_power: 1 + cost_weight: 6.0 + threshold_to_consider: 0.5 + CostCritic: + enabled: true + cost_power: 1 + cost_weight: 3.81 + critical_cost: 300.0 + consider_footprint: true + collision_cost: 1000000.0 + near_goal_distance: 1.0 + trajectory_point_step: 2 + PathAlignCritic: + enabled: true + cost_power: 1 + cost_weight: 14.0 + max_path_occupancy_ratio: 0.05 + trajectory_point_step: 4 + threshold_to_consider: 0.5 + offset_from_furthest: 20 + use_path_orientations: false + PathFollowCritic: + enabled: true + cost_power: 1 + cost_weight: 5.0 + offset_from_furthest: 5 + threshold_to_consider: 1.4 + PathAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 6.0 + offset_from_furthest: 4 + threshold_to_consider: 0.5 + max_angle_to_furthest: 1.0 + forward_preference: false + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 3 + height: 3 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.06 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.2 + always_send_full_costmap: True + local_costmap_client: + ros__parameters: + use_sim_time: False + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +global_costmap: + global_costmap: + ros__parameters: + update_frequency: 1.0 + publish_frequency: 1.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 10 + height: 10 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.50 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.55 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: False + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +planner_server: + ros__parameters: + planner_plugins: ["GridBased"] + use_sim_time: False + GridBased: + plugin: "nav2_smac_planner/SmacPlannerHybrid" + downsample_costmap: false + downsampling_factor: 1 + tolerance: 0.25 + allow_unknown: false + max_iterations: 1000000 + max_on_approach_iterations: 1000 + max_planning_time: 5.0 + motion_model_for_search: "REEDS_SHEPP" + angle_quantization_bins: 72 + analytic_expansion_ratio: 3.5 + analytic_expansion_max_length: 3.0 + minimum_turning_radius: 0.60 + reverse_penalty: 1.9 + change_penalty: 1.0 + non_straight_penalty: 1.2 + cost_penalty: 4.0 + retrospective_penalty: 0.015 + # 5 m covers the rolling planning horizon without the startup and memory + # cost of the previous 20 m (401-cell) Hybrid-A* lookup table. + lookup_table_size: 5.0 + cache_obstacle_heuristic: false + viz_expansions: false + smooth_path: True + smoother: + max_iterations: 1000 + w_smooth: 0.3 + w_data: 0.2 + tolerance: 1.0e-10 + do_refinement: true + refinement_num: 2 + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +smoother_server: + ros__parameters: + use_sim_time: False + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 10.0 + behavior_plugins: ["spin", "backup", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + backup_dist: 0.8 + backup_speed: 0.18 + wait: + plugin: "nav2_behaviors/Wait" + wait_duration: 0.5 + global_frame: odom + robot_base_frame: base_footprint + transform_tolerance: 0.5 + use_sim_time: False + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: False + +waypoint_follower: + ros__parameters: + loop_rate: 20 + use_sim_time: False + 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 + +velocity_smoother: + ros__parameters: + use_sim_time: False + smoothing_frequency: 20.0 + scale_velocities: False + feedback: "OPEN_LOOP" + max_velocity: [0.40, 0.0, 2.5] + min_velocity: [-0.75, 0.0, -2.5] + max_accel: [2.5, 0.0, 3.2] + max_decel: [-0.5, 0.0, -0.5] + odom_topic: /odom_combined + odom_duration: 0.1 + deadband_velocity: [0.03, 0.0, 0.03] + velocity_timeout: 1.0 diff --git a/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak_20260804_144647 b/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak_20260804_144647 new file mode 100755 index 0000000..0c195b1 --- /dev/null +++ b/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak_20260804_144647 @@ -0,0 +1,334 @@ +# ============================================================================ +# nav2_params.yaml — Odometry-only obstacle navigation +# +# No static map, no AMCL, no SLAM. +# Both costmaps are rolling windows in odom. The launch file can rewrite every +# global_frame leaf when a different connected odometry frame is required. +# Global planner: Smac Hybrid A* (Reeds-Shepp) +# Local controller: MPPI (Ackermann) +# ============================================================================ + +bt_navigator: + ros__parameters: + use_sim_time: False + global_frame: odom + robot_base_frame: base_footprint + odom_topic: /odom_combined + bt_loop_duration: 50 + default_server_timeout: 20 + # Injected by obstacle_nav2.launch.py from this package's share directory. + default_nav_to_pose_bt_xml: "" + 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_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_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_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_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_truncate_path_local_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_path_expiring_timer_condition + - 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 + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: False + +controller_server: + ros__parameters: + use_sim_time: False + controller_frequency: 20.0 + FollowPath: + plugin: "nav2_mppi_controller::MPPIController" + time_steps: 36 + model_dt: 0.05 + batch_size: 1000 + vx_std: 0.22 + vy_std: 0.0 + wz_std: 0.5 + vx_max: 0.40 + vx_min: -0.75 + vy_max: 0.0 + wz_max: 2.0 + iteration_count: 1 + temperature: 0.3 + gamma: 0.015 + motion_model: "Ackermann" + visualize: false + TrajectoryVisualizer: + trajectory_step: 5 + time_step: 3 + AckermannConstraints: + min_turning_r: 0.6 + critics: ["ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic"] + ConstraintCritic: + enabled: true + cost_power: 1 + cost_weight: 4.0 + GoalCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + threshold_to_consider: 1.4 + GoalAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + threshold_to_consider: 0.5 + PreferForwardCritic: + enabled: true + cost_power: 1 + cost_weight: 6.0 + threshold_to_consider: 0.5 + CostCritic: + enabled: true + cost_power: 1 + cost_weight: 3.81 + critical_cost: 300.0 + consider_footprint: true + collision_cost: 1000000.0 + near_goal_distance: 1.0 + trajectory_point_step: 2 + PathAlignCritic: + enabled: true + cost_power: 1 + cost_weight: 14.0 + max_path_occupancy_ratio: 0.05 + trajectory_point_step: 4 + threshold_to_consider: 0.5 + offset_from_furthest: 20 + use_path_orientations: false + PathFollowCritic: + enabled: true + cost_power: 1 + cost_weight: 5.0 + offset_from_furthest: 5 + threshold_to_consider: 1.4 + PathAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 6.0 + offset_from_furthest: 4 + threshold_to_consider: 0.5 + max_angle_to_furthest: 1.0 + forward_preference: false + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 3 + height: 3 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.06 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.2 + always_send_full_costmap: True + local_costmap_client: + ros__parameters: + use_sim_time: False + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +global_costmap: + global_costmap: + ros__parameters: + update_frequency: 1.0 + publish_frequency: 1.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 10 + height: 10 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.50 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.55 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: False + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +planner_server: + ros__parameters: + planner_plugins: ["GridBased"] + use_sim_time: False + GridBased: + plugin: "nav2_smac_planner/SmacPlannerHybrid" + downsample_costmap: false + downsampling_factor: 1 + tolerance: 0.25 + allow_unknown: false + max_iterations: 1000000 + max_on_approach_iterations: 1000 + max_planning_time: 5.0 + motion_model_for_search: "REEDS_SHEPP" + angle_quantization_bins: 72 + analytic_expansion_ratio: 3.5 + analytic_expansion_max_length: 3.0 + minimum_turning_radius: 0.60 + reverse_penalty: 1.9 + change_penalty: 1.0 + non_straight_penalty: 1.2 + cost_penalty: 4.0 + retrospective_penalty: 0.015 + # 5 m covers the rolling planning horizon without the startup and memory + # cost of the previous 20 m (401-cell) Hybrid-A* lookup table. + lookup_table_size: 5.0 + cache_obstacle_heuristic: false + viz_expansions: false + smooth_path: True + smoother: + max_iterations: 1000 + w_smooth: 0.3 + w_data: 0.2 + tolerance: 1.0e-10 + do_refinement: true + refinement_num: 2 + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +smoother_server: + ros__parameters: + use_sim_time: False + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 10.0 + behavior_plugins: ["spin", "backup", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + backup_dist: 0.8 + backup_speed: 0.18 + wait: + plugin: "nav2_behaviors/Wait" + wait_duration: 0.5 + global_frame: odom + robot_base_frame: base_footprint + transform_tolerance: 0.5 + use_sim_time: False + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: False + +waypoint_follower: + ros__parameters: + loop_rate: 20 + use_sim_time: False + 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 + +velocity_smoother: + ros__parameters: + use_sim_time: False + smoothing_frequency: 20.0 + scale_velocities: False + feedback: "OPEN_LOOP" + max_velocity: [0.40, 0.0, 2.5] + min_velocity: [-0.75, 0.0, -2.5] + max_accel: [2.5, 0.0, 3.2] + max_decel: [-0.5, 0.0, -0.5] + odom_topic: /odom_combined + odom_duration: 0.1 + deadband_velocity: [0.03, 0.0, 0.03] + velocity_timeout: 1.0 diff --git a/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak_before_spin_fix_20260804_153854 b/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak_before_spin_fix_20260804_153854 new file mode 100755 index 0000000..a1f2fbe --- /dev/null +++ b/src/navigation/obstacle_nav2/config/nav2_params.yaml.bak_before_spin_fix_20260804_153854 @@ -0,0 +1,347 @@ +# ============================================================================ +# nav2_params_basic_tracking.yaml +# +# Basic stable trajectory-following profile for obstacle_nav2. +# This file is intentionally conservative: low speed, longer MPPI horizon, +# smoother acceleration, moderate path tracking weights, and Ackermann limits. +# +# It does not replace nav2_params.yaml. To use it, launch Nav2 with this params +# file or add a launch argument later. +# ============================================================================ + +bt_navigator: + ros__parameters: + use_sim_time: False + global_frame: odom + robot_base_frame: base_footprint + odom_topic: /odom_combined + bt_loop_duration: 50 + default_server_timeout: 20 + default_nav_to_pose_bt_xml: "" + 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_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_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_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_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_truncate_path_local_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_path_expiring_timer_condition + - 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 + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: False + +controller_server: + ros__parameters: + use_sim_time: False + controller_frequency: 20.0 + + FollowPath: + plugin: "nav2_mppi_controller::MPPIController" + + # Longer horizon and moderate sampling make turns easier to discover. + time_steps: 48 + model_dt: 0.05 + batch_size: 1000 + iteration_count: 1 + + # Conservative velocity exploration. Speed is deliberately not optimized. + vx_std: 0.12 + vy_std: 0.0 + wz_std: 0.85 + vx_max: 0.25 + vx_min: -0.15 + vy_max: 0.0 + wz_max: 1.8 + + # Lower temperature makes selection steadier; gamma damps rough controls. + temperature: 0.25 + gamma: 0.02 + + motion_model: "Ackermann" + visualize: false + TrajectoryVisualizer: + trajectory_step: 5 + time_step: 3 + AckermannConstraints: + min_turning_r: 0.60 + + critics: ["ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic"] + + ConstraintCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + + CostCritic: + enabled: true + cost_power: 1 + cost_weight: 4.5 + critical_cost: 300.0 + consider_footprint: true + collision_cost: 1000000.0 + near_goal_distance: 0.8 + trajectory_point_step: 2 + + GoalCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 1.0 + + GoalAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 0.45 + + PathAlignCritic: + enabled: true + cost_power: 1 + cost_weight: 10.0 + max_path_occupancy_ratio: 0.07 + trajectory_point_step: 3 + threshold_to_consider: 0.45 + offset_from_furthest: 12 + use_path_orientations: false + + PathFollowCritic: + enabled: true + cost_power: 1 + cost_weight: 8.0 + offset_from_furthest: 6 + threshold_to_consider: 1.0 + + PathAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 8.0 + offset_from_furthest: 5 + threshold_to_consider: 0.45 + max_angle_to_furthest: 1.2 + forward_preference: false + + PreferForwardCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 0.4 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 8.0 + publish_frequency: 4.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 4 + height: 4 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.06 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.25 + always_send_full_costmap: True + local_costmap_client: + ros__parameters: + use_sim_time: False + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +global_costmap: + global_costmap: + ros__parameters: + update_frequency: 2.0 + publish_frequency: 1.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 10 + height: 10 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.50 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.45 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: False + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +planner_server: + ros__parameters: + planner_plugins: ["GridBased"] + use_sim_time: False + GridBased: + plugin: "nav2_smac_planner/SmacPlannerHybrid" + downsample_costmap: false + downsampling_factor: 1 + tolerance: 0.20 + allow_unknown: false + max_iterations: 1000000 + max_on_approach_iterations: 1000 + max_planning_time: 5.0 + motion_model_for_search: "REEDS_SHEPP" + angle_quantization_bins: 72 + analytic_expansion_ratio: 3.5 + analytic_expansion_max_length: 2.0 + minimum_turning_radius: 0.60 + reverse_penalty: 2.2 + change_penalty: 0.5 + non_straight_penalty: 0.85 + cost_penalty: 4.5 + retrospective_penalty: 0.015 + lookup_table_size: 5.0 + cache_obstacle_heuristic: false + viz_expansions: false + smooth_path: True + smoother: + max_iterations: 1000 + w_smooth: 0.35 + w_data: 0.25 + tolerance: 1.0e-10 + do_refinement: true + refinement_num: 2 + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +smoother_server: + ros__parameters: + use_sim_time: False + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 10.0 + behavior_plugins: ["backup", "wait"] + backup: + plugin: "nav2_behaviors/BackUp" + backup_dist: 0.30 + backup_speed: 0.08 + wait: + plugin: "nav2_behaviors/Wait" + wait_duration: 0.5 + global_frame: odom + robot_base_frame: base_footprint + transform_tolerance: 0.5 + use_sim_time: False + simulate_ahead_time: 2.0 + max_rotational_vel: 0.8 + min_rotational_vel: 0.2 + rotational_acc_lim: 1.5 + +robot_state_publisher: + ros__parameters: + use_sim_time: False + +waypoint_follower: + ros__parameters: + loop_rate: 20 + use_sim_time: False + 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 + +velocity_smoother: + ros__parameters: + use_sim_time: False + smoothing_frequency: 20.0 + scale_velocities: False + feedback: "OPEN_LOOP" + max_velocity: [0.25, 0.0, 1.8] + min_velocity: [-0.15, 0.0, -1.8] + max_accel: [0.50, 0.0, 1.50] + max_decel: [-0.60, 0.0, -1.80] + odom_topic: /odom_combined + odom_duration: 0.1 + deadband_velocity: [0.02, 0.0, 0.02] + velocity_timeout: 1.0 diff --git a/src/navigation/obstacle_nav2/config/nav2_params_basic_tracking.yaml b/src/navigation/obstacle_nav2/config/nav2_params_basic_tracking.yaml new file mode 100644 index 0000000..8e48bce --- /dev/null +++ b/src/navigation/obstacle_nav2/config/nav2_params_basic_tracking.yaml @@ -0,0 +1,349 @@ +# ============================================================================ +# nav2_params_basic_tracking.yaml +# +# Basic stable trajectory-following profile for obstacle_nav2. +# This file is intentionally conservative: low speed, longer MPPI horizon, +# smoother acceleration, moderate path tracking weights, and Ackermann limits. +# +# It does not replace nav2_params.yaml. To use it, launch Nav2 with this params +# file or add a launch argument later. +# ============================================================================ + +bt_navigator: + ros__parameters: + use_sim_time: False + global_frame: odom + robot_base_frame: base_footprint + odom_topic: /odom_combined + bt_loop_duration: 50 + default_server_timeout: 20 + default_nav_to_pose_bt_xml: "" + 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_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_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_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_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_truncate_path_local_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_path_expiring_timer_condition + - 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 + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: False + +controller_server: + ros__parameters: + use_sim_time: False + controller_frequency: 20.0 + + FollowPath: + plugin: "nav2_mppi_controller::MPPIController" + + # Longer horizon and moderate sampling make turns easier to discover. + time_steps: 48 + model_dt: 0.05 + batch_size: 1000 + iteration_count: 1 + + # Conservative velocity exploration. Speed is deliberately not optimized. + vx_std: 0.12 + vy_std: 0.0 + wz_std: 0.85 + vx_max: 0.25 + vx_min: -0.15 + vy_max: 0.0 + wz_max: 1.8 + + # Lower temperature makes selection steadier; gamma damps rough controls. + temperature: 0.25 + gamma: 0.02 + + motion_model: "Ackermann" + visualize: false + TrajectoryVisualizer: + trajectory_step: 5 + time_step: 3 + AckermannConstraints: + min_turning_r: 0.60 + + critics: ["ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic"] + + ConstraintCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + + CostCritic: + enabled: true + cost_power: 1 + cost_weight: 4.5 + critical_cost: 300.0 + consider_footprint: true + collision_cost: 1000000.0 + near_goal_distance: 0.8 + trajectory_point_step: 2 + + GoalCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 1.0 + + GoalAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 0.45 + + PathAlignCritic: + enabled: true + cost_power: 1 + cost_weight: 10.0 + max_path_occupancy_ratio: 0.07 + trajectory_point_step: 3 + threshold_to_consider: 0.45 + offset_from_furthest: 12 + use_path_orientations: false + + PathFollowCritic: + enabled: true + cost_power: 1 + cost_weight: 8.0 + offset_from_furthest: 6 + threshold_to_consider: 1.0 + + PathAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 8.0 + offset_from_furthest: 5 + threshold_to_consider: 0.45 + max_angle_to_furthest: 1.2 + forward_preference: false + + PreferForwardCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + threshold_to_consider: 0.4 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 8.0 + publish_frequency: 4.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 4 + height: 4 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.06 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.25 + always_send_full_costmap: True + local_costmap_client: + ros__parameters: + use_sim_time: False + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +global_costmap: + global_costmap: + ros__parameters: + update_frequency: 2.0 + publish_frequency: 1.0 + transform_tolerance: 0.5 + global_frame: odom + robot_base_frame: base_footprint + use_sim_time: False + rolling_window: true + width: 10 + height: 10 + resolution: 0.05 + footprint: "[[0.14, 0.085], [0.14, -0.085], [-0.14, -0.085], [-0.14, 0.085]]" + footprint_padding: 0.02 + track_unknown_space: false + plugins: ["obstacle_array_layer", "inflation_layer"] + obstacle_array_layer: + plugin: "obstacle_nav2::ObstacleArrayLayer" + enabled: true + topic: /obstacles + obstacle_timeout: 0.5 + transform_tolerance: 0.2 + default_obstacle_radius: 0.05 + minimum_obstacle_radius: 0.02 + maximum_obstacle_radius: 0.50 + extra_inflation: 0.02 + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.45 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: False + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: False + +planner_server: + ros__parameters: + planner_plugins: ["GridBased"] + use_sim_time: False + GridBased: + plugin: "nav2_smac_planner/SmacPlannerHybrid" + downsample_costmap: false + downsampling_factor: 1 + tolerance: 0.20 + allow_unknown: false + max_iterations: 1000000 + max_on_approach_iterations: 1000 + max_planning_time: 5.0 + motion_model_for_search: "REEDS_SHEPP" + angle_quantization_bins: 72 + analytic_expansion_ratio: 3.5 + analytic_expansion_max_length: 2.0 + minimum_turning_radius: 0.60 + reverse_penalty: 2.2 + change_penalty: 0.5 + non_straight_penalty: 0.85 + cost_penalty: 4.5 + retrospective_penalty: 0.015 + lookup_table_size: 5.0 + cache_obstacle_heuristic: false + viz_expansions: false + smooth_path: True + smoother: + max_iterations: 1000 + w_smooth: 0.35 + w_data: 0.25 + tolerance: 1.0e-10 + do_refinement: true + refinement_num: 2 + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: False + +smoother_server: + ros__parameters: + use_sim_time: False + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 10.0 + behavior_plugins: ["spin", "backup", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + backup_dist: 0.30 + backup_speed: 0.08 + wait: + plugin: "nav2_behaviors/Wait" + wait_duration: 0.5 + global_frame: odom + robot_base_frame: base_footprint + transform_tolerance: 0.5 + use_sim_time: False + simulate_ahead_time: 2.0 + max_rotational_vel: 0.8 + min_rotational_vel: 0.2 + rotational_acc_lim: 1.5 + +robot_state_publisher: + ros__parameters: + use_sim_time: False + +waypoint_follower: + ros__parameters: + loop_rate: 20 + use_sim_time: False + 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 + +velocity_smoother: + ros__parameters: + use_sim_time: False + smoothing_frequency: 20.0 + scale_velocities: False + feedback: "OPEN_LOOP" + max_velocity: [0.25, 0.0, 1.8] + min_velocity: [-0.15, 0.0, -1.8] + max_accel: [0.50, 0.0, 1.50] + max_decel: [-0.60, 0.0, -1.80] + odom_topic: /odom_combined + odom_duration: 0.1 + deadband_velocity: [0.02, 0.0, 0.02] + velocity_timeout: 1.0