points_batch.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 namespace cartographer {
20 namespace io {
21 
22 void RemovePoints(std::vector<int> to_remove, PointsBatch* batch) {
23  std::sort(to_remove.begin(), to_remove.end(), std::greater<int>());
24  for (const int index : to_remove) {
25  batch->points.erase(batch->points.begin() + index);
26  if (!batch->colors.empty()) {
27  batch->colors.erase(batch->colors.begin() + index);
28  }
29  if (!batch->intensities.empty()) {
30  batch->intensities.erase(batch->intensities.begin() + index);
31  }
32  }
33 }
34 
35 } // namespace io
36 } // namespace cartographer
void RemovePoints(std::vector< int > to_remove, PointsBatch *batch)
Definition: points_batch.cc:22
std::vector< Color > colors
Definition: points_batch.h:66
std::vector< float > intensities
Definition: points_batch.h:63
std::vector< Eigen::Vector3f > points
Definition: points_batch.h:56


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:39