Skip to content

Commit

Permalink
chore: fix namespace style (concatenate c++17 style) (#207)
Browse files Browse the repository at this point in the history
Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex authored Oct 3, 2024
1 parent f43a28d commit 668c8f7
Show file tree
Hide file tree
Showing 110 changed files with 222 additions and 592 deletions.
7 changes: 2 additions & 5 deletions nebula_common/include/nebula_common/nebula_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
#include <string>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
/// @brief Coordinate mode for Velodyne's setting (need to check)
enum class CoordinateMode { UNKNOWN = 0, CARTESIAN, SPHERICAL, CYLINDRICAL };
Expand Down Expand Up @@ -785,7 +783,6 @@ static inline float rad2deg(double radians)
{
return radians * 180.0 / M_PI;
}
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers

#endif // NEBULA_CONFIGURATION_BASE_H
7 changes: 2 additions & 5 deletions nebula_common/include/nebula_common/point_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

#include <memory>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
struct EIGEN_ALIGN16 PointXYZIR
{
Expand Down Expand Up @@ -76,8 +74,7 @@ using NebulaPointPtr = std::shared_ptr<NebulaPoint>;
using NebulaPointCloud = pcl::PointCloud<NebulaPoint>;
using NebulaPointCloudPtr = pcl::PointCloud<NebulaPoint>::Ptr;

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers

POINT_CLOUD_REGISTER_POINT_STRUCT(
nebula::drivers::PointXYZIR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#include <string>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
struct VelodyneLaserCorrection
{
Expand Down Expand Up @@ -68,7 +66,6 @@ class VelodyneCalibration
void write(const std::string & calibration_file);
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers

#endif // NEBULA_VELODYNE_CALIBRATION_DECODER_H
8 changes: 2 additions & 6 deletions nebula_common/src/nebula_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

#include <nebula_common/nebula_common.hpp>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
[[maybe_unused]] pcl::PointCloud<PointXYZIR>::Ptr convert_point_xyziradt_to_point_xyzir(
const pcl::PointCloud<PointXYZIRADT>::ConstPtr & input_pointcloud)
Expand Down Expand Up @@ -71,6 +69,4 @@ pcl::PointCloud<PointXYZIRADT>::Ptr convert_point_xyzircaedt_to_point_xyziradt(
output_pointcloud->width = output_pointcloud->points.size();
return output_pointcloud;
}
} // namespace drivers

} // namespace nebula
} // namespace nebula::drivers
7 changes: 2 additions & 5 deletions nebula_common/src/velodyne/velodyne_calibration_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ void operator>>(const YAML::Node & node, T & i)
} // namespace YAML
#endif // HAVE_NEW_YAMLCPP

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
const char g_num_lasers[] = "num_lasers";
const char g_distance_resolution[] = "distance_resolution";
Expand Down Expand Up @@ -242,5 +240,4 @@ void VelodyneCalibration::write(const std::string & calibration_file)
fout.close();
}

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include <string>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
/// @brief Base class for each sensor driver
class NebulaDriverBase
Expand All @@ -45,6 +43,5 @@ class NebulaDriverBase
const CalibrationConfigurationBase & calibration_configuration) = 0;
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
#endif // NEBULA_DRIVER_BASE_H
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
#include <memory>
#include <vector>

namespace nebula
{
namespace drivers
{
namespace continental_ars548
namespace nebula::drivers::continental_ars548
{
/// @brief Continental Radar decoder (ARS548)
class ContinentalARS548Decoder : public ContinentalPacketsDecoder
Expand Down Expand Up @@ -108,6 +104,4 @@ class ContinentalARS548Decoder : public ContinentalPacketsDecoder
std::shared_ptr<const continental_ars548::ContinentalARS548SensorConfiguration> config_ptr_{};
};

} // namespace continental_ars548
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers::continental_ars548
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include <memory>
#include <tuple>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
/// @brief Base class for Continental Radar decoder
class ContinentalPacketsDecoder
Expand All @@ -48,6 +46,5 @@ class ContinentalPacketsDecoder
/// @return Resulting flag
virtual bool process_packet(std::unique_ptr<nebula_msgs::msg::NebulaPacket> packet_msg) = 0;
};
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
#endif // NEBULA_WS_CONTINENTAL_PACKETS_DECODER_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@
#include <string>
#include <vector>

namespace nebula
{
namespace drivers
{
namespace continental_srr520
namespace nebula::drivers::continental_srr520
{
/// @brief Continental Radar decoder (SRR520)
class ContinentalSRR520Decoder : public ContinentalPacketsDecoder
Expand Down Expand Up @@ -206,6 +202,4 @@ class ContinentalSRR520Decoder : public ContinentalPacketsDecoder
std::shared_ptr<rclcpp::Logger> parent_node_logger_ptr_{};
};

} // namespace continental_srr520
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers::continental_srr520
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include <tuple>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
/// @brief Hesai driver
class HesaiDriver
Expand Down Expand Up @@ -73,7 +71,6 @@ class HesaiDriver
const std::vector<uint8_t> & packet);
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers

#endif // NEBULA_HESAI_DRIVER_H
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
#include <cstdint>
#include <memory>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{

struct CorrectedAngleData
Expand Down Expand Up @@ -68,5 +66,4 @@ class AngleCorrector
virtual bool has_scanned(int current_azimuth, int last_azimuth) = 0;
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include <cstdint>
#include <memory>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{

template <size_t ChannelN, size_t AngleUnit>
Expand Down Expand Up @@ -96,5 +94,4 @@ class AngleCorrectorCalibrationBased : public AngleCorrector
}
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@

using namespace boost::endian; // NOLINT(build/namespaces)

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
namespace robosense_packet
{
Expand Down Expand Up @@ -473,5 +471,4 @@ class BpearlV3 : public RobosenseSensor<
return sensor_info;
}
};
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@

using namespace boost::endian; // NOLINT(build/namespaces)

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
namespace robosense_packet
{
Expand Down Expand Up @@ -392,5 +390,4 @@ class BpearlV4 : public RobosenseSensor<
return sensor_info;
}
};
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@

using namespace boost::endian; // NOLINT(build/namespaces)

namespace nebula
namespace nebula::drivers
{
namespace drivers
{
namespace robosense_packet
{
namespace helios
namespace robosense_packet::helios
{
#pragma pack(push, 1)

Expand Down Expand Up @@ -161,8 +157,7 @@ struct InfoPacket
};

#pragma pack(pop)
} // namespace helios
} // namespace robosense_packet
} // namespace robosense_packet::helios

class Helios
: public RobosenseSensor<robosense_packet::helios::Packet, robosense_packet::helios::InfoPacket>
Expand Down Expand Up @@ -468,5 +463,4 @@ class Helios
}
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#include <utility>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
template <typename SensorT>
class RobosenseDecoder : public RobosenseScanDecoder
Expand Down Expand Up @@ -281,5 +279,4 @@ class RobosenseDecoder : public RobosenseScanDecoder
}
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
#include <string>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{

template <typename SensorT>
Expand Down Expand Up @@ -94,5 +92,4 @@ class RobosenseInfoDecoder : public RobosenseInfoDecoderBase
bool get_sync_status() override { return sensor_.get_sync_status(packet_); }
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include <map>
#include <string>
#include <vector>
namespace nebula
{
namespace drivers
namespace nebula::drivers
{

class RobosenseInfoDecoderBase
Expand Down Expand Up @@ -58,5 +56,4 @@ class RobosenseInfoDecoderBase
virtual bool get_sync_status() = 0;
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@

using namespace boost::endian; // NOLINT(build/namespaces)

namespace nebula
{
namespace drivers
{
namespace robosense_packet
namespace nebula::drivers::robosense_packet
{

#pragma pack(push, 1)
Expand Down Expand Up @@ -278,6 +274,4 @@ inline std::string get_float_value(const uint16_t & raw_angle)
return std::to_string(static_cast<float>(raw_angle) / 100.0f);
}

} // namespace robosense_packet
} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers::robosense_packet
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#include <tuple>
#include <vector>

namespace nebula
{
namespace drivers
namespace nebula::drivers
{
/// @brief Base class for Robosense LiDAR decoder
class RobosenseScanDecoder
Expand Down Expand Up @@ -49,5 +47,4 @@ class RobosenseScanDecoder
virtual std::tuple<drivers::NebulaPointCloudPtr, double> get_pointcloud() = 0;
};

} // namespace drivers
} // namespace nebula
} // namespace nebula::drivers
Loading

0 comments on commit 668c8f7

Please sign in to comment.