Follow the Absl update. (#955)

master
Alexander Belyaev 2018-07-28 19:47:10 +02:00 committed by GitHub
parent 15dece61af
commit 2910529446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 79 additions and 96 deletions

View File

@ -46,6 +46,7 @@ find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})
include(FindPkgConfig) include(FindPkgConfig)
find_package(Abseil REQUIRED)
find_package(LuaGoogle REQUIRED) find_package(LuaGoogle REQUIRED)
find_package(PCL REQUIRED COMPONENTS common) find_package(PCL REQUIRED COMPONENTS common)
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)

View File

@ -20,8 +20,8 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include "absl/memory/memory.h"
#include "cartographer/common/configuration_file_resolver.h" #include "cartographer/common/configuration_file_resolver.h"
#include "cartographer/common/make_unique.h"
#include "cartographer/common/math.h" #include "cartographer/common/math.h"
#include "cartographer/io/file_writer.h" #include "cartographer/io/file_writer.h"
#include "cartographer/io/points_processor.h" #include "cartographer/io/points_processor.h"
@ -61,8 +61,7 @@ CreatePipelineBuilder(
const std::string file_prefix) { const std::string file_prefix) {
const auto file_writer_factory = const auto file_writer_factory =
AssetsWriter::CreateFileWriterFactory(file_prefix); AssetsWriter::CreateFileWriterFactory(file_prefix);
auto builder = auto builder = absl::make_unique<carto::io::PointsProcessorPipelineBuilder>();
carto::common::make_unique<carto::io::PointsProcessorPipelineBuilder>();
carto::io::RegisterBuiltInPointsProcessors(trajectories, file_writer_factory, carto::io::RegisterBuiltInPointsProcessors(trajectories, file_writer_factory,
builder.get()); builder.get());
builder->Register(RosMapWritingPointsProcessor::kConfigurationFileActionName, builder->Register(RosMapWritingPointsProcessor::kConfigurationFileActionName,
@ -80,13 +79,13 @@ std::unique_ptr<carto::common::LuaParameterDictionary> LoadLuaDictionary(
const std::string& configuration_directory, const std::string& configuration_directory,
const std::string& configuration_basename) { const std::string& configuration_basename) {
auto file_resolver = auto file_resolver =
carto::common::make_unique<carto::common::ConfigurationFileResolver>( absl::make_unique<carto::common::ConfigurationFileResolver>(
std::vector<std::string>{configuration_directory}); std::vector<std::string>{configuration_directory});
const std::string code = const std::string code =
file_resolver->GetFileContentOrDie(configuration_basename); file_resolver->GetFileContentOrDie(configuration_basename);
auto lua_parameter_dictionary = auto lua_parameter_dictionary =
carto::common::make_unique<carto::common::LuaParameterDictionary>( absl::make_unique<carto::common::LuaParameterDictionary>(
code, std::move(file_resolver)); code, std::move(file_resolver));
return lua_parameter_dictionary; return lua_parameter_dictionary;
} }
@ -99,7 +98,7 @@ std::unique_ptr<carto::io::PointsBatch> HandleMessage(
transform_interpolation_buffer) { transform_interpolation_buffer) {
const carto::common::Time start_time = FromRos(message.header.stamp); const carto::common::Time start_time = FromRos(message.header.stamp);
auto points_batch = carto::common::make_unique<carto::io::PointsBatch>(); auto points_batch = absl::make_unique<carto::io::PointsBatch>();
points_batch->start_time = start_time; points_batch->start_time = start_time;
points_batch->frame_id = message.header.frame_id; points_batch->frame_id = message.header.frame_id;
@ -264,8 +263,7 @@ void AssetsWriter::Run(const std::string& configuration_directory,
::cartographer::io::FileWriterFactory AssetsWriter::CreateFileWriterFactory( ::cartographer::io::FileWriterFactory AssetsWriter::CreateFileWriterFactory(
const std::string& file_path) { const std::string& file_path) {
const auto file_writer_factory = [file_path](const std::string& filename) { const auto file_writer_factory = [file_path](const std::string& filename) {
return carto::common::make_unique<carto::io::StreamFileWriter>(file_path + return absl::make_unique<carto::io::StreamFileWriter>(file_path + filename);
filename);
}; };
return file_writer_factory; return file_writer_factory;
} }

View File

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "absl/memory/memory.h"
#include "cartographer/cloud/client/map_builder_stub.h" #include "cartographer/cloud/client/map_builder_stub.h"
#include "cartographer/common/make_unique.h"
#include "cartographer_ros/node.h" #include "cartographer_ros/node.h"
#include "cartographer_ros/node_options.h" #include "cartographer_ros/node_options.h"
#include "cartographer_ros/ros_log_sink.h" #include "cartographer_ros/ros_log_sink.h"
@ -59,8 +59,7 @@ void Run() {
std::tie(node_options, trajectory_options) = std::tie(node_options, trajectory_options) =
LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename); LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename);
auto map_builder = auto map_builder = absl::make_unique<::cartographer::cloud::MapBuilderStub>(
cartographer::common::make_unique<::cartographer::cloud::MapBuilderStub>(
FLAGS_server_address, FLAGS_client_id); FLAGS_server_address, FLAGS_client_id);
Node node(node_options, std::move(map_builder), &tf_buffer, Node node(node_options, std::move(map_builder), &tf_buffer,
FLAGS_collect_metrics); FLAGS_collect_metrics);

View File

@ -39,9 +39,8 @@ int main(int argc, char** argv) {
const cartographer_ros::MapBuilderFactory map_builder_factory = const cartographer_ros::MapBuilderFactory map_builder_factory =
[](const ::cartographer::mapping::proto::MapBuilderOptions&) { [](const ::cartographer::mapping::proto::MapBuilderOptions&) {
return ::cartographer::common::make_unique< return absl::make_unique< ::cartographer::cloud::MapBuilderStub>(
::cartographer::cloud::MapBuilderStub>(FLAGS_server_address, FLAGS_server_address, FLAGS_client_id);
FLAGS_client_id);
}; };
cartographer_ros::RunOfflineNode(map_builder_factory); cartographer_ros::RunOfflineNode(map_builder_factory);

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/map_builder_bridge.h" #include "cartographer_ros/map_builder_bridge.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer/io/color.h" #include "cartographer/io/color.h"
#include "cartographer/io/proto_stream.h" #include "cartographer/io/proto_stream.h"
#include "cartographer/mapping/pose_graph.h" #include "cartographer/mapping/pose_graph.h"
@ -135,8 +135,7 @@ int MapBuilderBridge::AddTrajectory(
// Make sure there is no trajectory with 'trajectory_id' yet. // Make sure there is no trajectory with 'trajectory_id' yet.
CHECK_EQ(sensor_bridges_.count(trajectory_id), 0); CHECK_EQ(sensor_bridges_.count(trajectory_id), 0);
sensor_bridges_[trajectory_id] = sensor_bridges_[trajectory_id] = absl::make_unique<SensorBridge>(
cartographer::common::make_unique<SensorBridge>(
trajectory_options.num_subdivisions_per_laser_scan, trajectory_options.num_subdivisions_per_laser_scan,
trajectory_options.tracking_frame, trajectory_options.tracking_frame,
node_options_.lookup_transform_timeout_sec, tf_buffer_, node_options_.lookup_transform_timeout_sec, tf_buffer_,

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/metrics/family_factory.h" #include "cartographer_ros/metrics/family_factory.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
namespace cartographer_ros { namespace cartographer_ros {
namespace metrics { namespace metrics {
@ -26,8 +26,7 @@ using BucketBoundaries = ::cartographer::metrics::Histogram::BucketBoundaries;
::cartographer::metrics::Family<::cartographer::metrics::Counter>* ::cartographer::metrics::Family<::cartographer::metrics::Counter>*
FamilyFactory::NewCounterFamily(const std::string& name, FamilyFactory::NewCounterFamily(const std::string& name,
const std::string& description) { const std::string& description) {
auto wrapper = auto wrapper = absl::make_unique<CounterFamily>(name, description);
::cartographer::common::make_unique<CounterFamily>(name, description);
auto* ptr = wrapper.get(); auto* ptr = wrapper.get();
counter_families_.emplace_back(std::move(wrapper)); counter_families_.emplace_back(std::move(wrapper));
return ptr; return ptr;
@ -36,8 +35,7 @@ FamilyFactory::NewCounterFamily(const std::string& name,
::cartographer::metrics::Family<::cartographer::metrics::Gauge>* ::cartographer::metrics::Family<::cartographer::metrics::Gauge>*
FamilyFactory::NewGaugeFamily(const std::string& name, FamilyFactory::NewGaugeFamily(const std::string& name,
const std::string& description) { const std::string& description) {
auto wrapper = auto wrapper = absl::make_unique<GaugeFamily>(name, description);
::cartographer::common::make_unique<GaugeFamily>(name, description);
auto* ptr = wrapper.get(); auto* ptr = wrapper.get();
gauge_families_.emplace_back(std::move(wrapper)); gauge_families_.emplace_back(std::move(wrapper));
return ptr; return ptr;
@ -47,8 +45,8 @@ FamilyFactory::NewGaugeFamily(const std::string& name,
FamilyFactory::NewHistogramFamily(const std::string& name, FamilyFactory::NewHistogramFamily(const std::string& name,
const std::string& description, const std::string& description,
const BucketBoundaries& boundaries) { const BucketBoundaries& boundaries) {
auto wrapper = ::cartographer::common::make_unique<HistogramFamily>( auto wrapper =
name, description, boundaries); absl::make_unique<HistogramFamily>(name, description, boundaries);
auto* ptr = wrapper.get(); auto* ptr = wrapper.get();
histogram_families_.emplace_back(std::move(wrapper)); histogram_families_.emplace_back(std::move(wrapper));
return ptr; return ptr;

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/metrics/internal/family.h" #include "cartographer_ros/metrics/internal/family.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer_ros/metrics/internal/counter.h" #include "cartographer_ros/metrics/internal/counter.h"
#include "cartographer_ros/metrics/internal/gauge.h" #include "cartographer_ros/metrics/internal/gauge.h"
#include "cartographer_ros/metrics/internal/histogram.h" #include "cartographer_ros/metrics/internal/histogram.h"
@ -27,7 +27,7 @@ namespace metrics {
using BucketBoundaries = ::cartographer::metrics::Histogram::BucketBoundaries; using BucketBoundaries = ::cartographer::metrics::Histogram::BucketBoundaries;
Counter* CounterFamily::Add(const std::map<std::string, std::string>& labels) { Counter* CounterFamily::Add(const std::map<std::string, std::string>& labels) {
auto wrapper = ::cartographer::common::make_unique<Counter>(labels); auto wrapper = absl::make_unique<Counter>(labels);
auto* ptr = wrapper.get(); auto* ptr = wrapper.get();
wrappers_.emplace_back(std::move(wrapper)); wrappers_.emplace_back(std::move(wrapper));
return ptr; return ptr;
@ -44,7 +44,7 @@ cartographer_ros_msgs::MetricFamily CounterFamily::ToRosMessage() {
} }
Gauge* GaugeFamily::Add(const std::map<std::string, std::string>& labels) { Gauge* GaugeFamily::Add(const std::map<std::string, std::string>& labels) {
auto wrapper = ::cartographer::common::make_unique<Gauge>(labels); auto wrapper = absl::make_unique<Gauge>(labels);
auto* ptr = wrapper.get(); auto* ptr = wrapper.get();
wrappers_.emplace_back(std::move(wrapper)); wrappers_.emplace_back(std::move(wrapper));
return ptr; return ptr;
@ -62,8 +62,7 @@ cartographer_ros_msgs::MetricFamily GaugeFamily::ToRosMessage() {
Histogram* HistogramFamily::Add( Histogram* HistogramFamily::Add(
const std::map<std::string, std::string>& labels) { const std::map<std::string, std::string>& labels) {
auto wrapper = auto wrapper = absl::make_unique<Histogram>(labels, boundaries_);
::cartographer::common::make_unique<Histogram>(labels, boundaries_);
auto* ptr = wrapper.get(); auto* ptr = wrapper.get();
wrappers_.emplace_back(std::move(wrapper)); wrappers_.emplace_back(std::move(wrapper));
return ptr; return ptr;

View File

@ -369,8 +369,7 @@ std::unique_ptr<nav_msgs::OccupancyGrid> CreateOccupancyGridMsg(
const cartographer::io::PaintSubmapSlicesResult& painted_slices, const cartographer::io::PaintSubmapSlicesResult& painted_slices,
const double resolution, const std::string& frame_id, const double resolution, const std::string& frame_id,
const ros::Time& time) { const ros::Time& time) {
auto occupancy_grid = auto occupancy_grid = absl::make_unique<nav_msgs::OccupancyGrid>();
::cartographer::common::make_unique<nav_msgs::OccupancyGrid>();
const int width = cairo_image_surface_get_width(painted_slices.surface.get()); const int width = cairo_image_surface_get_width(painted_slices.surface.get());
const int height = const int height =

View File

@ -21,9 +21,9 @@
#include <vector> #include <vector>
#include "Eigen/Core" #include "Eigen/Core"
#include "absl/memory/memory.h"
#include "cartographer/common/configuration_file_resolver.h" #include "cartographer/common/configuration_file_resolver.h"
#include "cartographer/common/lua_parameter_dictionary.h" #include "cartographer/common/lua_parameter_dictionary.h"
#include "cartographer/common/make_unique.h"
#include "cartographer/common/port.h" #include "cartographer/common/port.h"
#include "cartographer/common/time.h" #include "cartographer/common/time.h"
#include "cartographer/mapping/pose_graph_interface.h" #include "cartographer/mapping/pose_graph_interface.h"
@ -95,7 +95,7 @@ Node::Node(
map_builder_bridge_(node_options_, std::move(map_builder), tf_buffer) { map_builder_bridge_(node_options_, std::move(map_builder), tf_buffer) {
carto::common::MutexLocker lock(&mutex_); carto::common::MutexLocker lock(&mutex_);
if (collect_metrics) { if (collect_metrics) {
metrics_registry_ = carto::common::make_unique<metrics::FamilyFactory>(); metrics_registry_ = absl::make_unique<metrics::FamilyFactory>();
carto::metrics::RegisterAllMetrics(metrics_registry_.get()); carto::metrics::RegisterAllMetrics(metrics_registry_.get());
} }

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer/mapping/map_builder.h" #include "cartographer/mapping/map_builder.h"
#include "cartographer_ros/node.h" #include "cartographer_ros/node.h"
#include "cartographer_ros/node_options.h" #include "cartographer_ros/node_options.h"
@ -56,8 +56,7 @@ void Run() {
std::tie(node_options, trajectory_options) = std::tie(node_options, trajectory_options) =
LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename); LoadOptions(FLAGS_configuration_directory, FLAGS_configuration_basename);
auto map_builder = auto map_builder = absl::make_unique<cartographer::mapping::MapBuilder>(
::cartographer::common::make_unique<cartographer::mapping::MapBuilder>(
node_options.map_builder_options); node_options.map_builder_options);
Node node(node_options, std::move(map_builder), &tf_buffer, Node node(node_options, std::move(map_builder), &tf_buffer,
FLAGS_collect_metrics); FLAGS_collect_metrics);

View File

@ -50,8 +50,8 @@ NodeOptions CreateNodeOptions(
std::tuple<NodeOptions, TrajectoryOptions> LoadOptions( std::tuple<NodeOptions, TrajectoryOptions> LoadOptions(
const std::string& configuration_directory, const std::string& configuration_directory,
const std::string& configuration_basename) { const std::string& configuration_basename) {
auto file_resolver = cartographer::common::make_unique< auto file_resolver =
cartographer::common::ConfigurationFileResolver>( absl::make_unique<cartographer::common::ConfigurationFileResolver>(
std::vector<std::string>{configuration_directory}); std::vector<std::string>{configuration_directory});
const std::string code = const std::string code =
file_resolver->GetFileContentOrDie(configuration_basename); file_resolver->GetFileContentOrDie(configuration_basename);

View File

@ -32,8 +32,8 @@ int main(int argc, char** argv) {
const cartographer_ros::MapBuilderFactory map_builder_factory = const cartographer_ros::MapBuilderFactory map_builder_factory =
[](const ::cartographer::mapping::proto::MapBuilderOptions& [](const ::cartographer::mapping::proto::MapBuilderOptions&
map_builder_options) { map_builder_options) {
return ::cartographer::common::make_unique< return absl::make_unique< ::cartographer::mapping::MapBuilder>(
::cartographer::mapping::MapBuilder>(map_builder_options); map_builder_options);
}; };
cartographer_ros::RunOfflineNode(map_builder_factory); cartographer_ros::RunOfflineNode(map_builder_factory);

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/playable_bag.h" #include "cartographer_ros/playable_bag.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer_ros/node_constants.h" #include "cartographer_ros/node_constants.h"
#include "glog/logging.h" #include "glog/logging.h"
#include "tf2_msgs/TFMessage.h" #include "tf2_msgs/TFMessage.h"
@ -28,10 +28,8 @@ PlayableBag::PlayableBag(
const ros::Time start_time, const ros::Time end_time, const ros::Time start_time, const ros::Time end_time,
const ros::Duration buffer_delay, const ros::Duration buffer_delay,
FilteringEarlyMessageHandler filtering_early_message_handler) FilteringEarlyMessageHandler filtering_early_message_handler)
: bag_(cartographer::common::make_unique<rosbag::Bag>( : bag_(absl::make_unique<rosbag::Bag>(bag_filename, rosbag::bagmode::Read)),
bag_filename, rosbag::bagmode::Read)), view_(absl::make_unique<rosbag::View>(*bag_, start_time, end_time)),
view_(cartographer::common::make_unique<rosbag::View>(*bag_, start_time,
end_time)),
view_iterator_(view_->begin()), view_iterator_(view_->begin()),
finished_(false), finished_(false),
bag_id_(bag_id), bag_id_(bag_id),

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/ros_map_writing_points_processor.h" #include "cartographer_ros/ros_map_writing_points_processor.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer/io/image.h" #include "cartographer/io/image.h"
#include "cartographer/io/probability_grid_points_processor.h" #include "cartographer/io/probability_grid_points_processor.h"
#include "cartographer_ros/ros_map.h" #include "cartographer_ros/ros_map.h"
@ -42,7 +42,7 @@ RosMapWritingPointsProcessor::FromDictionary(
::cartographer::io::FileWriterFactory file_writer_factory, ::cartographer::io::FileWriterFactory file_writer_factory,
::cartographer::common::LuaParameterDictionary* const dictionary, ::cartographer::common::LuaParameterDictionary* const dictionary,
::cartographer::io::PointsProcessor* const next) { ::cartographer::io::PointsProcessor* const next) {
return ::cartographer::common::make_unique<RosMapWritingPointsProcessor>( return absl::make_unique<RosMapWritingPointsProcessor>(
dictionary->GetDouble("resolution"), dictionary->GetDouble("resolution"),
::cartographer::mapping::CreateProbabilityGridRangeDataInserterOptions2D( ::cartographer::mapping::CreateProbabilityGridRangeDataInserterOptions2D(
dictionary->GetDictionary("range_data_inserter").get()), dictionary->GetDictionary("range_data_inserter").get()),

View File

@ -20,8 +20,8 @@
#include <set> #include <set>
#include <string> #include <string>
#include "absl/memory/memory.h"
#include "cartographer/common/histogram.h" #include "cartographer/common/histogram.h"
#include "cartographer/common/make_unique.h"
#include "cartographer_ros/msg_conversion.h" #include "cartographer_ros/msg_conversion.h"
#include "gflags/gflags.h" #include "gflags/gflags.h"
#include "glog/logging.h" #include "glog/logging.h"
@ -72,7 +72,7 @@ const std::set<std::string> kPointDataTypes = {
ros::message_traits::DataType<sensor_msgs::LaserScan>::value())}; ros::message_traits::DataType<sensor_msgs::LaserScan>::value())};
std::unique_ptr<std::ofstream> CreateTimingFile(const std::string& frame_id) { std::unique_ptr<std::ofstream> CreateTimingFile(const std::string& frame_id) {
auto timing_file = ::cartographer::common::make_unique<std::ofstream>( auto timing_file = absl::make_unique<std::ofstream>(
std::string("timing_") + frame_id + ".csv", std::ios_base::out); std::string("timing_") + frame_id + ".csv", std::ios_base::out);
(*timing_file) (*timing_file)

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/sensor_bridge.h" #include "cartographer_ros/sensor_bridge.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer_ros/msg_conversion.h" #include "cartographer_ros/msg_conversion.h"
#include "cartographer_ros/time_conversion.h" #include "cartographer_ros/time_conversion.h"
@ -56,7 +56,7 @@ std::unique_ptr<carto::sensor::OdometryData> SensorBridge::ToOdometryData(
if (sensor_to_tracking == nullptr) { if (sensor_to_tracking == nullptr) {
return nullptr; return nullptr;
} }
return carto::common::make_unique<carto::sensor::OdometryData>( return absl::make_unique<carto::sensor::OdometryData>(
carto::sensor::OdometryData{ carto::sensor::OdometryData{
time, ToRigid3d(msg->pose.pose) * sensor_to_tracking->inverse()}); time, ToRigid3d(msg->pose.pose) * sensor_to_tracking->inverse()});
} }
@ -77,8 +77,8 @@ void SensorBridge::HandleNavSatFixMessage(
const carto::common::Time time = FromRos(msg->header.stamp); const carto::common::Time time = FromRos(msg->header.stamp);
if (msg->status.status == sensor_msgs::NavSatStatus::STATUS_NO_FIX) { if (msg->status.status == sensor_msgs::NavSatStatus::STATUS_NO_FIX) {
trajectory_builder_->AddSensorData( trajectory_builder_->AddSensorData(
sensor_id, carto::sensor::FixedFramePoseData{ sensor_id,
time, carto::common::optional<Rigid3d>()}); carto::sensor::FixedFramePoseData{time, absl::optional<Rigid3d>()});
return; return;
} }
@ -90,9 +90,8 @@ void SensorBridge::HandleNavSatFixMessage(
} }
trajectory_builder_->AddSensorData( trajectory_builder_->AddSensorData(
sensor_id, sensor_id, carto::sensor::FixedFramePoseData{
carto::sensor::FixedFramePoseData{ time, absl::optional<Rigid3d>(Rigid3d::Translation(
time, carto::common::optional<Rigid3d>(Rigid3d::Translation(
ecef_to_local_frame_.value() * ecef_to_local_frame_.value() *
LatLongAltToEcef(msg->latitude, msg->longitude, LatLongAltToEcef(msg->latitude, msg->longitude,
msg->altitude)))}); msg->altitude)))});
@ -127,10 +126,8 @@ std::unique_ptr<carto::sensor::ImuData> SensorBridge::ToImuData(
<< "The IMU frame must be colocated with the tracking frame. " << "The IMU frame must be colocated with the tracking frame. "
"Transforming linear acceleration into the tracking frame will " "Transforming linear acceleration into the tracking frame will "
"otherwise be imprecise."; "otherwise be imprecise.";
return carto::common::make_unique<carto::sensor::ImuData>( return absl::make_unique<carto::sensor::ImuData>(carto::sensor::ImuData{
carto::sensor::ImuData{ time, sensor_to_tracking->rotation() * ToEigen(msg->linear_acceleration),
time,
sensor_to_tracking->rotation() * ToEigen(msg->linear_acceleration),
sensor_to_tracking->rotation() * ToEigen(msg->angular_velocity)}); sensor_to_tracking->rotation() * ToEigen(msg->angular_velocity)});
} }

View File

@ -19,7 +19,7 @@
#include <memory> #include <memory>
#include "cartographer/common/optional.h" #include "absl/types/optional.h"
#include "cartographer/mapping/trajectory_builder_interface.h" #include "cartographer/mapping/trajectory_builder_interface.h"
#include "cartographer/sensor/imu_data.h" #include "cartographer/sensor/imu_data.h"
#include "cartographer/sensor/odometry_data.h" #include "cartographer/sensor/odometry_data.h"
@ -91,8 +91,7 @@ class SensorBridge {
::cartographer::mapping::TrajectoryBuilderInterface* const ::cartographer::mapping::TrajectoryBuilderInterface* const
trajectory_builder_; trajectory_builder_;
::cartographer::common::optional<::cartographer::transform::Rigid3d> absl::optional<::cartographer::transform::Rigid3d> ecef_to_local_frame_;
ecef_to_local_frame_;
}; };
} // namespace cartographer_ros } // namespace cartographer_ros

View File

@ -17,9 +17,9 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "absl/memory/memory.h"
#include "cartographer/common/configuration_file_resolver.h" #include "cartographer/common/configuration_file_resolver.h"
#include "cartographer/common/lua_parameter_dictionary.h" #include "cartographer/common/lua_parameter_dictionary.h"
#include "cartographer/common/make_unique.h"
#include "cartographer/common/port.h" #include "cartographer/common/port.h"
#include "cartographer_ros/node_constants.h" #include "cartographer_ros/node_constants.h"
#include "cartographer_ros/ros_log_sink.h" #include "cartographer_ros/ros_log_sink.h"
@ -44,8 +44,8 @@ namespace cartographer_ros {
namespace { namespace {
TrajectoryOptions LoadOptions() { TrajectoryOptions LoadOptions() {
auto file_resolver = cartographer::common::make_unique< auto file_resolver =
cartographer::common::ConfigurationFileResolver>( absl::make_unique<cartographer::common::ConfigurationFileResolver>(
std::vector<std::string>{FLAGS_configuration_directory}); std::vector<std::string>{FLAGS_configuration_directory});
const std::string code = const std::string code =
file_resolver->GetFileContentOrDie(FLAGS_configuration_basename); file_resolver->GetFileContentOrDie(FLAGS_configuration_basename);
@ -54,8 +54,7 @@ TrajectoryOptions LoadOptions() {
code, std::move(file_resolver)); code, std::move(file_resolver));
if (!FLAGS_initial_pose.empty()) { if (!FLAGS_initial_pose.empty()) {
auto initial_trajectory_pose_file_resolver = auto initial_trajectory_pose_file_resolver =
cartographer::common::make_unique< absl::make_unique<cartographer::common::ConfigurationFileResolver>(
cartographer::common::ConfigurationFileResolver>(
std::vector<std::string>{FLAGS_configuration_directory}); std::vector<std::string>{FLAGS_configuration_directory});
auto initial_trajectory_pose = auto initial_trajectory_pose =
cartographer::common::LuaParameterDictionary::NonReferenceCounted( cartographer::common::LuaParameterDictionary::NonReferenceCounted(

View File

@ -16,7 +16,7 @@
#include "cartographer_ros/submap.h" #include "cartographer_ros/submap.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer/common/port.h" #include "cartographer/common/port.h"
#include "cartographer/transform/transform.h" #include "cartographer/transform/transform.h"
#include "cartographer_ros/msg_conversion.h" #include "cartographer_ros/msg_conversion.h"
@ -38,8 +38,7 @@ std::unique_ptr<::cartographer::io::SubmapTextures> FetchSubmapTextures(
if (srv.response.textures.empty()) { if (srv.response.textures.empty()) {
return nullptr; return nullptr;
} }
auto response = auto response = absl::make_unique<::cartographer::io::SubmapTextures>();
::cartographer::common::make_unique<::cartographer::io::SubmapTextures>();
response->version = srv.response.submap_version; response->version = srv.response.submap_version;
for (const auto& texture : srv.response.textures) { for (const auto& texture : srv.response.textures) {
const std::string compressed_cells(texture.cells.begin(), const std::string compressed_cells(texture.cells.begin(),

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer_ros/msg_conversion.h" #include "cartographer_ros/msg_conversion.h"
#include "cartographer_ros/tf_bridge.h" #include "cartographer_ros/tf_bridge.h"
@ -45,9 +45,9 @@ std::unique_ptr<::cartographer::transform::Rigid3d> TfBridge::LookupToTracking(
// for the full 'timeout' even if we ask for data that is too old. // for the full 'timeout' even if we ask for data that is too old.
timeout = ::ros::Duration(0.); timeout = ::ros::Duration(0.);
} }
return ::cartographer::common::make_unique< return absl::make_unique<::cartographer::transform::Rigid3d>(
::cartographer::transform::Rigid3d>(ToRigid3d(buffer_->lookupTransform( ToRigid3d(buffer_->lookupTransform(tracking_frame_, frame_id,
tracking_frame_, frame_id, requested_time, timeout))); requested_time, timeout)));
} catch (const tf2::TransformException& ex) { } catch (const tf2::TransformException& ex) {
LOG(WARNING) << ex.what(); LOG(WARNING) << ex.what();
} }

View File

@ -30,6 +30,7 @@ find_package(cartographer REQUIRED)
include("${CARTOGRAPHER_CMAKE_DIR}/functions.cmake") include("${CARTOGRAPHER_CMAKE_DIR}/functions.cmake")
google_initialize_cartographer_project() google_initialize_cartographer_project()
find_package(Abseil REQUIRED)
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system iostreams) find_package(Boost REQUIRED COMPONENTS system iostreams)
find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES}) find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})

View File

@ -23,7 +23,7 @@
#include "Eigen/Core" #include "Eigen/Core"
#include "Eigen/Geometry" #include "Eigen/Geometry"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer/common/port.h" #include "cartographer/common/port.h"
#include "cartographer_ros/msg_conversion.h" #include "cartographer_ros/msg_conversion.h"
#include "cartographer_ros_msgs/SubmapQuery.h" #include "cartographer_ros_msgs/SubmapQuery.h"
@ -63,14 +63,14 @@ DrawableSubmap::DrawableSubmap(const ::cartographer::mapping::SubmapId& id,
last_query_timestamp_(0) { last_query_timestamp_(0) {
for (int slice_index = 0; slice_index < kNumberOfSlicesPerSubmap; for (int slice_index = 0; slice_index < kNumberOfSlicesPerSubmap;
++slice_index) { ++slice_index) {
ogre_slices_.emplace_back(::cartographer::common::make_unique<OgreSlice>( ogre_slices_.emplace_back(absl::make_unique<OgreSlice>(
id, slice_index, display_context->getSceneManager(), submap_node_)); id, slice_index, display_context->getSceneManager(), submap_node_));
} }
// DrawableSubmap creates and manages its visibility property object // DrawableSubmap creates and manages its visibility property object
// (a unique_ptr is needed because the Qt parent of the visibility // (a unique_ptr is needed because the Qt parent of the visibility
// property is the submap_category object - the BoolProperty needs // property is the submap_category object - the BoolProperty needs
// to be destroyed along with the DrawableSubmap) // to be destroyed along with the DrawableSubmap)
visibility_ = ::cartographer::common::make_unique<::rviz::BoolProperty>( visibility_ = absl::make_unique<::rviz::BoolProperty>(
"" /* title */, visible, "" /* description */, submap_category, "" /* title */, visible, "" /* description */, submap_category,
SLOT(ToggleVisibility()), this); SLOT(ToggleVisibility()), this);
submap_id_text_.setCharacterHeight(kSubmapIdCharHeight); submap_id_text_.setCharacterHeight(kSubmapIdCharHeight);

View File

@ -17,7 +17,7 @@
#include "cartographer_rviz/submaps_display.h" #include "cartographer_rviz/submaps_display.h"
#include "OgreResourceGroupManager.h" #include "OgreResourceGroupManager.h"
#include "cartographer/common/make_unique.h" #include "absl/memory/memory.h"
#include "cartographer/common/mutex.h" #include "cartographer/common/mutex.h"
#include "cartographer/mapping/id.h" #include "cartographer/mapping/id.h"
#include "cartographer_ros_msgs/SubmapList.h" #include "cartographer_ros_msgs/SubmapList.h"
@ -112,8 +112,7 @@ void SubmapsDisplay::reset() {
void SubmapsDisplay::processMessage( void SubmapsDisplay::processMessage(
const ::cartographer_ros_msgs::SubmapList::ConstPtr& msg) { const ::cartographer_ros_msgs::SubmapList::ConstPtr& msg) {
::cartographer::common::MutexLocker locker(&mutex_); ::cartographer::common::MutexLocker locker(&mutex_);
map_frame_ = map_frame_ = absl::make_unique<std::string>(msg->header.frame_id);
::cartographer::common::make_unique<std::string>(msg->header.frame_id);
// In case Cartographer node is relaunched, destroy trajectories from the // In case Cartographer node is relaunched, destroy trajectories from the
// previous instance. // previous instance.
for (const ::cartographer_ros_msgs::SubmapEntry& submap_entry : msg->submap) { for (const ::cartographer_ros_msgs::SubmapEntry& submap_entry : msg->submap) {
@ -136,8 +135,8 @@ void SubmapsDisplay::processMessage(
const SubmapId id{submap_entry.trajectory_id, submap_entry.submap_index}; const SubmapId id{submap_entry.trajectory_id, submap_entry.submap_index};
listed_submaps.insert(id); listed_submaps.insert(id);
while (id.trajectory_id >= static_cast<int>(trajectories_.size())) { while (id.trajectory_id >= static_cast<int>(trajectories_.size())) {
trajectories_.push_back(::cartographer::common::make_unique<Trajectory>( trajectories_.push_back(
::cartographer::common::make_unique<::rviz::BoolProperty>( absl::make_unique<Trajectory>(absl::make_unique<::rviz::BoolProperty>(
QString("Trajectory %1").arg(id.trajectory_id), QString("Trajectory %1").arg(id.trajectory_id),
visibility_all_enabled_->getBool(), visibility_all_enabled_->getBool(),
QString("List of all submaps in Trajectory %1. The checkbox " QString("List of all submaps in Trajectory %1. The checkbox "
@ -154,7 +153,7 @@ void SubmapsDisplay::processMessage(
constexpr float kSubmapPoseAxesRadius = 0.06f; constexpr float kSubmapPoseAxesRadius = 0.06f;
trajectory_submaps.emplace( trajectory_submaps.emplace(
id.submap_index, id.submap_index,
::cartographer::common::make_unique<DrawableSubmap>( absl::make_unique<DrawableSubmap>(
id, context_, map_node_, trajectory_visibility.get(), id, context_, map_node_, trajectory_visibility.get(),
trajectory_visibility->getBool(), kSubmapPoseAxesLength, trajectory_visibility->getBool(), kSubmapPoseAxesLength,
kSubmapPoseAxesRadius)); kSubmapPoseAxesRadius));