I have been trying to Navigate my robot in indoor as well as outdoor env. The issue is I have tested the stack with simulated Lidar in gazebo, however , I always have to move the robot at initial startup to make some free space because slam_toolbox by default do not clear out cells in front if no rays hit the walls (raycasting), however in outdoor operation, there may be no boundaries so initially for less range sensor, how can I deal with this issue.

I tweaked a lot of params in NAV2 to make the planner track the unknown space but it seems to be not resolving the condition. In the global costmap params I set the track unkown:true and the unknown_cost_value: 0 to make it as free for the Smac Hybrid Planner. Still the same issue. I tried to debug with the scans message to verify valid scans.

I have also tried to generate an empty map, following ROS1 guides of Husky robot and this issue: GPS+Navigation2 : Issues navigating with an empty map after success with a pre-built map: "Received plan with zero length"

However, the above do not uses slam as it is GPS based. How can I use slam tool box with an empty map loaded my map server. Everytime I try to load, the planner generates plan for the first time and then NAV2 getting Deactivated.

Getting some insight from experienced people will be quiet helpful. @StevenMackenski

costmap params

` global_costmap: global_costmap: ros__parameters: update_frequency: 5.0 publish_frequency: 2.0 global_frame: map robot_base_frame: base_link use_sim_time: false footprint: "[[-0.76, -0.4], [0.76, -0.4], [0.76, 0.4], [-0.76, 0.4]]"

  #robot_radius: 0.5
  resolution: 0.05
  width: 5
  height: 5
  track_unknown_space: true
  unknown_cost_value: 0
  plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
    plugin: "nav2_costmap_2d::ObstacleLayer"
    enabled: True
    observation_sources: scan
      topic: /scan
      max_obstacle_height: 3.0
      clearing: True
      marking: True
      data_type: "LaserScan"
      raytrace_max_range: 5.0 #10.0
      raytrace_min_range: 1.0
      obstacle_max_range: 5.0
      obstacle_min_range: 1.0
    plugin: "nav2_costmap_2d::StaticLayer"
    map_subscribe_transient_local: True
    plugin: "nav2_costmap_2d::InflationLayer"
    cost_scaling_factor: 2.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

  plugin: "nav2_smac_planner/SmacPlannerHybrid"
  downsample_costmap: false           # whether or not to downsample the map
  downsampling_factor: 1              # multiplier for the resolution of the costmap layer (e.g. 2 on a 5cm costmap would be 10cm)
  tolerance: 1.0 # 0.25                     # dist-to-goal heuristic cost (distance) for valid tolerance endpoints if exact goal cannot be found.
  allow_unknown: true
  cost_scaling_factor: 0.9
  neutral_cost: 50                 # allow traveling in unknown space
  max_iterations: 1000000             # maximum total iterations to search for before failing (in case unreachable), set to -1 to disable
  max_on_approach_iterations: 1000    # Maximum number of iterations after within tolerances to continue to try to find exact solution
  max_planning_time: 10.0              # max time in s for planner to plan, smooth
  motion_model_for_search: "DUBIN" #"DUBIN"    # Hybrid-A* DUBIN, REEDS_SHEPP
  angle_quantization_bins: 72         # Number of angle bins for search
  analytic_expansion_ratio: 3.5       # The ratio to attempt analytic expansions during search for final approach.
  analytic_expansion_max_length: 3.0  # For Hybrid/Lattice nodes: The maximum length of the analytic expansion to be considered valid to prevent unsafe shortcutting
  minimum_turning_radius: 3.78 #0.8 #0.5       # minimum turning radius in m of path / vehicle
  reverse_penalty: 1.4                # Penalty to apply if motion is reversing, must be => 1
  change_penalty: 0.3 # 0.1                 # Penalty to apply if motion is changing directions (L to R), must be >= 0
  non_straight_penalty: 1.2           # Penalty to apply if motion is non-straight, must be => 1
  cost_penalty: 2.0                   # Penalty to apply to higher cost areas when adding into the obstacle map dynamic programming distance expansion heuristic. This drives the robot more towards the center of passages. A value between 1.3 - 3.5 is reasonable.
  retrospective_penalty: 0.015
  lookup_table_size: 20.0             # Size of the dubin/reeds-sheep distance window to cache, in meters.
  cache_obstacle_heuristic: false     # Cache the obstacle map dynamic programming distance expansion heuristic between subsiquent replannings of the same goal location. Dramatically speeds up replanning performance (40x) if costmap is largely static.
  smooth_path: True                   # If true, does a simple and quick smoothing post-processing to the path
  viz_expansions: True                   

    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




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.