ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

move_base not avoiding obstacles

asked 2020-05-13 12:00:48 -0500

me_saw gravatar image

updated 2020-05-14 04:11:05 -0500

I have implemented the move_base correctly i guess, in a predefined map move_base is working fine it's creating path correctly but when i drag and drop a obstacles from gazebo it's not avoiding that though the laser is scanning the object but its not avoiding

And i also implemented the move_base with robot_localization for outdoor using GPS. I'm spawning the model with an empty map everything is working fine but the same problem, move_base is not avoiding obstacles

base_local planar:

TrajectoryPlannerROS:
  max_vel_x: 0.18
  min_vel_x: 0.08
  max_vel_theta: 1.0
  min_in_place_vel_theta: -1.0

  acc_lim_theta: 0.6
  acc_lim_x: 1.0
  acc_lim_y: 0.5

  xy_goal_tolerance: 0.10
  yaw_goal_tolerance: 0.05


  holonomic_robot: false
  sim_time: 0.8
  vx_samples: 18
  vtheta_samples: 20
  sim_granularity: 0.05

costmap:

obstacle_range: 2.0
raytrace_range: 3.0

robot_radius: 0.34 
inflation_radius: 5.0
map_type: costmap
observation_sources: laser_scan_sensor 
laser_scan_sensor: {sensor_frame: hokuyo, data_type: LaserScan, topic: /sk/laser/scan, marking: true, clearing: true}

dwa_local_planner:

DWAPlannerROS:

    # Robot Configuration Parameters
      max_vel_x: 0.22
      min_vel_x: -0.22

      max_vel_y: 0.0
      min_vel_y: 0.0

    # The velocity when robot is moving in a straight line
      max_trans_vel:  0.2
      min_trans_vel:  0.11

      max_rot_vel: 2.75
      min_rot_vel: 1.37

      acc_lim_x: 2.5
      acc_lim_y: 0.0
      acc_lim_theta: 3.2 

    # Goal Tolerance Parametes
      xy_goal_tolerance: 0.05
      yaw_goal_tolerance: 0.17
      latch_xy_goal_tolerance: false

    # Forward Simulation Parameters
      sim_time: 1.5
      vx_samples: 20
      vy_samples: 0
      vth_samples: 40
      controller_frequency: 2.0

    # Trajectory Scoring Parameters
      path_distance_bias: 32.0
      goal_distance_bias: 20.0
      occdist_scale: 0.02
      forward_point_distance: 0.325
      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_planar:

global_costmap:
  global_frame: map
  robot_base_frame: base_link
  update_frequency: 2.0
  publish_frequency: 2.0
  transform_tolerance: 0.5
  static_map: true

local_costmap:

local_costmap:
      global_frame: odom
      robot_base_frame: base_link
      update_frequency: 2.0
      publish_frequency: 2.0
      transform_tolerance: 0.3 
      static_map: false
      rolling_window: true
      width: 3.0
      height: 3.0
      resolution: 0.05

image description

image description

edit retag flag offensive close merge delete

Comments

Could you share your move base configs (local, global costmap and local planner configs) and maybe a screenshot of why you think its not avoiding obstacles?

hashirzahir gravatar image hashirzahir  ( 2020-05-13 22:15:37 -0500 )edit

@hashirzahir i've edited the question and added the cofigs and screenshot

me_saw gravatar image me_saw  ( 2020-05-13 23:06:18 -0500 )edit

What you have provided so far is great. Could you also provide the local and global costmap layers as well as the paths generated by TrajectoryPlanner as a screenshot from RVIZ?

hashirzahir gravatar image hashirzahir  ( 2020-05-13 23:51:39 -0500 )edit

@hashirzahir i've added the RVIZ screenshot but i didn't bring the obstacle in this

me_saw gravatar image me_saw  ( 2020-05-14 01:02:53 -0500 )edit
1

It would be helpful if you added the screenshot with the obstacle in play. Otherwise it is difficult to debug as I am unaware of the path produced by DWAPlannerROS while you added this new obstacle. The gazebo screenshot does not tell me much since gazebo is just the physics simulator and all the path planning and obstacle avoidance components are done on the ROS end, which is nicely visualized in RVIZ.

Also, I note that the local costmap inflation cannot be seen in the RVIZ screenshot. It would be helpful if you could format your RVIZ local and global costmap to look like this: https://www.theconstructsim.com/wp-co...

hashirzahir gravatar image hashirzahir  ( 2020-05-14 03:19:58 -0500 )edit

@hashirzahir I've updated it

me_saw gravatar image me_saw  ( 2020-05-14 04:12:29 -0500 )edit
2

I still dont see your local costmap though. There should be 2 separate costmaps, a large global costmap (black and white) and a small local costmap (blue and pink). Configure the colour on RVIZ. If I had to guess, only the static_map is being loaded and your laser source is being ignored (or your laser source is not publishing to the right topic) and hence does not contribute to the costmap, resulting in DWA planner just plotting a path as if nothing were there.

hashirzahir gravatar image hashirzahir  ( 2020-05-14 04:26:53 -0500 )edit

@hashirzahir/sk/laser/scan this is my laser topic and I;m getting values in this

can you please cross check it once in costmap is correct

me_saw gravatar image me_saw  ( 2020-05-14 04:41:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-14 05:06:23 -0500

Yehor gravatar image

updated 2020-05-14 05:07:07 -0500

@me_saw I think that inflation radius 5.0 is too much. It means 5 meters. Add a local and global costmap to rviz and check it.

edit flag offensive delete link more

Comments

Yeah, I changed that to 0.5

can you please go through the comments

me_saw gravatar image me_saw  ( 2020-05-14 05:09:55 -0500 )edit

@me_saw We need a to check costmap to understand where is the problem.

Add additional map to rviz and choose there local_costmap

Yehor gravatar image Yehor  ( 2020-05-14 05:48:38 -0500 )edit

@Yehor i changed to local_costmap but there's nothing visible

at first i was not using the correct laser frame now corrected, now I'm getting the error as

[ERROR] [1589453585.535521441, 3.498000000]: Client [/move_base] wants topic /sk/laser/scan to have datatype/md5sum [sensor_msgs/PointCloud/d8e9c3f5afbdd8a130fd1d2763945fca], but our version has [sensor_msgs/LaserScan/90c7ef2dc6895d81024acba2ac42f369]. Dropping connection.
me_saw gravatar image me_saw  ( 2020-05-14 05:58:00 -0500 )edit

@me_saw check what type of msg produced by the laser. Is it LaserScan?

Yehor gravatar image Yehor  ( 2020-05-14 06:07:47 -0500 )edit

@me_saw your robot does not avoid obstacle because it doesn't have local_costmap, so it doesn't know anything about the environment

Yehor gravatar image Yehor  ( 2020-05-14 06:09:25 -0500 )edit

@Yehor it is LaserScan msg

me_saw gravatar image me_saw  ( 2020-05-14 06:30:16 -0500 )edit

@me_saw that is strange because the move_base thinks that is needs PointCloud. However, in the observation source, you specify that it is LaserScan

Try to restart and check the parameters, rosparam. Try to find information related to local_constmap observation source

Yehor gravatar image Yehor  ( 2020-05-14 06:37:36 -0500 )edit

This parameter: /move_base/local_costmap/obstacle_layer/laser_scan_sensor/data_type

Yehor gravatar image Yehor  ( 2020-05-14 06:40:10 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-05-13 12:00:48 -0500

Seen: 1,334 times

Last updated: May 14 '20