Skip to content

Commit

Permalink
fixed launch file bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjord committed Feb 25, 2024
1 parent 36e85c0 commit 438ebbe
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/rktl_autonomy/launch/rocket_league_train.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def generate_launch_description():
sim_mode_launch_arg,
rate_launch_arg,
agent_type_launch_arg,
plot_log_info,
# plot_log_info,
agent_node,
sim_launch,
plotter_node
# plotter_node
])
2 changes: 1 addition & 1 deletion src/rktl_control/launch/hardware_interface.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def generate_launch_description():
name='hardware_interface',
parameters=[
{
launch.substitutions.PathJoinSubstitution(launch_ros.substitutions.FindPackageShare('rktl_control'), '/config/hardware_interface.yaml')
launch.substitutions.PathJoinSubstitution([launch_ros.substitutions.FindPackageShare('rktl_control'), '/config/hardware_interface.yaml'])
}
]
)
Expand Down
2 changes: 1 addition & 1 deletion src/rktl_control/launch/keyboard_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def generate_launch_description():
default_value='car0'
),
launch_ros.actions.Node(
namespace=launch.substitutions.PathJoinSubstitution('cars/', launch_ros.substitutions.FindPackageShare('car_name')),
namespace=launch.substitutions.PathJoinSubstitution(['cars/', launch_ros.substitutions.FindPackageShare('car_name')]),
package='rktl_control',
executable='keyboard_interface',
name='keyboard_interface',
Expand Down
5 changes: 3 additions & 2 deletions src/rktl_launch/launch/c3po.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

import launch
import launch_ros.actions
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory


def generate_launch_description():
ld = launch.LaunchDescription([
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_perception'), 'launch/camera.launch.py')
),
Expand All @@ -18,7 +19,7 @@ def generate_launch_description():
}.items()
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_perception'), 'launch/camera.launch.py')
),
Expand Down
7 changes: 4 additions & 3 deletions src/rktl_launch/launch/r2d2.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys

import launch
from launch.launch_description_sources import PythonLaunchDescriptionSource
import launch_ros.actions
from ament_index_python.packages import get_package_share_directory

Expand All @@ -18,7 +19,7 @@ def generate_launch_description():
]
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_perception'), 'launch/camera.launch.py')
),
Expand All @@ -27,7 +28,7 @@ def generate_launch_description():
}.items()
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_perception'), 'launch/camera.launch.py')
),
Expand All @@ -36,7 +37,7 @@ def generate_launch_description():
}.items()
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_launch'), 'launch/rocket_league.launch.py')
)
Expand Down
27 changes: 15 additions & 12 deletions src/rktl_launch/launch/rocket_league.launch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os

import launch
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, EqualsSubstitution
from launch.conditions import IfCondition
import launch_ros.actions
from ament_index_python.packages import get_package_share_directory

Expand Down Expand Up @@ -31,26 +34,26 @@ def generate_launch_description():
'rktl_launch'), 'config', 'global_params.yaml')
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_sim'), 'launch/visualizer.launch.py')
),
condition=launch.conditions.LaunchConfigurationEquals('render', 'true')
condition=IfCondition(EqualsSubstitution(LaunchConfiguration('render'), 'true'))
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_game'), 'launch/game.launch.py')
)
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_control'), 'launch/ball.launch.py')
)
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_control'), 'launch/car.launch.py')
),
Expand All @@ -59,41 +62,41 @@ def generate_launch_description():
}.items()
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_control'), 'launch/hardware_interface.launch.py')
)
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_planner'), 'launch/simple_agent.launch.py')
),
launch_arguments={
'agent_name': 'agent0',
'car_name': 'car0'
}.items(),
condition=launch.conditions.LaunchConfigurationEquals('agent_type', 'planner')
condition=IfCondition(EqualsSubstitution(LaunchConfiguration('agent_type'), 'planner'))
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_autonomy'), 'launch/rocket_league/rocket_league_agent.launch.py')
),
launch_arguments={
'weights_name': launch.substitutions.LaunchConfiguration('autonomy_weights')
}.items(),
condition=launch.conditions.LaunchConfigurationEquals('agent_type', 'autonomy')
condition=IfCondition(EqualsSubstitution(LaunchConfiguration('agent_type'), 'autonomy'))
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_planner'), 'launch/patrol_agent.launch.py')
),
launch_arguments={
'car_name': 'car0'
}.items(),
condition=launch.conditions.LaunchConfigurationEquals('agent_type', 'patrol')
condition=IfCondition(EqualsSubstitution(LaunchConfiguration('agent_type'), 'patrol'))
)
])
return ld
Expand Down
4 changes: 3 additions & 1 deletion src/rktl_launch/launch/rocket_league_sim.launch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import launch
import launch_ros.actions
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, EqualsSubstitution
from ament_index_python.packages import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource

Expand Down Expand Up @@ -45,7 +47,7 @@ def generate_launch_description():
value="Ground Truth",
)
],
condition=launch.conditions.LaunchConfigurationEquals('sim_mode', 'realistic')
condition=IfCondition(EqualsSubstitution(LaunchConfiguration('sim_mode'), 'realistic'))
),
launch.actions.IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down

0 comments on commit 438ebbe

Please sign in to comment.