parent
dd4d2af58b
commit
829e2dc43f
|
@ -35,7 +35,6 @@
|
|||
#include "cartographer/transform/transform_interpolation_buffer.h"
|
||||
#include "cartographer_ros/msg_conversion.h"
|
||||
#include "cartographer_ros/ros_map_writing_points_processor.h"
|
||||
#include "cartographer_ros/split_string.h"
|
||||
#include "cartographer_ros/time_conversion.h"
|
||||
#include "cartographer_ros/urdf_reader.h"
|
||||
#include "gflags/gflags.h"
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "absl/strings/str_split.h"
|
||||
#include "cartographer_ros/assets_writer.h"
|
||||
#include "cartographer_ros/split_string.h"
|
||||
#include "gflags/gflags.h"
|
||||
#include "glog/logging.h"
|
||||
|
||||
|
@ -55,8 +55,7 @@ int main(int argc, char** argv) {
|
|||
<< "-pose_graph_filename is missing.";
|
||||
|
||||
::cartographer_ros::AssetsWriter asset_writer(
|
||||
FLAGS_pose_graph_filename,
|
||||
cartographer_ros::SplitString(FLAGS_bag_filenames, ','),
|
||||
FLAGS_pose_graph_filename, absl::StrSplit(FLAGS_bag_filenames, ','),
|
||||
FLAGS_output_file_prefix);
|
||||
|
||||
asset_writer.Run(FLAGS_configuration_directory, FLAGS_configuration_basename,
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#include <time.h>
|
||||
#include <chrono>
|
||||
|
||||
#include "absl/strings/str_split.h"
|
||||
#include "cartographer_ros/node.h"
|
||||
#include "cartographer_ros/playable_bag.h"
|
||||
#include "cartographer_ros/split_string.h"
|
||||
#include "cartographer_ros/urdf_reader.h"
|
||||
#include "gflags/gflags.h"
|
||||
#include "ros/callback_queue.h"
|
||||
|
@ -86,11 +86,11 @@ void RunOfflineNode(const MapBuilderFactory& map_builder_factory) {
|
|||
<< "-configuration_basenames is missing.";
|
||||
CHECK(!(FLAGS_bag_filenames.empty() && FLAGS_load_state_filename.empty()))
|
||||
<< "-bag_filenames and -load_state_filename cannot both be unspecified.";
|
||||
const auto bag_filenames =
|
||||
cartographer_ros::SplitString(FLAGS_bag_filenames, ',');
|
||||
const std::vector<std::string> bag_filenames =
|
||||
absl::StrSplit(FLAGS_bag_filenames, ',');
|
||||
cartographer_ros::NodeOptions node_options;
|
||||
const auto configuration_basenames =
|
||||
cartographer_ros::SplitString(FLAGS_configuration_basenames, ',');
|
||||
const std::vector<std::string> configuration_basenames =
|
||||
absl::StrSplit(FLAGS_configuration_basenames, ',');
|
||||
std::vector<TrajectoryOptions> bag_trajectory_options(1);
|
||||
std::tie(node_options, bag_trajectory_options.at(0)) =
|
||||
LoadOptions(FLAGS_configuration_directory, configuration_basenames.at(0));
|
||||
|
@ -122,8 +122,9 @@ void RunOfflineNode(const MapBuilderFactory& map_builder_factory) {
|
|||
tf2_ros::Buffer tf_buffer;
|
||||
|
||||
std::vector<geometry_msgs::TransformStamped> urdf_transforms;
|
||||
for (const std::string& urdf_filename :
|
||||
cartographer_ros::SplitString(FLAGS_urdf_filenames, ',')) {
|
||||
const std::vector<std::string> urdf_filenames =
|
||||
absl::StrSplit(FLAGS_urdf_filenames, ',');
|
||||
for (const auto& urdf_filename : urdf_filenames) {
|
||||
const auto current_urdf_transforms =
|
||||
ReadStaticTransformsFromUrdf(urdf_filename, &tf_buffer);
|
||||
urdf_transforms.insert(urdf_transforms.end(),
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 The Cartographer Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "cartographer_ros/split_string.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace cartographer_ros {
|
||||
|
||||
std::vector<std::string> SplitString(const std::string& input,
|
||||
const char delimiter) {
|
||||
std::istringstream stream(input);
|
||||
std::string token;
|
||||
std::vector<std::string> tokens;
|
||||
while (std::getline(stream, token, delimiter)) {
|
||||
tokens.push_back(token);
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
} // namespace cartographer_ros
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 The Cartographer Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_SPLIT_STRING_H
|
||||
#define CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_SPLIT_STRING_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace cartographer_ros {
|
||||
|
||||
// Split 'input' at 'delimiter'.
|
||||
std::vector<std::string> SplitString(const std::string& input, char delimiter);
|
||||
|
||||
} // namespace cartographer_ros
|
||||
|
||||
#endif // CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_SPLIT_STRING_H
|
Loading…
Reference in New Issue