Skip to content

Commit 18bf203

Browse files
authored
Merge branch 'main' into psdk_ros2_v1.3.0
2 parents dfbcc2c + d39d88b commit 18bf203

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

launch/as2_platform_dji_psdk.launch.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#!/usr/bin/env python3
2-
3-
"""Launch as2_platform_dji_psdk node."""
4-
5-
# Copyright 2023 Universidad Politécnica de Madrid
1+
# Copyright 2024 Universidad Politécnica de Madrid
62
#
73
# Redistribution and use in source and binary forms, with or without
84
# modification, are permitted provided that the following conditions are met:
@@ -30,15 +26,17 @@
3026
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3127
# POSSIBILITY OF SUCH DAMAGE.
3228

33-
__authors__ = 'Rafael Pérez Seguí'
34-
__copyright__ = 'Copyright (c) 2022 Universidad Politécnica de Madrid'
29+
"""Launch as2_platform_dji_psdk node."""
30+
31+
__authors__ = 'Rafael Pérez Seguí, Pedro Arias Pérez'
32+
__copyright__ = 'Copyright (c) 2024 Universidad Politécnica de Madrid'
3533
__license__ = 'BSD-3-Clause'
36-
__version__ = '0.1.0'
3734

3835
import os
3936

4037
from ament_index_python.packages import get_package_share_directory
41-
import as2_core.launch_param_utils as as2_utils
38+
from as2_core.declare_launch_arguments_from_config_file import DeclareLaunchArgumentsFromConfigFile
39+
from as2_core.launch_configuration_from_config_file import LaunchConfigurationFromConfigFile
4240
from launch import LaunchDescription
4341
from launch.actions import DeclareLaunchArgument
4442
from launch.substitutions import EnvironmentVariable, LaunchConfiguration
@@ -58,8 +56,10 @@ def generate_launch_description() -> LaunchDescription:
5856
platform_config_file = os.path.join(package_folder,
5957
'config/platform_config_file.yaml')
6058

61-
control_modes = os.path.join(package_folder,
62-
'config/control_modes.yaml')
59+
control_modes = PathJoinSubstitution([
60+
FindPackageShare('as2_platform_dji_psdk'),
61+
'config', 'control_modes.yaml'
62+
])
6363

6464
return LaunchDescription([
6565
DeclareLaunchArgument('namespace',
@@ -71,9 +71,8 @@ def generate_launch_description() -> LaunchDescription:
7171
DeclareLaunchArgument('control_modes_file',
7272
default_value=control_modes,
7373
description='Platform control modes file'),
74-
*as2_utils.declare_launch_arguments(
75-
'config_file',
76-
default_value=platform_config_file,
74+
DeclareLaunchArgumentsFromConfigFile(
75+
name='config_file', source_file=platform_config_file,
7776
description='Platform configuration file'),
7877
Node(
7978
package='as2_platform_dji_psdk',
@@ -85,11 +84,12 @@ def generate_launch_description() -> LaunchDescription:
8584
arguments=['--ros-args', '--log-level',
8685
LaunchConfiguration('log_level')],
8786
parameters=[
88-
*as2_utils.launch_configuration('config_file',
89-
default_value=platform_config_file),
9087
{
9188
'control_modes_file': LaunchConfiguration('control_modes_file'),
92-
}
89+
},
90+
LaunchConfigurationFromConfigFile(
91+
'config_file',
92+
default_file=platform_config_file),
9393
]
9494
)
9595
])

0 commit comments

Comments
 (0)