Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ The following settings and options are exposed to you. My default configuration

`scan_queue_size` - The number of scan messages to queue up before throwing away old ones. Should always be set to 1 in async mode

`use_map_saver` - Instantiate the map saver service and self-subscribe to the map topic

`map_file_name` - Name of the pose-graph file to load on startup if available

`map_start_pose` - Pose to start pose-graph mapping/localization in, if available
Expand Down
1 change: 1 addition & 0 deletions config/mapper_params_lifelong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ slam_toolbox:
map_frame: map
base_frame: base_footprint
scan_topic: /scan
use_map_saver: true
mode: mapping

# lifelong params
Expand Down
1 change: 1 addition & 0 deletions config/mapper_params_offline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ slam_toolbox:
map_frame: map
base_frame: base_footprint
scan_topic: /scan
use_map_saver: true
mode: mapping #localization
debug_logging: false
throttle_scans: 1
Expand Down
1 change: 1 addition & 0 deletions config/mapper_params_online_async.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ slam_toolbox:
map_frame: map
base_frame: base_footprint
scan_topic: /scan
use_map_saver: true
mode: mapping #localization

# if you'd like to immediately start continuing a map at a given pose
Expand Down
1 change: 1 addition & 0 deletions config/mapper_params_online_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ slam_toolbox:
map_frame: map
base_frame: base_footprint
scan_topic: /scan
use_map_saver: true
mode: mapping #localization

# if you'd like to immediately start continuing a map at a given pose
Expand Down
1 change: 1 addition & 0 deletions include/slam_toolbox/slam_toolbox_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class SlamToolbox : public rclcpp::Node

// Storage for ROS parameters
std::string odom_frame_, map_frame_, base_frame_, map_name_, scan_topic_;
bool use_map_saver_;
rclcpp::Duration transform_timeout_, minimum_time_interval_;
std_msgs::msg::Header scan_header;
int throttle_scans_, scan_queue_size_;
Expand Down
9 changes: 7 additions & 2 deletions src/slam_toolbox_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ void SlamToolbox::configure()
pose_helper_ = std::make_unique<pose_utils::GetPoseHelper>(
tf_.get(), base_frame_, odom_frame_);
scan_holder_ = std::make_unique<laser_utils::ScanHolder>(lasers_);
map_saver_ = std::make_unique<map_saver::MapSaver>(shared_from_this(),
map_name_);
if (use_map_saver_) {
map_saver_ = std::make_unique<map_saver::MapSaver>(shared_from_this(),
map_name_);
}
closure_assistant_ =
std::make_unique<loop_closure_assistant::LoopClosureAssistant>(
shared_from_this(), smapper_->getMapper(), scan_holder_.get(),
Expand Down Expand Up @@ -144,6 +146,9 @@ void SlamToolbox::setParams()
map_name_ = std::string("/map");
map_name_ = this->declare_parameter("map_name", map_name_);

use_map_saver_ = true;
use_map_saver_ = this->declare_parameter("use_map_saver", use_map_saver_);

scan_topic_ = std::string("/scan");
scan_topic_ = this->declare_parameter("scan_topic", scan_topic_);

Expand Down