20 #include "glog/logging.h" 27 constexpr
double kSensorDataRatesLoggingPeriodSeconds = 15.;
33 const std::unordered_set<string>& expected_sensor_ids,
34 std::unique_ptr<GlobalTrajectoryBuilderInterface>
35 wrapped_trajectory_builder)
36 : sensor_collator_(sensor_collator),
37 trajectory_id_(trajectory_id),
38 wrapped_trajectory_builder_(std::move(wrapped_trajectory_builder)),
39 last_logging_time_(std::chrono::steady_clock::now()) {
41 trajectory_id, expected_sensor_ids,
42 [
this](
const string& sensor_id, std::unique_ptr<sensor::Data> data) {
54 const int submap_index) {
64 const string& sensor_id, std::unique_ptr<sensor::Data> data) {
69 const string& sensor_id, std::unique_ptr<sensor::Data> data) {
74 std::piecewise_construct, std::forward_as_tuple(sensor_id),
75 std::forward_as_tuple(
79 it->second.Pulse(data->time);
84 LOG(INFO) << pair.first <<
" rate: " << pair.second.DebugString();
92 data->imu.linear_acceleration,
93 data->imu.angular_velocity);
98 data->time, data->rangefinder.origin, data->rangefinder.ranges);
103 data->odometer_pose);
SubmapData GetSubmapData(int submap_index) override
int num_submaps() override
std::unique_ptr< GlobalTrajectoryBuilderInterface > wrapped_trajectory_builder_
std::map< string, common::RateTimer<> > rate_timers_
sensor::Collator *const sensor_collator_
Duration FromSeconds(const double seconds)
CollatedTrajectoryBuilder(sensor::Collator *sensor_collator, int trajectory_id, const std::unordered_set< string > &expected_sensor_ids, std::unique_ptr< GlobalTrajectoryBuilderInterface > wrapped_trajectory_builder)
void AddTrajectory(int trajectory_id, const std::unordered_set< string > &expected_sensor_ids, Callback callback)
void AddSensorData(const string &sensor_id, std::unique_ptr< sensor::Data > data) override
const PoseEstimate & pose_estimate() const override
void AddSensorData(int trajectory_id, const string &sensor_id, std::unique_ptr< Data > data)
~CollatedTrajectoryBuilder() override
void HandleCollatedSensorData(const string &sensor_id, std::unique_ptr< sensor::Data > data)
std::chrono::steady_clock::time_point last_logging_time_