Skip to content

Commit 85803e7

Browse files
committed
Fix launcher using as2 utils
1 parent ace9609 commit 85803e7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Diff for: launch/as2_platform_dji_psdk.launch.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
from as2_core.launch_configuration_from_config_file import LaunchConfigurationFromConfigFile
4040
from launch import LaunchDescription
4141
from launch.actions import DeclareLaunchArgument
42-
from launch.substitutions import EnvironmentVariable, LaunchConfiguration
42+
from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution
4343
from launch_ros.actions import Node
44+
from launch_ros.substitutions import FindPackageShare
4445

4546

4647
def generate_launch_description() -> LaunchDescription:
@@ -52,10 +53,8 @@ def generate_launch_description() -> LaunchDescription:
5253
"""
5354
# Get default platform configuration file
5455
package_folder = get_package_share_directory('as2_platform_dji_psdk')
55-
5656
platform_config_file = os.path.join(package_folder,
5757
'config/platform_config_file.yaml')
58-
5958
control_modes = PathJoinSubstitution([
6059
FindPackageShare('as2_platform_dji_psdk'),
6160
'config', 'control_modes.yaml'

Diff for: launch/psdk_wrapper.launch.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
import os
3939

4040
from ament_index_python.packages import get_package_share_directory
41-
import as2_core.launch_param_utils as as2_utils
41+
from as2_core.declare_launch_arguments_from_config_file import DeclareLaunchArgumentsFromConfigFile
42+
from as2_core.launch_configuration_from_config_file import LaunchConfigurationFromConfigFile
4243
import launch
4344
from launch import LaunchDescription
4445
from launch.actions import DeclareLaunchArgument, EmitEvent
@@ -79,13 +80,14 @@ def generate_launch_description() -> LaunchDescription:
7980
output='screen',
8081
emulate_tty=True,
8182
parameters=[
82-
*as2_utils.launch_configuration('psdk_params_file',
83-
default_value=psdk_params_file),
8483
{
8584
'link_config_file_path': LaunchConfiguration('link_config_file_path'),
8685
'hms_return_codes_path': LaunchConfiguration('hms_return_codes_path'),
8786
},
8887
LaunchConfiguration('psdk_authentication_params_file'),
88+
LaunchConfigurationFromConfigFile(
89+
'psdk_params_file',
90+
default_file=psdk_params_file),
8991
],
9092
remappings=[
9193
('psdk_ros2/gps_position_fused', 'sensor_measurements/gps'),
@@ -126,9 +128,9 @@ def generate_launch_description() -> LaunchDescription:
126128
DeclareLaunchArgument('hms_return_codes_path',
127129
default_value=hms_return_codes_file,
128130
description='Path to JSON file with known DJI return codes'),
129-
*as2_utils.declare_launch_arguments(
130-
'psdk_params_file',
131-
default_value=psdk_params_file,
131+
DeclareLaunchArgumentsFromConfigFile(
132+
name='psdk_params_file',
133+
source_file=psdk_params_file,
132134
description='Paremeters for DJI PSDK authentication'),
133135
])
134136

0 commit comments

Comments
 (0)