0
$\begingroup$

Rosanswers logo

image descriptionHello Everyone,

I am trying to use the DWA planner of the navigation stack with a static map of the office floor loaded. The robot is of rectangular shape and uses 4 sonar sensors and a kinect sensor for obstacle detection. When we give a destination on a straight line the robot moves swiftly to its goal, but if i have a turn it goes and hit the edges. In the RVIZ simulator i can see the footprint of the robot going to hit the edges as in the static map but still the robot goes the same path. Ideally as per the tutorial the DWA planner will ensure the footprint is not in touch with the obstacles.

dwa_local_planner.yaml file below

controller_frequency: 1.0
DWAPlannerROS:

# Robot Configuration Parameters
  max_vel_x: 1.0 #0.3  # 0.5
  min_vel_x: 0.1 # 0.0

  max_vel_y: 0.0  # diff drive robot
  min_vel_y: 0.0  # diff drive robot

  max_trans_vel: 1.0
  min_trans_vel: 0.0

  max_rot_vel: 0.5 # 1.0
  min_rot_vel: -0.5  # could set this lower


  acc_lim_x: 1.0
  acc_lim_th: 1.0 # 1.0 
  acc_lim_y:  0.0     # diff drive robot


# Goal Tolerance Parameters
  yaw_goal_tolerance: 0.05  # 0.05
  xy_goal_tolerance: 0.15  # 0.10
  latch_xy_goal_tolerance: false

# Forward Simulation Parameters
  sim_time: 1.0       # 1.7
  vx_samples: 20       # 3
  vy_samples: 1       # diff drive robot
  vtheta_samples: 20  # 20
  meter_scoring: true
  penalize_negative_x: false

# Oscillation Prevention Parameters
  oscillation_reset_dist: 0.05  # 0.05   - how far to travel before resetting oscillation flags

# Debugging
  publish_traj_pc : true
  publish_cost_grid_pc: true
  global_frame_id: map


# Differential-drive robot configuration - necessary?
  holonomic_robot: false

Moreover if i give a heading in opposite direction the robot doesnt do a in place rotation even when there is sufficient space.

I would like to attach all the yaml files but dont have sufficient points to load it.

Any response much appreciated.

Including rest of the yaml files

costmap_common_params.yaml

    obstacle_range: 0.5
raytrace_range: 1.0
max_obstacle_height:  1.75
#footprint: [[-0.3,-0.29],[-0.3,0.29],[0.3,0.29],[0.48,0.0], [0.3,-0.29]]
#footprint_radius: 0.5
robot_radius: 0.4
inflation_radius: 0.15

obstacles: laser_scan sonar_scan_1 sonar_scan_2 sonar_scan_3 sonar_scan_4
observation_sources: laser_scan sonar_scan_1 sonar_scan_2 sonar_scan_3 sonar_scan_4


laser_scan_sensor: {data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: -0.05, max_obstacle_height: 2.0}
sonar_scan_1: {data_type: LaserScan, topic: sonar_scan_1, marking: true, clearing: true, min_obstacle_height: -1.0 , max_obstacle_height: 2.0}
sonar_scan_2: {data_type: LaserScan, topic: sonar_scan_2, marking: true, clearing: true, min_obstacle_height: -1.0, max_obstacle_height: 2.0}
sonar_scan_3: {data_type: LaserScan, topic: sonar_scan_3, marking: true, clearing: true, min_obstacle_height: -1.0 , max_obstacle_height: 2.0}
sonar_scan_4: {data_type: LaserScan, topic: sonar_scan_4, marking: true, clearing: true, min_obstacle_height: -1.0, max_obstacle_height: 2.0}

global_costmap_params.yaml

global_costmap:
  global_frame: /map
  robot_base_frame: /base_link
  update_frequency: 5.0
  publish_frequency: 1.0
  static_map: true
  rolling_window: false
  resolution: 0.05
  map_type: costmap
  transform_tolerance: 0.5

local_costmap_params.yaml

local_costmap:
  global_frame: /map
  robot_base_frame: /base_link
  update_frequency: 5.0
  publish_frequency: 1.0
  static_map: false
  rolling_window: true
  width: 3.0
  height: 3.0
  resolution: 0.01
  transform_tolerance: 0.5

  map_type: costmap

move_base.launch

<launch>
  <env name="ROSCONSOLE_CONFIG_FILE"
        value="$(find security_robot_2dnav)/rosconsole.conf"/>

  <master auto="start"/>

  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find security_robot_2dnav)/map.yaml"/>

  <!--- Run AMCL -->
  <include file="$(find amcl)/examples/amcl_diff.launch" />

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
    <rosparam file="$(find security_robot_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find security_robot_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find security_robot_2dnav)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find security_robot_2dnav)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find security_robot_2dnav)/dwa_local_planner_params.yaml" command="load" />
  </node>
</launch>

Thanks, Nithin


Originally posted by Nithin on ROS Answers with karma: 53 on 2014-11-20

Post score: 2


Original comments

Comment by Nithin on 2014-11-21:
Any idea on the above issue?

Comment by ahendrix on 2014-11-21:
I don't have any good ideas. I've bumped your karma; you should be able to attach files now. In particular, the global and local costmap configurations, and maybe a screenshot of rviz when the robot is not doing the right thing.

Comment by AReimann on 2014-11-23:
Could you maybe check if the robot also hits the edges if you have a round footprint? Could be that there are bugs for rectengular shaped footprints as it is not tested / used that much..

Comment by Nithin on 2014-11-24:
Tried with circular footprint but still the robot goes and hits the obstacles. Looks like for attching any files i need points greater than 20 which i dont . so cant attach even the screen shots. Have added all the yaml files. Should i be changing global planner to sbpl?

Thanks, Nithin

Comment by ahendrix on 2014-11-24:
Hitting obstacles is entirely the fault of the local planner; you shouldn't need to change the global planner. I've bumped your karma above 20, so you should be able to attach files now.

Comment by Nithin on 2014-11-24:
But the global path itself is taking the robot close to the edges around corners. All the yaml files has been now included as part of the question itself. Attaching the screen shot of rviz simulator where the footprint is in contact with the obstacles

Comment by AReimann on 2014-11-25:
What are the dimensions of your robt? And could you add a screenshot which shows the global path in it? Maybe also add the paramater occdist_scale in the dwa_local_planner.yaml and set it to 0.5.

Comment by AReimann on 2014-11-25:
Your local costmap resolution should be the same as the global one (0.05)

Comment by Nithin on 2014-11-25:
Robot dimension is 69X52 cm.The black path in the screenshot previously attached actually shows the global path.Will try to get a better screenshot next time. Will change the Resolution and update you

Comment by shivammalviya71 on 2020-11-19:
Hi!! was anybody able to solve it? Please help if you could.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Which version of ROS are you using? It looks like you're using an older version of the nav stack configuration for obstacle sources.

Obstacle avoidance is performed based on the local costmap, but it looks like you're visualizing the global costmap. Does the robot's footprint intersect with obstacles in the local costmap?

The global planner will tend to plan close to obstacles near corners; this is one effect of finding the shortest path. It should be possible to tune this, but you should save that for later, once the local planner no longer runs into obstacles.


Originally posted by ahendrix with karma: 47576 on 2014-11-25

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Nithin on 2014-11-25:
I am using ROS hydro. In local costmap it does try to avoid intersecting with the obstacles sometimes. But most often it doesnt. But i can see obstacle detected in the rviz simulator

Comment by ahendrix on 2014-11-25:
rviz is a visualizer, not a simulator. I assume you're running navigation on a real robot?

Comment by ahendrix on 2014-11-25:
Does the robot physically drive into obstacles? If it drives into obstacles very slowly, you may want to try decreasing min_vel_x to 0

Comment by Nithin on 2014-11-25:
Yes the robot physically drives into obstacles at reasonable speed as if there is no obstacle at all. We had tried to reduce the speed also but it didnt help.

Comment by ahendrix on 2014-11-25:
Are you absolutely certain your obstacles are correctly represented in the LOCAL costmap? Please post a screenshot of rviz showing only the robot's footprint and the local costmap.

Comment by Peter Heim on 2014-11-25:
I have the same problem when i adjusted the accel lim x to 5 and sim time to 3.6 it would go around the obstacles with the odd stumble I using hydro with a arbotix in simulation mode the longer sim time is really a cheat as it takes the robot further away from the global path

Comment by Nithin on 2014-11-26:
I have noticed now when the robot moves the footprint keeps drifting sometimes in rviz although i dont see much deflection in odometry. Moreover I am using odo fused with yaw using robot_pose_ekf. Not sure why the robot suddenly drifts while navigating. Will attach better screenshot of the localcmap

Comment by AReimann on 2014-11-27:
@Peter Heim What is your map resolution? You have to adjust the forward_point_distance if your resolution is different than 0.05 or the position accuracy of your robot is lower. If it "cuts" corners, set it lower (scale it the same way as the resolution), but at least the the size of the resolution.

Comment by AReimann on 2014-11-27:
@Nithin What do you mean by fused with yaw? What is yaw? Can you show a screenshot where the global planner plans into an object?

Comment by Peter Heim on 2014-11-28:
Map resolution is 0.05 i have tried forward_point_distance with 0.01 ,0.325 and 0.6 with no difference I don’t know if cut corners is the right term the path comes very close the the obstacles the local planer just wont plan away from the obstacle but seem to plan into it I will post a video soon

Comment by AReimann on 2014-11-28:
Can you include the global path, the trajectory cloud and the potential map with channel name put to total_cost? Settings should look something like this: http://i.imgur.com/h3xI3JD.png (arrows are odometry) Maybe make a seperate question

Comment by Peter Heim on 2014-11-28:
It will take a while to do but i don’t have the DWAPlanerROs only movebase and no trajectory cloud as per your example are you running Hydro? or have i missed a big step?

Comment by AReimann on 2014-11-28:
I'm running indigo but also should work on Hydro, add the parameters publish_cost_grid_pc and publish_traj_pc and set them to true, see here: https://github.com/turtlebot/turtlebot_apps/blob/indigo/turtlebot_navigation/param/dwa_local_planner_params.yaml#L50

$\endgroup$

Your Answer

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