Skip to content
Snippets Groups Projects
Commit 445fe6f4 authored by Matthew Hansen's avatar Matthew Hansen Committed by Matt Hansen
Browse files

Add support for running nav2 with cartographer

parent ec34755f
No related branches found
No related tags found
No related merge requests found
......@@ -31,12 +31,12 @@ def generate_launch_description():
params_file = launch.substitutions.LaunchConfiguration('params')
bt_xml_file = launch.substitutions.LaunchConfiguration('bt_xml_file')
# Create our own temporary YAML files that include substitutions
param_substitutions = {
'use_sim_time': use_sim_time,
'bt_xml_filename': bt_xml_file,
'autostart': autostart
'autostart': autostart,
'map_subscribe_transient_local': 'False'
}
configured_params = RewrittenYaml(
......
......@@ -104,6 +104,8 @@ local_costmap:
inflation_layer.cost_scaling_factor: 3.0
obstacle_layer:
enabled: True
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True
observation_sources: scan
scan:
......@@ -125,6 +127,8 @@ global_costmap:
robot_radius: 0.22
obstacle_layer:
enabled: True
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True
observation_sources: scan
scan:
......
......@@ -72,12 +72,14 @@ StaticLayer::onInitialize()
getParameters();
rclcpp::QoS map_qos(1);
rclcpp::QoS map_qos(10); // initialize to default
if (map_subscribe_transient_local_) {
map_qos.transient_local();
map_qos.reliable();
map_qos.keep_last(1);
}
RCLCPP_DEBUG(node_->get_logger(),
RCLCPP_INFO(node_->get_logger(),
"Subscribing to the map topic (%s) with %s durability",
map_topic_.c_str(),
map_subscribe_transient_local_ ? "transient local" : "volatile");
......
......@@ -83,7 +83,7 @@ void CostmapLayer::updateWithTrueOverwrite(
int max_i,
int max_j)
{
if (!enabled_) {
if (!enabled_ || costmap_ == nullptr) {
return;
}
unsigned char * master = master_grid.getCharMap();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment