diff --git a/.clang-format b/.clang-format index c3b72db7..b41fae91 100644 --- a/.clang-format +++ b/.clang-format @@ -4,6 +4,7 @@ BasedOnStyle: Google AccessModifierOffset: -2 AlignAfterOpenBracket: AlwaysBreak +AllowShortFunctionsOnASingleLine: InlineOnly BraceWrapping: AfterClass: true AfterFunction: true diff --git a/autoware_utils/include/autoware_utils/math/unit_conversion.hpp b/autoware_utils/include/autoware_utils/math/unit_conversion.hpp index 08098432..97db93fe 100644 --- a/autoware_utils/include/autoware_utils/math/unit_conversion.hpp +++ b/autoware_utils/include/autoware_utils/math/unit_conversion.hpp @@ -19,11 +19,25 @@ namespace autoware_utils { -constexpr double deg2rad(const double deg) { return deg * pi / 180.0; } -constexpr double rad2deg(const double rad) { return rad * 180.0 / pi; } +constexpr double deg2rad(const double deg) +{ + return deg * pi / 180.0; +} + +constexpr double rad2deg(const double rad) +{ + return rad * 180.0 / pi; +} -constexpr double kmph2mps(const double kmph) { return kmph * 1000.0 / 3600.0; } -constexpr double mps2kmph(const double mps) { return mps * 3600.0 / 1000.0; } +constexpr double kmph2mps(const double kmph) +{ + return kmph * 1000.0 / 3600.0; +} + +constexpr double mps2kmph(const double mps) +{ + return mps * 3600.0 / 1000.0; +} } // namespace autoware_utils #endif // AUTOWARE_UTILS__MATH__UNIT_CONVERSION_HPP_ diff --git a/tmp/lanelet2_extension/lib/detection_area.cpp b/tmp/lanelet2_extension/lib/detection_area.cpp index 54a38996..15905f63 100644 --- a/tmp/lanelet2_extension/lib/detection_area.cpp +++ b/tmp/lanelet2_extension/lib/detection_area.cpp @@ -120,7 +120,10 @@ ConstPolygons3d DetectionArea::detectionAreas() const { return getConstPoly(parameters(), RoleName::Refers); } -Polygons3d DetectionArea::detectionAreas() { return getPoly(parameters(), RoleName::Refers); } +Polygons3d DetectionArea::detectionAreas() +{ + return getPoly(parameters(), RoleName::Refers); +} void DetectionArea::addDetectionArea(const Polygon3d & primitive) { @@ -147,7 +150,10 @@ void DetectionArea::setStopLine(const LineString3d & stopLine) parameters()[RoleName::RefLine] = {stopLine}; } -void DetectionArea::removeStopLine() { parameters()[RoleName::RefLine] = {}; } +void DetectionArea::removeStopLine() +{ + parameters()[RoleName::RefLine] = {}; +} } // namespace lanelet::autoware diff --git a/tmp/lanelet2_extension/lib/mgrs_projector.cpp b/tmp/lanelet2_extension/lib/mgrs_projector.cpp index d4e1ce79..891df1be 100644 --- a/tmp/lanelet2_extension/lib/mgrs_projector.cpp +++ b/tmp/lanelet2_extension/lib/mgrs_projector.cpp @@ -26,7 +26,9 @@ namespace lanelet::projection { -MGRSProjector::MGRSProjector(Origin origin) : Projector(origin) {} +MGRSProjector::MGRSProjector(Origin origin) : Projector(origin) +{ +} BasicPoint3d MGRSProjector::forward(const GPSPoint & gps) const { @@ -105,7 +107,10 @@ GPSPoint MGRSProjector::reverse(const BasicPoint3d & mgrs_point, const std::stri return gps; } -void MGRSProjector::setMGRSCode(const std::string & mgrs_code) { mgrs_code_ = mgrs_code; } +void MGRSProjector::setMGRSCode(const std::string & mgrs_code) +{ + mgrs_code_ = mgrs_code; +} void MGRSProjector::setMGRSCode(const GPSPoint & gps, const int precision) { diff --git a/tmp/lanelet2_extension/lib/no_stopping_area.cpp b/tmp/lanelet2_extension/lib/no_stopping_area.cpp index 3d83a03c..bf8b856e 100644 --- a/tmp/lanelet2_extension/lib/no_stopping_area.cpp +++ b/tmp/lanelet2_extension/lib/no_stopping_area.cpp @@ -120,7 +120,10 @@ ConstPolygons3d NoStoppingArea::noStoppingAreas() const { return getConstPoly(parameters(), RoleName::Refers); } -Polygons3d NoStoppingArea::noStoppingAreas() { return getPoly(parameters(), RoleName::Refers); } +Polygons3d NoStoppingArea::noStoppingAreas() +{ + return getPoly(parameters(), RoleName::Refers); +} void NoStoppingArea::addNoStoppingArea(const Polygon3d & primitive) { @@ -147,7 +150,10 @@ void NoStoppingArea::setStopLine(const LineString3d & stopLine) parameters()[RoleName::RefLine] = {stopLine}; } -void NoStoppingArea::removeStopLine() { parameters()[RoleName::RefLine] = {}; } +void NoStoppingArea::removeStopLine() +{ + parameters()[RoleName::RefLine] = {}; +} } // namespace lanelet::autoware diff --git a/tmp/lanelet2_extension/lib/road_marking.cpp b/tmp/lanelet2_extension/lib/road_marking.cpp index fd2a2023..7968fa6b 100644 --- a/tmp/lanelet2_extension/lib/road_marking.cpp +++ b/tmp/lanelet2_extension/lib/road_marking.cpp @@ -70,7 +70,10 @@ void RoadMarking::setRoadMarking(const LineString3d & road_marking) parameters()[RoleName::Refers] = {road_marking}; } -void RoadMarking::removeRoadMarking() { parameters()[RoleName::Refers] = {}; } +void RoadMarking::removeRoadMarking() +{ + parameters()[RoleName::Refers] = {}; +} } // namespace lanelet::autoware diff --git a/tmp/lanelet2_extension/lib/speed_bump.cpp b/tmp/lanelet2_extension/lib/speed_bump.cpp index 543dd847..35d3bc32 100644 --- a/tmp/lanelet2_extension/lib/speed_bump.cpp +++ b/tmp/lanelet2_extension/lib/speed_bump.cpp @@ -100,7 +100,10 @@ ConstPolygon3d SpeedBump::speedBump() const return getConstPoly(parameters(), RoleName::Refers).front(); } -Polygon3d SpeedBump::speedBump() { return getPoly(parameters(), RoleName::Refers).front(); } +Polygon3d SpeedBump::speedBump() +{ + return getPoly(parameters(), RoleName::Refers).front(); +} void SpeedBump::addSpeedBump(const Polygon3d & primitive) {