Skip to content

Commit

Permalink
Merge pull request #46 from christianrauch/linting
Browse files Browse the repository at this point in the history
linting
  • Loading branch information
christianrauch authored May 25, 2024
2 parents 88bdca9 + f317bb1 commit 0accf50
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = Q000, D100
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ install(DIRECTORY

if(BUILD_TESTING)
set(ament_cmake_clang_format_CONFIG_FILE "${CMAKE_SOURCE_DIR}/.clang-format")
set(ament_cmake_flake8_CONFIG_FILE "${CMAKE_SOURCE_DIR}/.flake8")
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
Expand Down
55 changes: 32 additions & 23 deletions launch/camera.launch.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
import launch

from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode


def generate_launch_description():
def generate_launch_description() -> launch.LaunchDescription:
"""
Generate a launch description with for the camera node and a visualiser.
Returns
-------
launch.LaunchDescription: the launch description
"""
container = ComposableNodeContainer(
name='camera_container',
namespace='',
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
ComposableNode(
package='camera_ros',
plugin='camera::CameraNode',
parameters=[{
"camera": 0,
"width": 640,
"height": 480,
}],
extra_arguments=[{'use_intra_process_comms': True}],
),
ComposableNode(
package='image_view',
plugin='image_view::ImageViewNode',
remappings=[('/image', '/camera/image_raw')],
extra_arguments=[{'use_intra_process_comms': True}],
),
],
name='camera_container',
namespace='',
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
ComposableNode(
package='camera_ros',
plugin='camera::CameraNode',
parameters=[{
"camera": 0,
"width": 640,
"height": 480,
}],
extra_arguments=[{'use_intra_process_comms': True}],
),
ComposableNode(
package='image_view',
plugin='image_view::ImageViewNode',
remappings=[('/image', '/camera/image_raw')],
extra_arguments=[{'use_intra_process_comms': True}],
),
],
)

return launch.LaunchDescription([container])
6 changes: 6 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_cmake_clang_format</test_depend>
<test_depend>ament_cmake_cppcheck</test_depend>
<test_depend>ament_cmake_flake8</test_depend>
<test_depend>ament_cmake_lint_cmake</test_depend>
<test_depend>ament_cmake_mypy</test_depend>
<test_depend>ament_cmake_pep257</test_depend>
<test_depend>ament_cmake_pyflakes</test_depend>
<test_depend>ament_cmake_xmllint</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down

0 comments on commit 0accf50

Please sign in to comment.