Skip to content

Commit 66a6b1c

Browse files
authored
Merge pull request #323 from ethz-asl/fix/style
Fix style by running clang-format once and updating include order
2 parents 5df0774 + d3dc323 commit 66a6b1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+134
-101
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Language: Cpp
33
BasedOnStyle: Google
44
ColumnLimit: 80
5+
IncludeBlocks: Preserve
56
---
67
Language: Proto
78
BasedOnStyle: Google

voxblox/include/voxblox/core/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace voxblox {
1515
namespace Update {
1616
/// Status of which derived things still need to be updated.
1717
enum Status { kMap, kMesh, kEsdf, kCount };
18-
}
18+
} // namespace Update
1919

2020
/** An n x n x n container holding VoxelType. It is aware of its 3D position and
2121
* contains functions for accessing voxels by position and index */

voxblox/include/voxblox/core/esdf_map.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#ifndef VOXBLOX_CORE_ESDF_MAP_H_
22
#define VOXBLOX_CORE_ESDF_MAP_H_
33

4-
#include <glog/logging.h>
54
#include <memory>
65
#include <string>
76
#include <utility>
87

8+
#include <glog/logging.h>
9+
910
#include "voxblox/core/common.h"
1011
#include "voxblox/core/layer.h"
1112
#include "voxblox/core/voxel.h"
1213
#include "voxblox/interpolator/interpolator.h"
13-
1414
#include "voxblox/io/layer_io.h"
1515

1616
namespace voxblox {

voxblox/include/voxblox/core/layer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#ifndef VOXBLOX_CORE_LAYER_H_
22
#define VOXBLOX_CORE_LAYER_H_
33

4-
#include <glog/logging.h>
54
#include <memory>
65
#include <string>
76
#include <utility>
87

8+
#include <glog/logging.h>
9+
910
#include "voxblox/Block.pb.h"
1011
#include "voxblox/Layer.pb.h"
1112
#include "voxblox/core/block.h"

voxblox/include/voxblox/core/occupancy_map.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#ifndef VOXBLOX_CORE_OCCUPANCY_MAP_H_
22
#define VOXBLOX_CORE_OCCUPANCY_MAP_H_
33

4-
#include <glog/logging.h>
54
#include <memory>
65
#include <utility>
76

7+
#include <glog/logging.h>
8+
89
#include "voxblox/core/common.h"
910
#include "voxblox/core/layer.h"
1011
#include "voxblox/core/voxel.h"

voxblox/include/voxblox/core/tsdf_map.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#ifndef VOXBLOX_CORE_TSDF_MAP_H_
22
#define VOXBLOX_CORE_TSDF_MAP_H_
33

4-
#include <glog/logging.h>
54
#include <memory>
65
#include <string>
76
#include <utility>
87

8+
#include <glog/logging.h>
9+
910
#include "voxblox/core/common.h"
1011
#include "voxblox/core/layer.h"
1112
#include "voxblox/core/voxel.h"
@@ -44,8 +45,7 @@ class TsdfMap {
4445

4546
/// Creates a new TsdfMap that contains this layer.
4647
explicit TsdfMap(Layer<TsdfVoxel>::Ptr layer)
47-
: tsdf_layer_(layer),
48-
interpolator_(tsdf_layer_.get()) {
48+
: tsdf_layer_(layer), interpolator_(tsdf_layer_.get()) {
4949
if (!layer) {
5050
/* NOTE([email protected]) - throw std exception for Python to catch
5151
* This is idiomatic when wrapping C++ code for Python, especially with
@@ -62,7 +62,9 @@ class TsdfMap {
6262
virtual ~TsdfMap() {}
6363

6464
Layer<TsdfVoxel>* getTsdfLayerPtr() { return tsdf_layer_.get(); }
65-
const Layer<TsdfVoxel>* getTsdfLayerConstPtr() const { return tsdf_layer_.get(); }
65+
const Layer<TsdfVoxel>* getTsdfLayerConstPtr() const {
66+
return tsdf_layer_.get();
67+
}
6668
const Layer<TsdfVoxel>& getTsdfLayer() const { return *tsdf_layer_; }
6769

6870
FloatingPoint block_size() const { return block_size_; }
@@ -92,7 +94,7 @@ class TsdfMap {
9294
bool getWeightAtPosition(const Eigen::Vector3d& position,
9395
double* weight) const;
9496
bool getWeightAtPosition(const Eigen::Vector3d& position,
95-
bool interpolate, double* weight) const;
97+
const bool interpolate, double* weight) const;
9698

9799
protected:
98100
FloatingPoint block_size_;

voxblox/include/voxblox/integrator/esdf_integrator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#ifndef VOXBLOX_INTEGRATOR_ESDF_INTEGRATOR_H_
22
#define VOXBLOX_INTEGRATOR_ESDF_INTEGRATOR_H_
33

4-
#include <glog/logging.h>
5-
#include <Eigen/Core>
64
#include <algorithm>
75
#include <queue>
86
#include <utility>
97
#include <vector>
108

9+
#include <glog/logging.h>
10+
#include <Eigen/Core>
11+
1112
#include "voxblox/core/layer.h"
1213
#include "voxblox/core/voxel.h"
1314
#include "voxblox/integrator/integrator_utils.h"

voxblox/include/voxblox/integrator/esdf_occ_integrator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#ifndef VOXBLOX_INTEGRATOR_ESDF_OCC_INTEGRATOR_H_
22
#define VOXBLOX_INTEGRATOR_ESDF_OCC_INTEGRATOR_H_
33

4-
#include <glog/logging.h>
5-
#include <Eigen/Core>
64
#include <algorithm>
75
#include <queue>
86
#include <utility>
97
#include <vector>
108

9+
#include <glog/logging.h>
10+
#include <Eigen/Core>
11+
1112
#include "voxblox/core/layer.h"
1213
#include "voxblox/core/voxel.h"
1314
#include "voxblox/integrator/integrator_utils.h"

voxblox/include/voxblox/integrator/intensity_integrator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#ifndef VOXBLOX_INTEGRATOR_INTENSITY_INTEGRATOR_H_
22
#define VOXBLOX_INTEGRATOR_INTENSITY_INTEGRATOR_H_
33

4-
#include <glog/logging.h>
5-
#include <Eigen/Core>
64
#include <algorithm>
75
#include <queue>
86
#include <utility>
97
#include <vector>
108

9+
#include <glog/logging.h>
10+
#include <Eigen/Core>
11+
1112
#include "voxblox/core/layer.h"
1213
#include "voxblox/core/voxel.h"
1314
#include "voxblox/integrator/integrator_utils.h"

voxblox/include/voxblox/integrator/merge_integration.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
#include <glog/logging.h>
99

10-
#include "voxblox/interpolator/interpolator.h"
11-
1210
#include "voxblox/core/common.h"
1311
#include "voxblox/core/layer.h"
1412
#include "voxblox/core/voxel.h"
13+
#include "voxblox/interpolator/interpolator.h"
1514

1615
namespace voxblox {
1716

voxblox/include/voxblox/integrator/tsdf_integrator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class TsdfIntegratorBase {
110110
protected:
111111
/// Thread safe.
112112
inline bool isPointValid(const Point& point_C, const bool freespace_point,
113-
bool* is_clearing) const {
113+
bool* is_clearing) const {
114114
DCHECK(is_clearing != nullptr);
115115
const FloatingPoint ray_distance = point_C.norm();
116116
if (ray_distance < config_.min_ray_length_m) {

voxblox/include/voxblox/interpolator/interpolator_inl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ bool Interpolator<VoxelType>::getDistance(const Point& pos,
2323
}
2424

2525
template <typename VoxelType>
26-
bool Interpolator<VoxelType>::getWeight(const Point& pos,
27-
FloatingPoint* weight,
26+
bool Interpolator<VoxelType>::getWeight(const Point& pos, FloatingPoint* weight,
2827
bool interpolate) const {
2928
CHECK_NOTNULL(weight);
3029
if (interpolate) {
@@ -334,8 +333,8 @@ bool Interpolator<VoxelType>::getInterpWeight(const Point& pos,
334333
}
335334

336335
template <typename VoxelType>
337-
bool Interpolator<VoxelType>::getNearestWeight(
338-
const Point& pos, FloatingPoint* weight) const {
336+
bool Interpolator<VoxelType>::getNearestWeight(const Point& pos,
337+
FloatingPoint* weight) const {
339338
CHECK_NOTNULL(weight);
340339

341340
typename Layer<VoxelType>::BlockType::ConstPtr block_ptr =
@@ -411,7 +410,8 @@ inline float Interpolator<EsdfVoxel>::getVoxelSdf(const EsdfVoxel& voxel) {
411410
}
412411

413412
template <typename VoxelType>
414-
inline float Interpolator<VoxelType>::getVoxelWeight(const VoxelType& /*voxel*/) {
413+
inline float Interpolator<VoxelType>::getVoxelWeight(
414+
const VoxelType& /*voxel*/) {
415415
return 0.0;
416416
}
417417

voxblox/include/voxblox/io/layer_io.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ bool LoadBlocksFromStream(
3939
uint64_t* tmp_byte_offset_ptr);
4040

4141
/**
42-
* Unlike LoadBlocks above, this actually allocates the layer as well.
43-
* By default loads without multiple layer support (i.e., only checks the first
44-
* layer in the file).
45-
*/
42+
* Unlike LoadBlocks above, this actually allocates the layer as well.
43+
* By default loads without multiple layer support (i.e., only checks the first
44+
* layer in the file).
45+
*/
4646
template <typename VoxelType>
4747
bool LoadLayer(const std::string& file_path,
4848
typename Layer<VoxelType>::Ptr* layer_ptr);

voxblox/include/voxblox/io/layer_io_inl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "voxblox/Block.pb.h"
88
#include "voxblox/Layer.pb.h"
9-
109
#include "voxblox/utils/protobuf_utils.h"
1110

1211
namespace voxblox {

voxblox/include/voxblox/io/mesh_ply.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
#ifndef VOXBLOX_IO_MESH_PLY_H_
2424
#define VOXBLOX_IO_MESH_PLY_H_
2525

26-
#include "voxblox/mesh/mesh_layer.h"
27-
2826
#include <fstream>
2927
#include <iostream>
3028
#include <string>
3129

30+
#include "voxblox/mesh/mesh_layer.h"
31+
3232
namespace voxblox {
3333

3434
/**

voxblox/include/voxblox/test/layer_test_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "voxblox/core/voxel.h"
88

99
namespace voxblox {
10+
1011
namespace test {
1112

1213
/**

voxblox/include/voxblox/utils/approx_hash_array.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <atomic>
55
#include <limits>
66
#include <vector>
7+
78
#include "voxblox/core/common.h"
89

910
/**

voxblox/include/voxblox/utils/bucket_queue.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#ifndef VOXBLOX_UTILS_BUCKET_QUEUE_H_
22
#define VOXBLOX_UTILS_BUCKET_QUEUE_H_
33

4-
#include <glog/logging.h>
54
#include <deque>
65
#include <queue>
76
#include <vector>
87

8+
#include <glog/logging.h>
9+
910
#include "voxblox/core/common.h"
1011

1112
namespace voxblox {

voxblox/include/voxblox/utils/color_maps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <algorithm>
55
#include <vector>
66

7-
#include "voxblox/core/common.h"
87
#include "voxblox/core/color.h"
8+
#include "voxblox/core/common.h"
99

1010
namespace voxblox {
1111

voxblox/include/voxblox/utils/distance_utils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef VOXBLOX_UTILS_DISTANCE_UTILS_H_
22
#define VOXBLOX_UTILS_DISTANCE_UTILS_H_
33

4-
#include <voxblox/core/block.h>
5-
#include <voxblox/core/common.h>
6-
#include <voxblox/core/layer.h>
7-
#include <voxblox/core/voxel.h>
4+
#include "voxblox/core/block.h"
5+
#include "voxblox/core/common.h"
6+
#include "voxblox/core/layer.h"
7+
#include "voxblox/core/voxel.h"
88

99
namespace voxblox {
1010

voxblox/include/voxblox/utils/evaluation_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "voxblox/core/voxel.h"
99

1010
namespace voxblox {
11+
1112
namespace utils {
1213

1314
enum class VoxelEvaluationResult { kNoOverlap, kIgnored, kEvaluated };

voxblox/include/voxblox/utils/layer_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "voxblox/core/voxel.h"
1111

1212
namespace voxblox {
13+
1314
namespace utils {
1415

1516
template <typename VoxelType>

voxblox/include/voxblox/utils/meshing_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "voxblox/core/voxel.h"
66

77
namespace voxblox {
8+
89
namespace utils {
910

1011
template <typename VoxelType>

voxblox/include/voxblox/utils/planning_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "voxblox/core/voxel.h"
66

77
namespace voxblox {
8+
89
namespace utils {
910

1011
/// Gets the indices of all points within the sphere.

voxblox/include/voxblox/utils/planning_utils_inl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "voxblox/core/voxel.h"
88

99
namespace voxblox {
10+
1011
namespace utils {
1112

1213
template <typename VoxelType>

voxblox/include/voxblox/utils/protobuf_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define VOXBLOX_UTILS_PROTOBUF_UTILS_H_
33

44
#include <fstream>
5+
56
#include <glog/logging.h>
67
#include <google/protobuf/message.h>
78
#include <google/protobuf/message_lite.h>

voxblox/src/alignment/icp.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@
3737
* $Id$
3838
*
3939
*/
40+
#include "voxblox/alignment/icp.h"
4041

4142
#include <random>
4243

43-
#include "voxblox/alignment/icp.h"
44-
4544
namespace voxblox {
4645

4746
ICP::ICP(const Config& config) : config_(config) {}

voxblox/src/core/block.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "voxblox/core/block.h"
2+
23
#include "voxblox/core/voxel.h"
34

45
namespace voxblox {

voxblox/src/core/tsdf_map.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ unsigned int TsdfMap::coordPlaneSliceGetDistanceWeight(
7878
return count;
7979
}
8080

81-
8281
bool TsdfMap::getWeightAtPosition(const Eigen::Vector3d& position,
8382
double* weight) const {
8483
constexpr bool interpolate = true;
8584
return getWeightAtPosition(position, interpolate, weight);
8685
}
8786

8887
bool TsdfMap::getWeightAtPosition(const Eigen::Vector3d& position,
89-
bool interpolate, double* weight) const {
88+
const bool interpolate,
89+
double* weight) const {
9090
FloatingPoint weight_fp;
9191
bool success = interpolator_.getWeight(position.cast<FloatingPoint>(),
9292
&weight_fp, interpolate);

voxblox/src/integrator/esdf_integrator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include <voxblox/utils/planning_utils.h>
2-
31
#include "voxblox/integrator/esdf_integrator.h"
42

3+
#include "voxblox/utils/planning_utils.h"
4+
55
namespace voxblox {
66

77
EsdfIntegrator::EsdfIntegrator(const Config& config,

0 commit comments

Comments
 (0)