From e3a25bbea81c4ce64dd525f6525fb4b440d7247a Mon Sep 17 00:00:00 2001 From: LihanChen2004 <757003373@qq.com> Date: Sat, 28 Dec 2024 14:24:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20build:=20Add=20build=20and=20tes?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NOTE: `ament_cmake_clang_tidy` will be added when the PR will be merged. https://github.com/ros2/rclcpp/pull/2718 --- fake_vel_transform/.clang-format | 18 ++++++ fake_vel_transform/.clang-tidy | 62 +++++++++++++++++++ fake_vel_transform/CMakeLists.txt | 5 +- fake_vel_transform/package.xml | 3 +- ign_sim_pointcloud_tool/.clang-format | 18 ++++++ ign_sim_pointcloud_tool/.clang-tidy | 62 +++++++++++++++++++ ign_sim_pointcloud_tool/CMakeLists.txt | 18 +++++- loam_interface/.clang-format | 18 ++++++ loam_interface/.clang-tidy | 62 +++++++++++++++++++ loam_interface/CMakeLists.txt | 14 ++++- loam_interface/package.xml | 2 + .../launch/rm_sentry_simulation_launch.py | 2 +- pb2025_nav_bringup/package.xml | 1 + sensor_scan_generation/.clang-format | 18 ++++++ sensor_scan_generation/.clang-tidy | 62 +++++++++++++++++++ sensor_scan_generation/CMakeLists.txt | 18 +++++- sensor_scan_generation/package.xml | 6 +- small_gicp_relocalization | 2 +- 18 files changed, 382 insertions(+), 9 deletions(-) create mode 100644 fake_vel_transform/.clang-format create mode 100644 fake_vel_transform/.clang-tidy create mode 100644 ign_sim_pointcloud_tool/.clang-format create mode 100644 ign_sim_pointcloud_tool/.clang-tidy create mode 100644 loam_interface/.clang-format create mode 100644 loam_interface/.clang-tidy create mode 100644 sensor_scan_generation/.clang-format create mode 100644 sensor_scan_generation/.clang-tidy diff --git a/fake_vel_transform/.clang-format b/fake_vel_transform/.clang-format new file mode 100644 index 0000000..2f8d64b --- /dev/null +++ b/fake_vel_transform/.clang-format @@ -0,0 +1,18 @@ +--- +Language: Cpp +BasedOnStyle: Google + +AccessModifierOffset: -2 +AlignAfterOpenBracket: AlwaysBreak +BraceWrapping: + AfterClass: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true +BreakBeforeBraces: Custom +ColumnLimit: 100 +ConstructorInitializerIndentWidth: 0 +ContinuationIndentWidth: 2 +DerivePointerAlignment: false +PointerAlignment: Middle +ReflowComments: false \ No newline at end of file diff --git a/fake_vel_transform/.clang-tidy b/fake_vel_transform/.clang-tidy new file mode 100644 index 0000000..d805018 --- /dev/null +++ b/fake_vel_transform/.clang-tidy @@ -0,0 +1,62 @@ +--- +Checks: '-*, + performance-*, + -performance-unnecessary-value-param, + llvm-namespace-comment, + modernize-redundant-void-arg, + modernize-use-nullptr, + modernize-use-default, + modernize-use-override, + modernize-loop-convert, + modernize-make-shared, + modernize-make-unique, + misc-unused-parameters, + readability-named-parameter, + readability-redundant-smartptr-get, + readability-redundant-string-cstr, + readability-simplify-boolean-expr, + readability-container-size-empty, + readability-identifier-naming, + ' +HeaderFilterRegex: '' +CheckOptions: + - key: llvm-namespace-comment.ShortNamespaceLines + value: '10' + - key: llvm-namespace-comment.SpacesBeforeComments + value: '2' + - key: misc-unused-parameters.StrictMode + value: '1' + - key: readability-braces-around-statements.ShortStatementLines + value: '2' + # type names + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.UnionCase + value: CamelCase + # method names + - key: readability-identifier-naming.MethodCase + value: camelBack + # variable names + - key: readability-identifier-naming.VariableCase + value: lower_case + # class member names + - key: readability-identifier-naming.PrivateMemberCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberSuffix + value: '_' + - key: readability-identifier-naming.ProtectedMemberCase + value: lower_case + - key: readability-identifier-naming.ProtectedMemberSuffix + value: '_' + # const static or global variables are UPPER_CASE + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.StaticConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ClassConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.GlobalVariableCase + value: UPPER_CASE +... diff --git a/fake_vel_transform/CMakeLists.txt b/fake_vel_transform/CMakeLists.txt index cf42230..4bfdc5c 100644 --- a/fake_vel_transform/CMakeLists.txt +++ b/fake_vel_transform/CMakeLists.txt @@ -37,10 +37,13 @@ rclcpp_components_register_node(${PROJECT_NAME} ############# if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) +set(ament_cmake_clang_format_CONFIG_FILE "${CMAKE_SOURCE_DIR}/.clang-format") +find_package(ament_lint_auto REQUIRED) list(APPEND AMENT_LINT_AUTO_EXCLUDE ament_cmake_copyright ament_cmake_uncrustify + ament_cmake_cpplint + ament_cmake_flake8 ) ament_lint_auto_find_test_dependencies() endif() diff --git a/fake_vel_transform/package.xml b/fake_vel_transform/package.xml index 003f844..271b596 100644 --- a/fake_vel_transform/package.xml +++ b/fake_vel_transform/package.xml @@ -4,9 +4,9 @@ fake_vel_transform 1.0.0 Adapts to NAV2 local path planner when `robot_base_frame` changes drastically. + Lihan Chen MIT Lihan Chen - Lihan Chen ament_cmake @@ -22,6 +22,7 @@ ament_lint_auto ament_lint_common ament_cmake_clang_format + ament_cmake_black ament_cmake diff --git a/ign_sim_pointcloud_tool/.clang-format b/ign_sim_pointcloud_tool/.clang-format new file mode 100644 index 0000000..2f8d64b --- /dev/null +++ b/ign_sim_pointcloud_tool/.clang-format @@ -0,0 +1,18 @@ +--- +Language: Cpp +BasedOnStyle: Google + +AccessModifierOffset: -2 +AlignAfterOpenBracket: AlwaysBreak +BraceWrapping: + AfterClass: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true +BreakBeforeBraces: Custom +ColumnLimit: 100 +ConstructorInitializerIndentWidth: 0 +ContinuationIndentWidth: 2 +DerivePointerAlignment: false +PointerAlignment: Middle +ReflowComments: false \ No newline at end of file diff --git a/ign_sim_pointcloud_tool/.clang-tidy b/ign_sim_pointcloud_tool/.clang-tidy new file mode 100644 index 0000000..d805018 --- /dev/null +++ b/ign_sim_pointcloud_tool/.clang-tidy @@ -0,0 +1,62 @@ +--- +Checks: '-*, + performance-*, + -performance-unnecessary-value-param, + llvm-namespace-comment, + modernize-redundant-void-arg, + modernize-use-nullptr, + modernize-use-default, + modernize-use-override, + modernize-loop-convert, + modernize-make-shared, + modernize-make-unique, + misc-unused-parameters, + readability-named-parameter, + readability-redundant-smartptr-get, + readability-redundant-string-cstr, + readability-simplify-boolean-expr, + readability-container-size-empty, + readability-identifier-naming, + ' +HeaderFilterRegex: '' +CheckOptions: + - key: llvm-namespace-comment.ShortNamespaceLines + value: '10' + - key: llvm-namespace-comment.SpacesBeforeComments + value: '2' + - key: misc-unused-parameters.StrictMode + value: '1' + - key: readability-braces-around-statements.ShortStatementLines + value: '2' + # type names + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.UnionCase + value: CamelCase + # method names + - key: readability-identifier-naming.MethodCase + value: camelBack + # variable names + - key: readability-identifier-naming.VariableCase + value: lower_case + # class member names + - key: readability-identifier-naming.PrivateMemberCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberSuffix + value: '_' + - key: readability-identifier-naming.ProtectedMemberCase + value: lower_case + - key: readability-identifier-naming.ProtectedMemberSuffix + value: '_' + # const static or global variables are UPPER_CASE + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.StaticConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ClassConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.GlobalVariableCase + value: UPPER_CASE +... diff --git a/ign_sim_pointcloud_tool/CMakeLists.txt b/ign_sim_pointcloud_tool/CMakeLists.txt index 6afb4f7..0c51ba5 100644 --- a/ign_sim_pointcloud_tool/CMakeLists.txt +++ b/ign_sim_pointcloud_tool/CMakeLists.txt @@ -29,9 +29,25 @@ ament_auto_add_library(${PROJECT_NAME} SHARED rclcpp_components_register_node(${PROJECT_NAME} PLUGIN ign_sim_pointcloud_tool::PointCloudConverter - EXECUTABLE point_cloud_converter_node + EXECUTABLE ${PROJECT_NAME}_node ) +############# +## Testing ## +############# + +if(BUILD_TESTING) +set(ament_cmake_clang_format_CONFIG_FILE "${CMAKE_SOURCE_DIR}/.clang-format") +find_package(ament_lint_auto REQUIRED) + list(APPEND AMENT_LINT_AUTO_EXCLUDE + ament_cmake_copyright + ament_cmake_uncrustify + ament_cmake_cpplint + ament_cmake_flake8 + ) + ament_lint_auto_find_test_dependencies() +endif() + ############# ## Install ## ############# diff --git a/loam_interface/.clang-format b/loam_interface/.clang-format new file mode 100644 index 0000000..2f8d64b --- /dev/null +++ b/loam_interface/.clang-format @@ -0,0 +1,18 @@ +--- +Language: Cpp +BasedOnStyle: Google + +AccessModifierOffset: -2 +AlignAfterOpenBracket: AlwaysBreak +BraceWrapping: + AfterClass: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true +BreakBeforeBraces: Custom +ColumnLimit: 100 +ConstructorInitializerIndentWidth: 0 +ContinuationIndentWidth: 2 +DerivePointerAlignment: false +PointerAlignment: Middle +ReflowComments: false \ No newline at end of file diff --git a/loam_interface/.clang-tidy b/loam_interface/.clang-tidy new file mode 100644 index 0000000..d805018 --- /dev/null +++ b/loam_interface/.clang-tidy @@ -0,0 +1,62 @@ +--- +Checks: '-*, + performance-*, + -performance-unnecessary-value-param, + llvm-namespace-comment, + modernize-redundant-void-arg, + modernize-use-nullptr, + modernize-use-default, + modernize-use-override, + modernize-loop-convert, + modernize-make-shared, + modernize-make-unique, + misc-unused-parameters, + readability-named-parameter, + readability-redundant-smartptr-get, + readability-redundant-string-cstr, + readability-simplify-boolean-expr, + readability-container-size-empty, + readability-identifier-naming, + ' +HeaderFilterRegex: '' +CheckOptions: + - key: llvm-namespace-comment.ShortNamespaceLines + value: '10' + - key: llvm-namespace-comment.SpacesBeforeComments + value: '2' + - key: misc-unused-parameters.StrictMode + value: '1' + - key: readability-braces-around-statements.ShortStatementLines + value: '2' + # type names + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.UnionCase + value: CamelCase + # method names + - key: readability-identifier-naming.MethodCase + value: camelBack + # variable names + - key: readability-identifier-naming.VariableCase + value: lower_case + # class member names + - key: readability-identifier-naming.PrivateMemberCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberSuffix + value: '_' + - key: readability-identifier-naming.ProtectedMemberCase + value: lower_case + - key: readability-identifier-naming.ProtectedMemberSuffix + value: '_' + # const static or global variables are UPPER_CASE + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.StaticConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ClassConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.GlobalVariableCase + value: UPPER_CASE +... diff --git a/loam_interface/CMakeLists.txt b/loam_interface/CMakeLists.txt index 1609309..d90e87b 100644 --- a/loam_interface/CMakeLists.txt +++ b/loam_interface/CMakeLists.txt @@ -29,9 +29,21 @@ ament_auto_add_library(${PROJECT_NAME} SHARED rclcpp_components_register_node(${PROJECT_NAME} PLUGIN loam_interface::LoamInterfaceNode - EXECUTABLE loam_interface_node + EXECUTABLE ${PROJECT_NAME}_node ) +if(BUILD_TESTING) +set(ament_cmake_clang_format_CONFIG_FILE "${CMAKE_SOURCE_DIR}/.clang-format") +find_package(ament_lint_auto REQUIRED) + list(APPEND AMENT_LINT_AUTO_EXCLUDE + ament_cmake_copyright + ament_cmake_uncrustify + ament_cmake_cpplint + ament_cmake_flake8 + ) + ament_lint_auto_find_test_dependencies() +endif() + ############# ## Install ## ############# diff --git a/loam_interface/package.xml b/loam_interface/package.xml index 2a92398..df343af 100644 --- a/loam_interface/package.xml +++ b/loam_interface/package.xml @@ -19,6 +19,8 @@ ament_lint_auto ament_lint_common + ament_cmake_clang_format + ament_cmake_black ament_cmake diff --git a/pb2025_nav_bringup/launch/rm_sentry_simulation_launch.py b/pb2025_nav_bringup/launch/rm_sentry_simulation_launch.py index a607f0d..73cf4e4 100644 --- a/pb2025_nav_bringup/launch/rm_sentry_simulation_launch.py +++ b/pb2025_nav_bringup/launch/rm_sentry_simulation_launch.py @@ -112,7 +112,7 @@ def generate_launch_description(): start_velodyne_convert_tool = Node( package="ign_sim_pointcloud_tool", - executable="point_cloud_converter_node", + executable="ign_sim_pointcloud_tool_node", name="point_cloud_converter", output="screen", namespace=namespace, diff --git a/pb2025_nav_bringup/package.xml b/pb2025_nav_bringup/package.xml index 4c21c8e..0cf3fd3 100644 --- a/pb2025_nav_bringup/package.xml +++ b/pb2025_nav_bringup/package.xml @@ -6,6 +6,7 @@ pb2025_nav_bringup Lihan Chen MIT + Lihan Chen ament_cmake diff --git a/sensor_scan_generation/.clang-format b/sensor_scan_generation/.clang-format new file mode 100644 index 0000000..2f8d64b --- /dev/null +++ b/sensor_scan_generation/.clang-format @@ -0,0 +1,18 @@ +--- +Language: Cpp +BasedOnStyle: Google + +AccessModifierOffset: -2 +AlignAfterOpenBracket: AlwaysBreak +BraceWrapping: + AfterClass: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true +BreakBeforeBraces: Custom +ColumnLimit: 100 +ConstructorInitializerIndentWidth: 0 +ContinuationIndentWidth: 2 +DerivePointerAlignment: false +PointerAlignment: Middle +ReflowComments: false \ No newline at end of file diff --git a/sensor_scan_generation/.clang-tidy b/sensor_scan_generation/.clang-tidy new file mode 100644 index 0000000..d805018 --- /dev/null +++ b/sensor_scan_generation/.clang-tidy @@ -0,0 +1,62 @@ +--- +Checks: '-*, + performance-*, + -performance-unnecessary-value-param, + llvm-namespace-comment, + modernize-redundant-void-arg, + modernize-use-nullptr, + modernize-use-default, + modernize-use-override, + modernize-loop-convert, + modernize-make-shared, + modernize-make-unique, + misc-unused-parameters, + readability-named-parameter, + readability-redundant-smartptr-get, + readability-redundant-string-cstr, + readability-simplify-boolean-expr, + readability-container-size-empty, + readability-identifier-naming, + ' +HeaderFilterRegex: '' +CheckOptions: + - key: llvm-namespace-comment.ShortNamespaceLines + value: '10' + - key: llvm-namespace-comment.SpacesBeforeComments + value: '2' + - key: misc-unused-parameters.StrictMode + value: '1' + - key: readability-braces-around-statements.ShortStatementLines + value: '2' + # type names + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.UnionCase + value: CamelCase + # method names + - key: readability-identifier-naming.MethodCase + value: camelBack + # variable names + - key: readability-identifier-naming.VariableCase + value: lower_case + # class member names + - key: readability-identifier-naming.PrivateMemberCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberSuffix + value: '_' + - key: readability-identifier-naming.ProtectedMemberCase + value: lower_case + - key: readability-identifier-naming.ProtectedMemberSuffix + value: '_' + # const static or global variables are UPPER_CASE + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.StaticConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ClassConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.GlobalVariableCase + value: UPPER_CASE +... diff --git a/sensor_scan_generation/CMakeLists.txt b/sensor_scan_generation/CMakeLists.txt index 61a0b95..857a0d2 100644 --- a/sensor_scan_generation/CMakeLists.txt +++ b/sensor_scan_generation/CMakeLists.txt @@ -29,9 +29,25 @@ ament_auto_add_library(${PROJECT_NAME} SHARED rclcpp_components_register_node(${PROJECT_NAME} PLUGIN sensor_scan_generation::SensorScanGenerationNode - EXECUTABLE sensor_scan_generation_node + EXECUTABLE ${PROJECT_NAME}_node ) +############# +## Testing ## +############# + +if(BUILD_TESTING) +set(ament_cmake_clang_format_CONFIG_FILE "${CMAKE_SOURCE_DIR}/.clang-format") +find_package(ament_lint_auto REQUIRED) + list(APPEND AMENT_LINT_AUTO_EXCLUDE + ament_cmake_copyright + ament_cmake_uncrustify + ament_cmake_cpplint + ament_cmake_flake8 + ) + ament_lint_auto_find_test_dependencies() +endif() + ############# ## Install ## ############# diff --git a/sensor_scan_generation/package.xml b/sensor_scan_generation/package.xml index 4f5c936..af79713 100644 --- a/sensor_scan_generation/package.xml +++ b/sensor_scan_generation/package.xml @@ -2,9 +2,9 @@ sensor_scan_generation 1.0.0 sensor_scan_generation is a package to generate scan data in sensor frame with registered_scan in map frame. - Lihan Chen + Lihan Chen MIT - Lihan Chen + Lihan Chen ament_cmake @@ -22,6 +22,8 @@ ament_lint_auto ament_lint_common + ament_cmake_clang_format + ament_cmake_black ament_cmake diff --git a/small_gicp_relocalization b/small_gicp_relocalization index 079b9e0..b22e877 160000 --- a/small_gicp_relocalization +++ b/small_gicp_relocalization @@ -1 +1 @@ -Subproject commit 079b9e018c83179d4150f4d2adb37a60f7ab49a6 +Subproject commit b22e877119ec68636190d90a8c97d7e4e0eaced2