diff --git a/cartographer_ros/cartographer_ros/map_builder_bridge.h b/cartographer_ros/cartographer_ros/map_builder_bridge.h index 308f546..cd14e2c 100644 --- a/cartographer_ros/cartographer_ros/map_builder_bridge.h +++ b/cartographer_ros/cartographer_ros/map_builder_bridge.h @@ -83,7 +83,7 @@ class MapBuilderBridge { const ::cartographer::transform::Rigid3d local_pose, ::cartographer::sensor::RangeData range_data_in_local, const std::unique_ptr) - EXCLUDES(mutex_); + EXCLUDES(mutex_); cartographer::common::Mutex mutex_; const NodeOptions node_options_; diff --git a/cartographer_ros/cartographer_ros/sensor_bridge.cc b/cartographer_ros/cartographer_ros/sensor_bridge.cc index 7f320d1..5d750a4 100644 --- a/cartographer_ros/cartographer_ros/sensor_bridge.cc +++ b/cartographer_ros/cartographer_ros/sensor_bridge.cc @@ -43,7 +43,7 @@ SensorBridge::SensorBridge( const int num_subdivisions_per_laser_scan, const std::string& tracking_frame, const double lookup_transform_timeout_sec, tf2_ros::Buffer* const tf_buffer, - carto::mapping::TrajectoryBuilder* const trajectory_builder) + carto::mapping::TrajectoryBuilderInterface* const trajectory_builder) : num_subdivisions_per_laser_scan_(num_subdivisions_per_laser_scan), tf_bridge_(tracking_frame, lookup_transform_timeout_sec, tf_buffer), trajectory_builder_(trajectory_builder) {} @@ -67,8 +67,9 @@ void SensorBridge::HandleOdometryMessage( std::unique_ptr<::cartographer::sensor::OdometryData> odometry_data = ToOdometryData(msg); if (odometry_data != nullptr) { - trajectory_builder_->AddOdometerData(sensor_id, odometry_data->time, - odometry_data->pose); + trajectory_builder_->AddSensorData( + sensor_id, cartographer::sensor::OdometryData{odometry_data->time, + odometry_data->pose}); } } @@ -106,9 +107,10 @@ void SensorBridge::HandleImuMessage(const std::string& sensor_id, const sensor_msgs::Imu::ConstPtr& msg) { std::unique_ptr<::cartographer::sensor::ImuData> imu_data = ToImuData(msg); if (imu_data != nullptr) { - trajectory_builder_->AddImuData(sensor_id, imu_data->time, - imu_data->linear_acceleration, - imu_data->angular_velocity); + trajectory_builder_->AddSensorData( + sensor_id, cartographer::sensor::ImuData{imu_data->time, + imu_data->linear_acceleration, + imu_data->angular_velocity}); } } @@ -169,10 +171,11 @@ void SensorBridge::HandleRangefinder( const auto sensor_to_tracking = tf_bridge_.LookupToTracking(time, CheckNoLeadingSlash(frame_id)); if (sensor_to_tracking != nullptr) { - trajectory_builder_->AddRangefinderData( - sensor_id, time, sensor_to_tracking->translation().cast(), - carto::sensor::TransformTimedPointCloud( - ranges, sensor_to_tracking->cast())); + trajectory_builder_->AddSensorData( + sensor_id, cartographer::sensor::TimedPointCloudData{ + time, sensor_to_tracking->translation().cast(), + carto::sensor::TransformTimedPointCloud( + ranges, sensor_to_tracking->cast())}); } } diff --git a/cartographer_ros/cartographer_ros/sensor_bridge.h b/cartographer_ros/cartographer_ros/sensor_bridge.h index a6a0519..86d46c3 100644 --- a/cartographer_ros/cartographer_ros/sensor_bridge.h +++ b/cartographer_ros/cartographer_ros/sensor_bridge.h @@ -19,7 +19,7 @@ #include -#include "cartographer/mapping/trajectory_builder.h" +#include "cartographer/mapping/trajectory_builder_interface.h" #include "cartographer/sensor/imu_data.h" #include "cartographer/sensor/odometry_data.h" #include "cartographer/transform/rigid_transform.h" @@ -42,7 +42,7 @@ class SensorBridge { explicit SensorBridge( int num_subdivisions_per_laser_scan, const std::string& tracking_frame, double lookup_transform_timeout_sec, tf2_ros::Buffer* tf_buffer, - ::cartographer::mapping::TrajectoryBuilder* trajectory_builder); + ::cartographer::mapping::TrajectoryBuilderInterface* trajectory_builder); SensorBridge(const SensorBridge&) = delete; SensorBridge& operator=(const SensorBridge&) = delete; @@ -77,7 +77,8 @@ class SensorBridge { const int num_subdivisions_per_laser_scan_; const TfBridge tf_bridge_; - ::cartographer::mapping::TrajectoryBuilder* const trajectory_builder_; + ::cartographer::mapping::TrajectoryBuilderInterface* const + trajectory_builder_; }; } // namespace cartographer_ros diff --git a/cartographer_ros/cartographer_ros/trajectory_options.cc b/cartographer_ros/cartographer_ros/trajectory_options.cc index e06463a..603c756 100644 --- a/cartographer_ros/cartographer_ros/trajectory_options.cc +++ b/cartographer_ros/cartographer_ros/trajectory_options.cc @@ -16,7 +16,7 @@ #include "cartographer_ros/trajectory_options.h" -#include "cartographer/mapping/trajectory_builder.h" +#include "cartographer/mapping/trajectory_builder_interface.h" #include "cartographer/transform/rigid_transform.h" #include "cartographer/transform/transform.h" #include "cartographer_ros/time_conversion.h"