diff --git a/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc b/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc index eb2d6db..961bdca 100644 --- a/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc +++ b/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc @@ -37,6 +37,7 @@ DEFINE_bool( DEFINE_string( save_map_filename, "", "If non-empty, serialize state and write it to disk before shutting down."); +DEFINE_string(map_filename, "", "If non-empty, filename of a map to load."); namespace cartographer_ros { namespace cartographer_grpc { @@ -55,6 +56,10 @@ void Run() { ::cartographer_grpc::mapping::MapBuilderStub>(FLAGS_server_address); Node node(node_options, std::move(map_builder), &tf_buffer); + if (!FLAGS_map_filename.empty()) { + node.LoadMap(FLAGS_map_filename); + } + if (FLAGS_start_trajectory_with_default_topics) { node.StartTrajectoryWithDefaultTopics(trajectory_options); } diff --git a/cartographer_ros/launch/grpc_demo_backpack_2d_localization.launch b/cartographer_ros/launch/grpc_demo_backpack_2d_localization.launch new file mode 100644 index 0000000..72be95a --- /dev/null +++ b/cartographer_ros/launch/grpc_demo_backpack_2d_localization.launch @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + +