Robotics StackExchange | Archived questions

Local path won't follow Global Path, the robot goes through the obstacles ignoring the global path

Hello,

I've been working on a project with ros melodic on ubuntu 18.04, that require a Jetbot robot to achieve autonomous navigation through an arena. In this project I don't have a laser scan or point cloud. The robot will get his localization info from another topic (using apriltags actually). so I tried to configure my files as follows:

move_base.launch

<launch>

  <arg name="no_static_map" default="false"/>

  <arg name="base_global_planner" default="navfn/NavfnROS"/>
  <arg name="base_local_planner" default="dwa_local_planner/DWAPlannerROS"/>
  <!-- <arg name="base_local_planner" default="base_local_planner/TrajectoryPlannerROS"/> -->

  <arg name="map_file" default="$(find path_planning)/config/arena_map.yaml"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />


  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <param name="base_global_planner" value="$(arg base_global_planner)"/>
    <param name="base_local_planner" value="$(arg base_local_planner)"/>  
    <rosparam file="$(find path_planning)/config/planner.yaml" command="load"/>

    <!-- observation sources located in costmap_common.yaml -->
    <rosparam file="$(find path_planning)/config/costmap_common.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find path_planning)/config/costmap_common.yaml" command="load" ns="local_costmap" />

    <!-- local costmap, needs size -->
    <rosparam file="$(find path_planning)/config/costmap_local.yaml" command="load" ns="local_costmap" />


    <!-- static global costmap, static map provides size -->
    <rosparam file="$(find path_planning)/config/costmap_global_static.yaml" command="load" ns="global_costmap" unless="$(arg no_static_map)"/>
    <remap from="cmd_vel" to="/jetbot_velocity_controller/cmd_vel"/>

  </node>

</launch>

planner.yaml is as follows:

controller_frequency: 5.0
recovery_behaviour_enabled: true

NavfnROS:
  allow_unknown: true # Specifies whether or not to allow navfn to create plans that traverse unknown space.
  default_tolerance: 0.1 # A tolerance on the goal point for the planner.

TrajectoryPlannerROS:
  # Robot Configuration Parameters
  acc_lim_x: 2.5
  acc_lim_theta:  3.2

  max_vel_x: 1.0
  min_vel_x: 0.0

  max_vel_theta: 1.0
  min_vel_theta: -1.0
  min_in_place_vel_theta: 0.2

  holonomic_robot: false
  escape_vel: -0.1

  # Goal Tolerance Parameters
  yaw_goal_tolerance: 0.1
  xy_goal_tolerance: 0.2
  latch_xy_goal_tolerance: false

  # Forward Simulation Parameters
  sim_time: 2.0
  sim_granularity: 0.02
  angular_sim_granularity: 0.02
  vx_samples: 6
  vtheta_samples: 20
  controller_frequency: 20.0

  # Trajectory scoring parameters
  meter_scoring: true 
  occdist_scale:  0.1 
  pdist_scale: 0.75 
  gdist_scale: 1.0 

  heading_lookahead: 0.325 
  heading_scoring: false  
  heading_scoring_timestep: 0.8   
  dwa: true 
  simple_attractor: false
  publish_cost_grid_pc: true  

  # Oscillation Prevention Parameters
  oscillation_reset_dist: 0.25 
  escape_reset_dist: 0.1
  escape_reset_theta: 0.1

DWAPlannerROS:
  # Robot configuration parameters  
  acc_lim_x: 2.5
  acc_lim_y: 0
  acc_lim_th: 3.2

  max_vel_x: 0.12
  min_vel_x: 0.00
  max_vel_y: 0
  min_vel_y: 0

  max_vel_trans: 0.5
  min_vel_trans: 0.1
  max_vel_theta: 1.0
  min_vel_theta: 0.2

  # Goal Tolerance Parameters
  yaw_goal_tolerance: 0.1
  xy_goal_tolerance: 0.2
  latch_xy_goal_tolerance: false

costmap_common.yaml is as follows:

footprint: [[-0.075, 0.00], [-0.075, 0.00], [-0.075, 0.095], [0.075, 0.095]]
footprint_padding: 0.01

robot_base_frame: base_footprint
update_frequency: 4.0
publish_frequency: 3.0
transform_tolerance: 0.5

resolution: 0.05

#layer definitions
static:
    map_topic: /map
    subscribe_to_updates: true

inflation:
    inflation_radius: 1.0

costmapglobalstatic.yaml is as follows:

global_frame: map
rolling_window: false

plugins:
  - {name: static_layer,         type: "costmap_2d::StaticLayer"}
  - {name: obstacles_layer,      type: "costmap_2d::VoxelLayer"}
  - {name: inflation_layer,      type: "costmap_2d::InflationLayer"}

costmap_local.yaml is as follows:

global_frame: map
robot_base_frame: base_footprint
rolling_window: true
resolution: 0.05

width: 6.0
height: 6.0

plugins:
  - {name: obstacle,           type: "costmap_2d::ObstacleLayer"}
  - {name: inflation,          type: "costmap_2d::InflationLayer"}

Since I don't have laser scanner or pointcloud, I build the global cosmap using numpy and the global plan seems just fine. It avoid all obstacles. The problem is that the local planner doesn't seem to go through the global plan. It just goes straight to the goal and crashes in the obstacles in its way or follow the global plan very poorly. (you could see what I mean here on this youtube video: https://www.youtube.com/watch?v=jyLjT3y-16w I've tried to modify some parameters like width and height of the local costmap and the robot footprint. I've tried to miss around with the Forward Simulation Parameters simulation like sim_time but the result doesn't seem to be tuned at all. Is it some kind of configuration I'm missing?

Asked by alfares on 2023-05-25 14:14:30 UTC

Comments

Answers