Global Planner's Costmap Empty
Hello Everyone,
I am currently trying to get the global_planner to create path. The problem I am having is that the planner is creating paths through obstacles, and static map. I followed the tutorial on setting up the navigation stack, and also other forums posts with similar issues 1 2 3.
Here are my YAML configuration files:
global_costmap_params.yaml:
global_costmap:
global_frame: /map
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 5.0
static_map: true
rolling_window: false
resolution: 0.05
always_send_full_costmap: true
plugins:
- {name: static, type: "costmap_2d::StaticLayer"}
- {name: obstacles, type: "costmap_2d::ObstacleLayer"}
- {name: inflation, type: "costmap_2d::InflationLayer"}
costmap_common_params.yaml
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[0.1, 0.1],[-0.1,-0.1],[0.1,-0.1],[-0.1,0.1]]
footprint_padding: 0.1
resolution: 0.05
inflation_radius: 0.1
update_frequency: 5.0
publish frequency: 5.0
transform_tolerance: 2.0
static:
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
Here is the launch file for the global_planner:
<launch>
<!-- planner -->
<node pkg="global_planner" type="planner" name="global_planner">
<remap from="/global_planner/goal" to="/move_base_simple/goal"/>
<rosparam file="/home/nvidia/rc_car/JetsoNavigation/Navigation_ws/param/costmap_common_params.yaml" command="load" />
<rosparam file="/home/nvidia/rc_car/JetsoNavigation/Navigation_ws/param/global_costmap_params.yaml" command="load" />
</node>
</launch>
This is how the costmap from the global planner looks like:
after running rqt_reconfigure, and adjusting the origin of the global_costmap, I am able to generate paths on the global planner, but it plans through obstacles.
Here I am running the example from the costmap_2d package, and it is picking up the static map, and obstacles from the lidar.
This is how the config file for the costmap_2d example looks like:
global_frame: /map
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 1.0
#set if you want the voxel map published
publish_voxel_map: true
#set to true if you want to initialize the costmap from a static map
static_map: true
#begin - COMMENT these lines if you set static_map to true
#rolling_window: true
#width: 3.0
#height: 3.0
#resolution: 0.025
#end - COMMENT these lines if you set static_map to true
#START VOXEL STUFF
map_type: voxel
origin_z: 0.0
z_resolution: 0.2
z_voxels: 10
unknown_threshold: 10
mark_threshold: 0
#END VOXEL STUFF
transform_tolerance: 0.3
obstacle_range: 2.5
max_obstacle_height: 2.0
min_obstacle_height: 0.0
raytrace_range: 3.0
footprint: [[-0.13, -0.08], [-0.13, 0.08], [0.13, 0.08], [0.13, -0.08]]
#robot_radius: 0.46
footprint_padding: 0.01
inflation_radius: 0.3
cost_scaling_factor: 10.0
lethal_cost_threshold: 100
observation_sources: base_scan
base_scan: {data_type: LaserScan, expected_update_rate: 0.4, sensor_frame: laser, topic: /scan,
observation_persistence: 0.0, marking: true, clearing: true } #, max_obstacle_height: 0.4, min_obstacle_height: 0.0}
When I echo on console /global_planner/costmap/costmap it looks mostly empty with some exceptions.
When I launch amcl, I can see on the map server console that it is sending a map; however when I launch the global planner I don't see that output on the console. This means the global_planner is not getting the costmap from the map_server?
I am not ...
Can you please add a screenshot of the global costmap in rviz? Also the indention of "plugins" in "global_costmap_params.yaml" is too far left. It should be under "global_costmap". Don't know if this is a copy & paste problem here or exist in your real files.
The indentation comes from the formatted text button. I just added the rviz images! Thank you for your feedback!
The first picture does show the map topic, but not the global costmap. Please add the launch file. In costmap_common_params.yaml observation_sources should be under "obstacles:" btw.
The /global_planner/costmap/costmap is publishing but for some reason is imcomplete. also on the dynamic reconfig, the static layer is missing in the global_planner, but is shows on the costmap_2d example. I tried using the same file used in the costmap_2d but still I get the same problem.