I am trying to add obstacles in the way of my robot. Even if they are detected by the laser scan, it's not until the obstacle comes in the local costmap's frame that the obstacle is noticed and added to the global costmap.
Please note that, I tried following and understanding the tutorial and tried reading and understanding other similar questions on the forum... but I don't understand two things:
- Setting up the costmap in the launch file: what is happening here? Is it necessary?
- Loading the plugins in the yaml files... Why not just load them in the common yaml file since I am loading it under both namespaces (global and local) and what do they really mean?
I just stole these bits from ready made simulations and I cant seem to find anything that explains them properly, and I am pretty sure this is what is not allowing to add obstacles to my global costmap.
Here are my costmap param files:
costmap_common_params.yaml
:
obstacle_range: 2.0
raytrace_range: 3.0
publish_frequency: 1.0
footprint: [[0.57, 0.75],[0.57, -0.75],[-1.153, -0.75],[-1.153, 0.75]]
# robot_radius: 0.18
plugins:
- {name: obstacles_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflater_layer, type: "costmap_2d::InflationLayer"}
obstacles_layer:
observation_sources: scan scan2
scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true}
scan2: {sensor_frame: base_scan2, data_type: LaserScan, topic: scan2, marking: true, clearing: true}
inflater_layer:
inflation_radius: 1.0
global_costmap_params.yaml
:
global_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 10.0
publish_frequency: 10.0
static_map: true
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacles_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflater_layer, type: "costmap_2d::InflationLayer"}
local_costmap_params.yaml
:
local_costmap:
global_frame: odom
robot_base_frame: base_footprint
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 6.0
height: 6.0
resolution: 0.05
move_base.launch
<launch>
<master auto="start"/>
<!-- Run the map server -->
<node name="map_server" pkg="map_server" type="map_server" args="/home/jm/isaac/sdk/packages/eband_ros/maps/factory.yaml"/>
<!-- Setting up costmap -->
<node name="static_tf0" pkg="tf" type="static_transform_publisher" args="2 0 0 0 0 0 /map /base_footprint 100"/>
<!-- move_base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find isaac_navigation)/param/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find isaac_navigation)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find isaac_navigation)/param/local_costmap_params.yaml" command="load" />
<rosparam file="$(find isaac_navigation)/param/global_costmap_params.yaml" command="load" />
<rosparam file="$(find isaac_navigation)/param/base_local_planner_params.yaml" command="load" />
<param name="base_global_planner" type="string" value="navfn/NavfnROS" />
<param name="base_local_planner" value="eband_local_planner/EBandPlannerROS" />
</node>
</launch>
Originally posted by jmyazbeck on ROS Answers with karma: 22 on 2021-06-25
Post score: 0