Renames Odometry to Odometer. (#135)
parent
7dc3ab1e9e
commit
c386bf050d
|
@ -92,9 +92,9 @@ void CollatedTrajectoryBuilder::HandleCollatedSensorData(
|
||||||
wrapped_trajectory_builder_->AddLaserFan(data->time, data->laser_fan);
|
wrapped_trajectory_builder_->AddLaserFan(data->time, data->laser_fan);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case sensor::Data::Type::kOdometry:
|
case sensor::Data::Type::kOdometer:
|
||||||
wrapped_trajectory_builder_->AddOdometerPose(
|
wrapped_trajectory_builder_->AddOdometerData(
|
||||||
data->time, data->odometry.pose, data->odometry.covariance);
|
data->time, data->odometer.pose, data->odometer.covariance);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(FATAL);
|
LOG(FATAL);
|
||||||
|
|
|
@ -55,7 +55,7 @@ class GlobalTrajectoryBuilderInterface {
|
||||||
virtual void AddImuData(common::Time time,
|
virtual void AddImuData(common::Time time,
|
||||||
const Eigen::Vector3d& linear_acceleration,
|
const Eigen::Vector3d& linear_acceleration,
|
||||||
const Eigen::Vector3d& angular_velocity) = 0;
|
const Eigen::Vector3d& angular_velocity) = 0;
|
||||||
virtual void AddOdometerPose(
|
virtual void AddOdometerData(
|
||||||
common::Time time, const transform::Rigid3d& pose,
|
common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) = 0;
|
const kalman_filter::PoseCovariance& covariance) = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -97,12 +97,12 @@ class TrajectoryBuilder {
|
||||||
angular_velocity}));
|
angular_velocity}));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddOdometerPose(const string& sensor_id, common::Time time,
|
void AddOdometerData(const string& sensor_id, common::Time time,
|
||||||
const transform::Rigid3d& pose,
|
const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) {
|
const kalman_filter::PoseCovariance& covariance) {
|
||||||
AddSensorData(sensor_id,
|
AddSensorData(sensor_id,
|
||||||
common::make_unique<sensor::Data>(
|
common::make_unique<sensor::Data>(
|
||||||
time, sensor::Data::Odometry{pose, covariance}));
|
time, sensor::Data::Odometer{pose, covariance}));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -54,10 +54,10 @@ void GlobalTrajectoryBuilder::AddImuData(
|
||||||
angular_velocity);
|
angular_velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobalTrajectoryBuilder::AddOdometerPose(
|
void GlobalTrajectoryBuilder::AddOdometerData(
|
||||||
const common::Time time, const transform::Rigid3d& pose,
|
const common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) {
|
const kalman_filter::PoseCovariance& covariance) {
|
||||||
local_trajectory_builder_.AddOdometerPose(time, pose, covariance);
|
local_trajectory_builder_.AddOdometerData(time, pose, covariance);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapping::GlobalTrajectoryBuilderInterface::PoseEstimate&
|
const mapping::GlobalTrajectoryBuilderInterface::PoseEstimate&
|
||||||
|
|
|
@ -44,7 +44,7 @@ class GlobalTrajectoryBuilder
|
||||||
const sensor::LaserFan& laser_fan) override;
|
const sensor::LaserFan& laser_fan) override;
|
||||||
void AddImuData(common::Time time, const Eigen::Vector3d& linear_acceleration,
|
void AddImuData(common::Time time, const Eigen::Vector3d& linear_acceleration,
|
||||||
const Eigen::Vector3d& angular_velocity) override;
|
const Eigen::Vector3d& angular_velocity) override;
|
||||||
void AddOdometerPose(
|
void AddOdometerData(
|
||||||
common::Time time, const transform::Rigid3d& pose,
|
common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) override;
|
const kalman_filter::PoseCovariance& covariance) override;
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ void LocalTrajectoryBuilder::AddImuData(
|
||||||
<< common::RadToDeg(kMaxInclination);
|
<< common::RadToDeg(kMaxInclination);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalTrajectoryBuilder::AddOdometerPose(
|
void LocalTrajectoryBuilder::AddOdometerData(
|
||||||
const common::Time time, const transform::Rigid3d& pose,
|
const common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) {
|
const kalman_filter::PoseCovariance& covariance) {
|
||||||
if (pose_tracker_ == nullptr) {
|
if (pose_tracker_ == nullptr) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ class LocalTrajectoryBuilder {
|
||||||
common::Time, const sensor::LaserFan& laser_fan);
|
common::Time, const sensor::LaserFan& laser_fan);
|
||||||
void AddImuData(common::Time time, const Eigen::Vector3d& linear_acceleration,
|
void AddImuData(common::Time time, const Eigen::Vector3d& linear_acceleration,
|
||||||
const Eigen::Vector3d& angular_velocity);
|
const Eigen::Vector3d& angular_velocity);
|
||||||
void AddOdometerPose(common::Time time, const transform::Rigid3d& pose,
|
void AddOdometerData(common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance);
|
const kalman_filter::PoseCovariance& covariance);
|
||||||
|
|
||||||
const Submaps* submaps() const;
|
const Submaps* submaps() const;
|
||||||
|
|
|
@ -58,10 +58,10 @@ void GlobalTrajectoryBuilder::AddLaserFan(const common::Time time,
|
||||||
local_trajectory_builder_->AddTrajectoryNodeIndex(trajectory_node_index);
|
local_trajectory_builder_->AddTrajectoryNodeIndex(trajectory_node_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobalTrajectoryBuilder::AddOdometerPose(
|
void GlobalTrajectoryBuilder::AddOdometerData(
|
||||||
const common::Time time, const transform::Rigid3d& pose,
|
const common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) {
|
const kalman_filter::PoseCovariance& covariance) {
|
||||||
local_trajectory_builder_->AddOdometerPose(time, pose, covariance);
|
local_trajectory_builder_->AddOdometerData(time, pose, covariance);
|
||||||
}
|
}
|
||||||
|
|
||||||
const GlobalTrajectoryBuilder::PoseEstimate&
|
const GlobalTrajectoryBuilder::PoseEstimate&
|
||||||
|
|
|
@ -42,7 +42,7 @@ class GlobalTrajectoryBuilder
|
||||||
const Eigen::Vector3d& angular_velocity) override;
|
const Eigen::Vector3d& angular_velocity) override;
|
||||||
void AddLaserFan(common::Time time,
|
void AddLaserFan(common::Time time,
|
||||||
const sensor::LaserFan& laser_fan) override;
|
const sensor::LaserFan& laser_fan) override;
|
||||||
void AddOdometerPose(
|
void AddOdometerData(
|
||||||
common::Time time, const transform::Rigid3d& pose,
|
common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) override;
|
const kalman_filter::PoseCovariance& covariance) override;
|
||||||
const PoseEstimate& pose_estimate() const override;
|
const PoseEstimate& pose_estimate() const override;
|
||||||
|
|
|
@ -186,7 +186,7 @@ KalmanLocalTrajectoryBuilder::AddAccumulatedLaserFan(
|
||||||
covariance_estimate);
|
covariance_estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KalmanLocalTrajectoryBuilder::AddOdometerPose(
|
void KalmanLocalTrajectoryBuilder::AddOdometerData(
|
||||||
const common::Time time, const transform::Rigid3d& pose,
|
const common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) {
|
const kalman_filter::PoseCovariance& covariance) {
|
||||||
if (!pose_tracker_) {
|
if (!pose_tracker_) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ class KalmanLocalTrajectoryBuilder : public LocalTrajectoryBuilderInterface {
|
||||||
const Eigen::Vector3d& angular_velocity) override;
|
const Eigen::Vector3d& angular_velocity) override;
|
||||||
std::unique_ptr<InsertionResult> AddLaserFan(
|
std::unique_ptr<InsertionResult> AddLaserFan(
|
||||||
common::Time time, const sensor::LaserFan& laser_fan) override;
|
common::Time time, const sensor::LaserFan& laser_fan) override;
|
||||||
void AddOdometerPose(
|
void AddOdometerData(
|
||||||
common::Time time, const transform::Rigid3d& pose,
|
common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) override;
|
const kalman_filter::PoseCovariance& covariance) override;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class LocalTrajectoryBuilderInterface {
|
||||||
const Eigen::Vector3d& angular_velocity) = 0;
|
const Eigen::Vector3d& angular_velocity) = 0;
|
||||||
virtual std::unique_ptr<InsertionResult> AddLaserFan(
|
virtual std::unique_ptr<InsertionResult> AddLaserFan(
|
||||||
common::Time time, const sensor::LaserFan& laser_fan) = 0;
|
common::Time time, const sensor::LaserFan& laser_fan) = 0;
|
||||||
virtual void AddOdometerPose(
|
virtual void AddOdometerData(
|
||||||
common::Time time, const transform::Rigid3d& pose,
|
common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) = 0;
|
const kalman_filter::PoseCovariance& covariance) = 0;
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ void OptimizingLocalTrajectoryBuilder::AddImuData(
|
||||||
RemoveObsoleteSensorData();
|
RemoveObsoleteSensorData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptimizingLocalTrajectoryBuilder::AddOdometerPose(
|
void OptimizingLocalTrajectoryBuilder::AddOdometerData(
|
||||||
const common::Time time, const transform::Rigid3d& pose,
|
const common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) {
|
const kalman_filter::PoseCovariance& covariance) {
|
||||||
odometer_data_.push_back(OdometerData{time, pose});
|
odometer_data_.push_back(OdometerData{time, pose});
|
||||||
|
|
|
@ -56,7 +56,7 @@ class OptimizingLocalTrajectoryBuilder
|
||||||
common::Time time,
|
common::Time time,
|
||||||
const sensor::LaserFan& laser_fan_in_tracking) override;
|
const sensor::LaserFan& laser_fan_in_tracking) override;
|
||||||
|
|
||||||
void AddOdometerPose(
|
void AddOdometerData(
|
||||||
const common::Time time, const transform::Rigid3d& pose,
|
const common::Time time, const transform::Rigid3d& pose,
|
||||||
const kalman_filter::PoseCovariance& covariance) override;
|
const kalman_filter::PoseCovariance& covariance) override;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ TEST(Collator, Ordering) {
|
||||||
Data third(common::FromUniversal(300), Data::Imu{});
|
Data third(common::FromUniversal(300), Data::Imu{});
|
||||||
Data fourth(common::FromUniversal(400), sensor::LaserFan{});
|
Data fourth(common::FromUniversal(400), sensor::LaserFan{});
|
||||||
Data fifth(common::FromUniversal(500), sensor::LaserFan{});
|
Data fifth(common::FromUniversal(500), sensor::LaserFan{});
|
||||||
Data sixth(common::FromUniversal(600), Data::Odometry{});
|
Data sixth(common::FromUniversal(600), Data::Odometer{});
|
||||||
|
|
||||||
std::vector<std::pair<string, Data>> received;
|
std::vector<std::pair<string, Data>> received;
|
||||||
Collator collator;
|
Collator collator;
|
||||||
|
|
|
@ -29,10 +29,12 @@ namespace sensor {
|
||||||
// filled in. It is only used for time ordering sensor data before passing it
|
// filled in. It is only used for time ordering sensor data before passing it
|
||||||
// on.
|
// on.
|
||||||
struct Data {
|
struct Data {
|
||||||
enum class Type { kImu, kLaserFan, kOdometry };
|
enum class Type { kImu, kLaserFan, kOdometer };
|
||||||
|
|
||||||
struct Odometry {
|
struct Odometer {
|
||||||
transform::Rigid3d pose;
|
transform::Rigid3d pose;
|
||||||
|
// TODO(damonkohler): Remove this in favor of using the configurable
|
||||||
|
// constant variance directly.
|
||||||
kalman_filter::PoseCovariance covariance;
|
kalman_filter::PoseCovariance covariance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,14 +50,14 @@ struct Data {
|
||||||
const ::cartographer::sensor::LaserFan& laser_fan)
|
const ::cartographer::sensor::LaserFan& laser_fan)
|
||||||
: type(Type::kLaserFan), time(time), laser_fan(laser_fan) {}
|
: type(Type::kLaserFan), time(time), laser_fan(laser_fan) {}
|
||||||
|
|
||||||
Data(const common::Time time, const Odometry& odometry)
|
Data(const common::Time time, const Odometer& odometer)
|
||||||
: type(Type::kOdometry), time(time), odometry(odometry) {}
|
: type(Type::kOdometer), time(time), odometer(odometer) {}
|
||||||
|
|
||||||
Type type;
|
Type type;
|
||||||
common::Time time;
|
common::Time time;
|
||||||
Imu imu;
|
Imu imu;
|
||||||
sensor::LaserFan laser_fan;
|
sensor::LaserFan laser_fan;
|
||||||
Odometry odometry;
|
Odometer odometer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sensor
|
} // namespace sensor
|
||||||
|
|
Loading…
Reference in New Issue