鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    nav2 stvl层配置后没有效果

    已定时 已固定 已锁定 已移动
    VIP问答专区
    nav2 voxellayer
    2
    2
    145
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • R
      realez 年度VIP
      最后由 编辑

      环境是wsl fishbot gazebo模拟
      参考官方文档https://docs.nav2.org/tutorials/docs/navigation2_with_stvl.html和git仓库里的配置文件,配置以后没有任何效果,无法避开低于雷达高度的障碍物,在local_costmap中也没有现实障碍物,有人成功配置过或有参考配置吗
      尝试了多个配置方案,在global_costmap中也配置过

      local_costmap:

      local_costmap:

      ros__parameters:

      update_frequency: 5.0

      publish_frequency: 2.0

      global_frame: odom

      robot_base_frame: base_link

      use_sim_time: True

      rolling_window: true

      width: 3

      height: 3

      resolution: 0.05

      robot_radius: 0.12

      # plugins: ["voxel_layer", "stvl_layer","inflation_layer"]

      plugins: ["stvl_layer","inflation_layer"]

      stvl_layer:

      plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"

      enabled: true

      voxel_decay: 15.0 # seconds if linear, e^n if exponential

      decay_model: 0 # 0=linear, 1=exponential, -1=persistent

      voxel_size: 0.02 # meters

      track_unknown_space: true # default space is known

      mark_threshold: 0 # voxel height

      update_footprint_enabled: true

      combination_method: 1 # 1=max, 0=override

      origin_z: 0.0 # meters

      publish_voxel_map: false # default off

      transform_tolerance: 0.5 # seconds

      mapping_mode: false # default off, saves map not for navigation

      map_save_duration: 60.0 # default 60s, how often to autosave

      observation_sources: rgbd1_mark rgbd1_clear

      rgbd1_mark:

      data_type: PointCloud2

      topic: /camera_sensor/points

      marking: true

      clearing: false

      obstacle_range: 3.0 # meters

      min_obstacle_height: 0.1 # default 0, meters

      max_obstacle_height: 2.0 # default 3, meters

      expected_update_rate: 0.0 # default 0, if not updating at this rate at least, remove from buffer

      observation_persistence: 0.0 # default 0, use all measurements taken during now-value, 0=latest

      inf_is_valid: false # default false, for laser scans

      filter: "passthrough" # default passthrough, apply "voxel", "passthrough", or no filter to sensor data, recommend on

      voxel_min_points: 0 # default 0, minimum points per voxel for voxel filter

      clear_after_reading: true # default false, clear the buffer after the layer gets readings from it

      rgbd1_clear:

      data_type: PointCloud2

      topic: /camera_sensor/points

      marking: false

      clearing: true

      max_z: 7.0 # default 0, meters

      min_z: 0.1 # default 10, meters

      vertical_fov_angle: 0.8745 # default 0.7, radians

      horizontal_fov_angle: 1.048 # default 1.04, radians

      decay_acceleration: 5.0 # default 0, 1/s^2. If laser scanner MUST be 0

      model_type: 0

      inflation_layer:

      plugin: "nav2_costmap_2d::InflationLayer"

      cost_scaling_factor: 3.0

      inflation_radius: 0.55

      # voxel_layer:

      # plugin: "nav2_costmap_2d::VoxelLayer"

      # enabled: True

      # publish_voxel_map: True

      # origin_z: 0.0

      # z_resolution: 0.05

      # z_voxels: 16

      # max_obstacle_height: 2.0

      # mark_threshold: 0

      # observation_sources: scan

      # scan:

      # topic: /scan

      # max_obstacle_height: 2.0

      # clearing: True

      # marking: True

      # data_type: "LaserScan"

      # raytrace_max_range: 3.0

      # raytrace_min_range: 0.0

      # obstacle_max_range: 2.5

      # obstacle_min_range: 0.0

      # static_layer:

      # plugin: "nav2_costmap_2d::StaticLayer"

      # map_subscribe_transient_local: True

      always_send_full_costmap: True

      ... other parameters ...

      local_costmap:

      local_costmap:

      ros__parameters:

      update_frequency: 5.0

      publish_frequency: 2.0

      global_frame: odom

      robot_base_frame: base_link # Ensure this matches your robot's TF

      use_sim_time: True

      rolling_window: true

      width: 3

      height: 3

      resolution: 0.05

      robot_radius: 0.12 # Or use footprint parameter

      transform_tolerance: 0.5 # Increased tolerance can help with timing issues

      # List both layers here, plus inflation

      plugins: ["scan_voxel_layer", "inflation_layer"]

      # Configuration for the standard VoxelLayer (using LaserScan)

      scan_voxel_layer:

      plugin: "nav2_costmap_2d::VoxelLayer"

      enabled: True

      publish_voxel_map: True # Publishes to /local_costmap/scan_voxel_layer/voxel_grid (namespaced)

      origin_z: 0.0

      z_resolution: 0.05

      z_voxels: 16

      max_obstacle_height: 2.0

      mark_threshold: 0

      combination_method: 1 # 1=max

      observation_sources: scan # Source name for this layer

      scan: # Configuration for the 'scan' source

      topic: /scan

      max_obstacle_height: 2.0

      clearing: True

      marking: True

      data_type: "LaserScan"

      raytrace_max_range: 3.0

      obstacle_max_range: 2.5

      # Configuration for the Spatio-Temporal Voxel Layer (using PointCloud2)

      # stvl_layer:

      # plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"

      # enabled: true

      # publish_voxel_map: true # Publishes to /local_costmap/stvl_layer/voxel_map (namespaced)

      # voxel_decay: 10.0 # Shorter decay for local map

      # decay_model: 0 # 0=linear

      # voxel_size: 0.05 # Match resolution if desired

      # track_unknown_space: true

      # mark_threshold: 0

      # update_footprint_enabled: true

      # combination_method: 1 # 1=max

      # origin_z: 0.0

      # transform_tolerance: 0.5 # Increased tolerance

      # mapping_mode: false

      # observation_sources: pointcloud # Source name for this layer

      # pointcloud: # Configuration for the 'pointcloud' source

      # data_type: PointCloud2

      # topic: /camera_sensor/points

      # marking: true

      # clearing: true # STVL can often use a single source for marking/clearing PointCloud2

      # obstacle_range: 3.0

      # min_obstacle_height: 0.05 # Catch low obstacles

      # max_obstacle_height: 2.0

      # expected_update_rate: 0.0

      # observation_persistence: 0.0

      # inf_is_valid: false

      # filter: "passthrough"

      # voxel_min_points: 1

      # # Consider adding separate mark/clear sources if clearing isn't effective

      # Configuration for the InflationLayer (runs last)

      inflation_layer:

      plugin: "nav2_costmap_2d::InflationLayer"

      cost_scaling_factor: 3.0

      inflation_radius: 0.55 # Adjust based on robot size and environment

      always_send_full_costmap: True # Useful for debugging

      local_costmap:
      local_costmap:
      ros__parameters:
      use_sim_time: True
      update_frequency: 5.0
      publish_frequency: 2.0
      global_frame: odom
      robot_base_frame: base_link
      rolling_window: true
      width: 8
      height: 8
      resolution: 0.05
      # footprint: "[ [0.254, 0.2159], [0.254, -0.2159], [-0.254, -0.2159], [-0.254, 0.2159] ]"
      # footprint_padding: 0.1
      robot_radius: 0.12
      track_unknown_space: false
      plugins: ["spatio_temporal_voxel_layer", "inflation_layer"]
      inflation_layer:
      plugin: "nav2_costmap_2d::InflationLayer"
      cost_scaling_factor: 3.0
      inflation_radius: 0.5
      spatio_temporal_voxel_layer:
      plugin: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"
      enabled: true
      voxel_decay: 15.
      decay_model: 0
      voxel_size: 0.05
      track_unknown_space: true
      unknown_threshold: 15
      mark_threshold: 0
      update_footprint_enabled: true
      combination_method: 1
      origin_z: 0.0
      publish_voxel_map: false
      transform_tolerance: 0.2
      mapping_mode: false
      map_save_duration: 60.0
      observation_sources: depth_cam
      # # lidar:
      # data_type: PointCloud2
      # topic: /sensors/lidar_0/segmented_points
      # marking: true
      # clearing: true
      # obstacle_range: 8.0
      # min_obstacle_height: 0.254
      # max_obstacle_height: 0.8
      # expected_update_rate: 0.0
      # observation_persistence: 0.0
      # inf_is_valid: false
      # filter: "voxel"
      # voxel_min_points: 0
      # clear_after_reading: true
      # max_z: 8.0
      # min_z: 0.3
      # vertical_fov_angle: 0.785398
      # vertical_fov_padding: 0.05
      # horizontal_fov_angle: 6.29
      # decay_acceleration: 15.0
      # model_type: 1
      depth_cam:
      data_type: PointCloud2
      topic: /camera_sensor/points
      marking: true
      clearing: true
      obstacle_range: 2.0
      min_obstacle_height: 0.1524
      max_obstacle_height: 0.8
      expected_update_rate: 0.0
      observation_persistence: 0.0
      inf_is_valid: false
      filter: "voxel"
      voxel_min_points: 0
      clear_after_reading: true
      max_z: 2.0
      min_z: 0.2
      vertical_fov_angle: 1.047
      horizontal_fov_angle: 1.221
      decay_acceleration: 15.0
      model_type: 0
      always_send_full_costmap: True

      小鱼小 1 条回复 最后回复 回复 引用 0
      • 小鱼小
        小鱼 技术大佬 @realez
        最后由 编辑

        @realez 暂时我也没测试过这个,蹲后续

        新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

        1 条回复 最后回复 回复 引用 0
        • 第一个帖子
          最后一个帖子
        皖ICP备16016415号-7
        Powered by NodeBB | 鱼香ROS