Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style modified to comply with Flake8 #13

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions mocap_marker_viz/mocap_marker_viz/launch/mocap_marker_viz.launch.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand All @@ -12,18 +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_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
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')
Expand All @@ -32,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',
Expand All @@ -69,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)
Expand Down
Loading