Robotics StackExchange | Archived questions

robot starts moving toward the goal,but it cannot identify the objects Infront of it!!

hi everyone,

my problem is about object detection and collision avoidance. when the robot starts moving toward the goal, it cannot identify the objects in Infront of it and hit them. I have defined the inflationlayer, obstacleheight, and footprint of the robot in cost-common-params. we are using 'navfn/NavfnROS' as globalplanner and 'dwalocalplanner/DWAPlannerROS' as localplanner. I have attached the related move-base params. I am using rtabmap in mapping mode (SLAM) and i have activated rolling-window as well. so I would be grateful if anybody can help?! thanks

image description image description

##costmap-common-params:

max_obstacle_height: 2.2  
footprint: [[-0.76, -0.69], [-0.76, 0.69], [0.76, 0.69], [0.76, -0.69]] 

footprint_padding: 0.55
map_type: voxel

voxel_layer:
  enabled:              true
  max_obstacle_height:  2.2
  origin_z:             0.0
  z_resolution:         0.5
  z_voxels:             22
  unknown_threshold:    15
  mark_threshold:       0
  combination_method:   1
  track_unknown_space:  true    
  obstacle_range: 5.0
  raytrace_range: 3.0
  publish_voxel_map: true

  observation_sources: point_cloud_sensor 
  point_cloud_sensor:
    data_type: PointCloud2
    topic: /velodyne_points
    marking: true
    clearing: true
    min_obstacle_height: 0.0
    max_obstacle_height: 2.0

inflation_layer:
  enabled:              true
  cost_scaling_factor:  1.58  
  inflation_radius:     0.9
...............................................................

...............................

#Move_base
    <launch>
      <arg name="odom_frame_id"   default="icp_odom"/>
      <arg name="base_frame_id"   default="base_link"/>
      <arg name="global_frame_id" default="map"/>
      <arg name="odom_topic" default="/rtabmap/odom" />            

      <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/costmap_common_params.yaml" command="load" ns="local_costmap" />   
        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/local_costmap_params.yaml" command="load" /> 
        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/move_base_params.yaml" command="load" />

        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/navfn_global_planner_params.yaml" command="load" />
        <rosparam file="$(find warthog_sim_2dnav)/para_dynamic_indoor/dwa_local_planner_params.yaml" command="load" />

        <!-- reset frame_id parameters using user input data -->
        <param name="global_costmap/global_frame" value="$(arg global_frame_id)" />
        <param name="global_costmap/robot_base_frame" value="$(arg base_frame_id)" />
        <param name="local_costmap/global_frame" value="$(arg odom_frame_id)" />
        <param name="local_costmap/robot_base_frame" value="$(arg base_frame_id)" />
        <param name="DWAPlannerROS/global_frame_id" value="$(arg odom_frame_id)" />

        <param name="base_global_planner" value="navfn/NavfnROS" />
        <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />

        <param name="controller_frequency" value="8.0" />
        <param name="controller_patience" value="2.0" />
        <remap from="odom" to="$(arg odom_topic)" />
      </node>
    </launch>



#move-base_params:
#
shutdown_costmaps: false

controller_frequency: 8.0
controller_patience: 2.0

planner_frequency: 5.0 
planner_patience: 1.0   

oscillation_timeout: 10.0
oscillation_distance: 0.2

# local planner - default is trajectory rollout
base_local_planner: "dwa_local_planner/DWAPlannerROS"

base_global_planner: "navfn/NavfnROS" #alternatives:global_planner/GlobalPlanner, carrot_planner/CarrotPlanner

recovery_behavior_enabled: true

recovery_behaviors:
  - name:'super_conservative_reset1'
    type:'clear_costmap_recovery/ClearCostmapRecovery'
  - name:'conservative_reset1'
    type:'clear_costmap_recovery/ClearCostmapRecovery'
  - name:'aggressive_reset1'
    type:'clear_costmap_recovery/ClearCostmapRecovery'
  - name:'clearing_rotation1'
    type:'rotate_recovery/RotateRecovery'
  - name:'super_conservative_reset2'
    type:'clear_costmap_recovery/ClearCostmapRecovery'
  - name:'conservative_reset2'
    type:'clear_costmap_recovery/ClearCostmapRecovery'
  - name:'aggressive_reset2'
    type:'clear_costmap_recovery/ClearCostmapRecovery'
  - name:'clearing_rotation2'
    type:'rotate_recovery/RotateRecovery'

super_conservative_reset1:
  reset_distance:3.0
conservative_reset1:
  reset_distance:1.5
aggressive_reset1:
  reset_distance:0.0
super_conservative_reset2:
  reset_distance:3.0
conservative_reset2:
  reset_distance:1.5
aggressive_reset2:
  reset_distance:0.0

#local-costmap
local_costmap:
   global_frame: icp_odom
   robot_base_frame: base_link
   update_frequency: 1.0     
   publish_frequency: 2.0     
   static_map: false
   rolling_window: true
   width: 5.0
   height: 5.0
   resolution: 0.05
   origin_x: 5.0
   origin_y: 0
   transform_tolerance: 2.0
   plugins:
    - {name: obstacles_layer,         type: "costmap_2d::ObstacleLayer"}
    - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}

#global-costmap
global_costmap:
   global_frame: odom
   robot_base_frame: base_link
   update_frequency: 1.0      
   publish_frequency: 0.5    
   static_map: true
   rolling_window: true
   width: 40
   height: 40
   transform_tolerance: 2.0
   plugins:
     - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}
     - {name: voxel_layer,             type: "costmap_2d::VoxelLayer"}


#DWAPlannerROS:
# Robot Configuration Parameters
  max_vel_x: 0.5 
  min_vel_x: 0.0    
  max_vel_y: 0.0
  min_vel_y: 0.0

  # The velocity when robot is moving in a straight line
  max_trans_vel:  1.0   
  min_trans_vel:  0.1    
  trans_stopped_vel: 0.1

  max_rot_vel: 0.2    
  min_rot_vel: 0.0    
  rot_stopped_vel: 0.8

  acc_lim_x: 1.5     
  acc_lim_theta: 3.2   
  acc_lim_y: 0.0

# Goal Tolerance Parametes
  yaw_goal_tolerance: 0.3   
  xy_goal_tolerance: 0.35  
  latch_xy_goal_tolerance: false   

# Forward Simulation Parameters
  sim_time: 1.5    #The amount of time to forward-simulate trajectories in seconds
  vx_samples: 20
  vy_samples: 1    # diff drive robot, there is only one sample
  vtheta_samples: 40

# Trajectory Scoring Parameters
  path_distance_bias: 64.0      
  goal_distance_bias: 24.0  
  occdist_scale: 0.2  
  forward_point_distance: 0.0
  stop_time_buffer: 0.2
  scaling_speed: 0.25
  max_scaling_factor: 0.2

# Oscillation Prevention Parameters
  oscillation_reset_dist: 0.05
# Debugging
  publish_traj_pc : true
  publish_cost_grid_pc: true
  global_frame_id: odom
 #sim_granularity:0.025

Asked by Delbina on 2022-02-07 06:50:51 UTC

Comments

What is the configuration of your obstacle_layer? which sensor is it using? is this sensor able to see the obstacle?

Asked by matlabbe on 2022-02-07 22:44:56 UTC

hi @matlabbe , thanks for replying i am using 3d lidar, imu, wheel odometer. yeah it can see it, i have attached a pic as well. in the pic you can see that it hits the object, but could not identfy that. I have voxel layer, i donot know i need to define obstacle layer or not!? as i read in websites, voxel layer will be defined for global costmap and obstacle layer will be define for local-costamp( as i defined them as plugin in both costmaps). I have added costmap-common-params to my question.

Asked by Delbina on 2022-02-08 03:37:10 UTC

Dear @matlabbe, would you please help me to find the solution? are these parameters defined correctly? I have used rolling-window in true mode for global cost-map as well. I have also defined footprint but i cannot see any changes in the output.

Asked by Delbina on 2022-02-08 15:12:02 UTC

hi everyone, would you please help me to find a solution?

Asked by Delbina on 2022-02-09 10:21:40 UTC

hi @ matlabbe I have attached in the question the requested info. would you please guide me?thanks

Asked by Delbina on 2022-02-12 10:19:03 UTC

your local costmap doesn't use the voxel_layer, so change obstacles_layer to voxel_layer like in your global costmap parameters. For the order of the layer, I think you should put the voxel_layer before the inflation_layer.

Asked by matlabbe on 2022-02-14 13:42:22 UTC

Answers