From fe324744e59eed52b2bb11f577418089c90c865a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garc=C3=ADa?= Date: Tue, 29 Oct 2024 15:47:30 +0100 Subject: [PATCH 1/2] Modified launcher to comply with autoflake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alberto García --- .../mocap_marker_viz/launch/mocap_marker_viz.launch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py b/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py index 2e6ea5a..0620d17 100644 --- a/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py +++ b/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py @@ -16,10 +16,11 @@ from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -from launch_ros.actions import Node from launch.actions import DeclareLaunchArgument -from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node from launch.conditions import UnlessCondition +from launch.substitutions import LaunchConfiguration + def generate_launch_description(): From fb912a8f54595d98dca5a0bada8b8e77e27cbaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garc=C3=ADa?= Date: Wed, 30 Oct 2024 10:24:22 +0100 Subject: [PATCH 2/2] Modified launcher to comply with flake8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alberto García --- .../launch/mocap_marker_viz.launch.py | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py b/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py index 0620d17..4581d77 100644 --- a/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py +++ b/mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py @@ -1,6 +1,7 @@ # Copyright (c) 2023 José Miguel Guerrero Hernández # -# Licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License; +# Licensed under the Attribution-ShareAlike 4.0 International +# (CC BY-SA 4.0) License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # @@ -12,19 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Launch file for mocap_marker_viz.""" + import os from ament_index_python.packages import get_package_share_directory + from launch import LaunchDescription from launch.actions import DeclareLaunchArgument -from launch_ros.actions import Node from launch.conditions import UnlessCondition from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - + """Generate launch description for mocap_marker_viz.""" mocap_marker_viz_dir = get_package_share_directory('mocap_marker_viz') rviz_config_file = LaunchConfiguration('rviz_config_file') use_namespace = LaunchConfiguration('use_namespace') @@ -33,30 +37,36 @@ def generate_launch_description(): declare_mocap_system = DeclareLaunchArgument( 'mocap_system', default_value='optitrack', - description='') + description='' + ) declare_rviz_config_file_cmd = DeclareLaunchArgument( 'rviz_config_file', default_value=os.path.join( - mocap_marker_viz_dir, 'rviz', 'config.rviz'), - description='Full path to the RVIZ config file to use') + mocap_marker_viz_dir, 'rviz', 'config.rviz' + ), + description='Full path to the RVIZ config file to use' + ) declare_use_namespace_cmd = DeclareLaunchArgument( 'use_namespace', default_value='false', - description='Whether to apply a namespace to the navigation stack') + description='Whether to apply a namespace to the navigation stack' + ) declare_use_rviz_cmd = DeclareLaunchArgument( 'use_rviz', default_value='True', - description='Whether to start RVIZ') + description='Whether to start RVIZ' + ) start_rviz_cmd = Node( condition=UnlessCondition(use_namespace), package='rviz2', executable='rviz2', arguments=['-d', rviz_config_file], - output='screen') + output='screen' + ) start_mocap_marker_rviz = Node( package='mocap_marker_viz', @@ -70,8 +80,6 @@ def generate_launch_description(): ld = LaunchDescription() # Declare the launch options - ld.add_action(declare_rviz_config_file_cmd) - ld.add_action(declare_rviz_config_file_cmd) ld.add_action(declare_use_namespace_cmd) ld.add_action(declare_mocap_system)