19 #include "cartographer/sensor/proto/sensor.pb.h" 28 result.reserve(point_cloud.size());
29 for (
const Eigen::Vector3f& point : point_cloud) {
30 result.emplace_back(transform * point);
38 for (
const auto& point : point_cloud) {
39 if (min_z <= point.z() && point.z() <=
max_z) {
40 cropped_point_cloud.push_back(point);
43 return cropped_point_cloud;
48 for (
const auto& point : point_cloud) {
49 proto.add_x(point.x());
50 proto.add_y(point.y());
51 proto.add_z(point.z());
58 const int size = std::min({proto.x_size(), proto.y_size(), proto.z_size()});
59 point_cloud.reserve(size);
60 for (
int i = 0; i != size; ++i) {
61 point_cloud.emplace_back(proto.x(i), proto.y(i), proto.z(i));
PointCloud TransformPointCloud(const PointCloud &point_cloud, const transform::Rigid3f &transform)
PointCloud Crop(const PointCloud &point_cloud, const float min_z, const float max_z)
proto::PointCloud ToProto(const PointCloud &point_cloud)
std::vector< Eigen::Vector3f > PointCloud
PointCloud ToPointCloud(const proto::PointCloud &proto)