move_base not avoiding obstacles
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}
dwalocalplanner:
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
Asked by me_saw on 2020-05-13 12:00:48 UTC
Answers
@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.
Asked by Yehor on 2020-05-14 05:06:23 UTC
Comments
Yeah, I changed that to 0.5
can you please go through the comments
Asked by me_saw on 2020-05-14 05:09:55 UTC
@me_saw We need a to check costmap to understand where is the problem.
Add additional map to rviz and choose there local_costmap
Asked by Yehor on 2020-05-14 05:48:38 UTC
@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.
Asked by me_saw on 2020-05-14 05:58:00 UTC
@me_saw check what type of msg produced by the laser. Is it LaserScan?
Asked by Yehor on 2020-05-14 06:07:47 UTC
@me_saw your robot does not avoid obstacle because it doesn't have local_costmap, so it doesn't know anything about the environment
Asked by Yehor on 2020-05-14 06:09:25 UTC
@Yehor it is LaserScan msg
Asked by me_saw on 2020-05-14 06:30:16 UTC
@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
Asked by Yehor on 2020-05-14 06:37:36 UTC
This parameter: /move_base/local_costmap/obstacle_layer/laser_scan_sensor/data_type
Asked by Yehor on 2020-05-14 06:40:10 UTC
okay thanks for the help I'll check that
Asked by me_saw on 2020-05-14 06:45:56 UTC
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?
Asked by hashirzahir on 2020-05-13 22:15:37 UTC
@hashirzahir i've edited the question and added the cofigs and screenshot
Asked by me_saw on 2020-05-13 23:06:18 UTC
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?
Asked by hashirzahir on 2020-05-13 23:51:39 UTC
@hashirzahir i've added the RVIZ screenshot but i didn't bring the obstacle in this
Asked by me_saw on 2020-05-14 01:02:53 UTC
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-content/uploads/2018/05/Save-and-load-RViz-configuration.png
Asked by hashirzahir on 2020-05-14 03:19:58 UTC
@hashirzahir I've updated it
Asked by me_saw on 2020-05-14 04:12:29 UTC
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.
Asked by hashirzahir on 2020-05-14 04:26:53 UTC
@hashirzahir
/sk/laser/scan
this is my laser topic and I;m getting values in thiscan you please cross check it once in costmap is correct
Asked by me_saw on 2020-05-14 04:41:30 UTC
@hashirzahir have checked that file again there was mistake in the sensor_frame I've corrected that
but now it gives the error as
[ERROR] [1589450400.368134696, 9.932000000]: 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.
thank you!
Asked by me_saw on 2020-05-14 05:03:01 UTC
@hashirzahir what to do if the laser source is being ignored by move_base. It is in fact the problem which I'm encountering. I opened my rt_graph and move_base is not getting data from /scan i.e LaserScan. Is there a general way to debug and correct this or is it a problem with my move_base.launch file and the parameter(yaml) files? Thanks in advance
Asked by pk99 on 2021-04-23 11:15:52 UTC