Skip to content

Commit

Permalink
🔧 build: Add build and test
Browse files Browse the repository at this point in the history
NOTE: `ament_cmake_clang_tidy` will be added when the PR will be merged.
ros2/rclcpp#2718
  • Loading branch information
LihanChen2004 committed Dec 28, 2024
1 parent 9d17b46 commit e3a25bb
Show file tree
Hide file tree
Showing 18 changed files with 382 additions and 9 deletions.
18 changes: 18 additions & 0 deletions fake_vel_transform/.clang-format
Original file line number Diff line number Diff line change
@@ -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
62 changes: 62 additions & 0 deletions fake_vel_transform/.clang-tidy
Original file line number Diff line number Diff line change
@@ -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
...
5 changes: 4 additions & 1 deletion fake_vel_transform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion fake_vel_transform/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<name>fake_vel_transform</name>
<version>1.0.0</version>
<description>Adapts to NAV2 local path planner when `robot_base_frame` changes drastically.</description>
<maintainer email="lihanchen2004@163.com">Lihan Chen</maintainer>
<license>MIT</license>
<author email="lihanchen2004@163.com">Lihan Chen</author>
<maintainer email="lihanchen2004@163.com">Lihan Chen</maintainer>

<!-- buildtool_depend: dependencies of the build process -->
<buildtool_depend>ament_cmake</buildtool_depend>
Expand All @@ -22,6 +22,7 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>ament_cmake_clang_format</test_depend>
<test_depend>ament_cmake_black</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
18 changes: 18 additions & 0 deletions ign_sim_pointcloud_tool/.clang-format
Original file line number Diff line number Diff line change
@@ -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
62 changes: 62 additions & 0 deletions ign_sim_pointcloud_tool/.clang-tidy
Original file line number Diff line number Diff line change
@@ -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
...
18 changes: 17 additions & 1 deletion ign_sim_pointcloud_tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
#############
Expand Down
18 changes: 18 additions & 0 deletions loam_interface/.clang-format
Original file line number Diff line number Diff line change
@@ -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
62 changes: 62 additions & 0 deletions loam_interface/.clang-tidy
Original file line number Diff line number Diff line change
@@ -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
...
14 changes: 13 additions & 1 deletion loam_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
#############
Expand Down
2 changes: 2 additions & 0 deletions loam_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>ament_cmake_clang_format</test_depend>
<test_depend>ament_cmake_black</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
2 changes: 1 addition & 1 deletion pb2025_nav_bringup/launch/rm_sentry_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions pb2025_nav_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<description>pb2025_nav_bringup</description>
<maintainer email="lihanchen2004@163.com">Lihan Chen</maintainer>
<license>MIT</license>
<author email="lihanchen2004@163.com">Lihan Chen</author>

<buildtool_depend>ament_cmake</buildtool_depend>

Expand Down
18 changes: 18 additions & 0 deletions sensor_scan_generation/.clang-format
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit e3a25bb

Please sign in to comment.