Skip to content

Commit

Permalink
fixed filepath errors in launch files
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjord committed Feb 25, 2024
1 parent d8299fa commit b8f8769
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from launch_ros.actions import Node
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare

def generate_launch_description():
plot_log_launch_arg = DeclareLaunchArgument(
Expand Down Expand Up @@ -63,14 +65,15 @@ def generate_launch_description():
namespace=LaunchConfiguration('agent_name')
)

sim_path = PathJoinSubstitution([FindPackageShare('rktl_launch'), 'launch', 'rocket_league_sim.launch.py'])
sim_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(['src/rktl_launch/launch/rocket_league_sim.launch.py']), # TODO: Replace with the path to the launch file
launch_arguments={
'render': LaunchConfiguration('render'),
'sim_mode': LaunchConfiguration('sim_mode'),
'agent_type': LaunchConfiguration('agent_type'),
}.items(),
)
PythonLaunchDescriptionSource([sim_path]), # TODO: Replace with the path to the launch file
launch_arguments={
'render': LaunchConfiguration('render'),
'sim_mode': LaunchConfiguration('sim_mode'),
'agent_type': LaunchConfiguration('agent_type'),
}.items(),
)

plotter_node = Node(
condition=IfCondition(LaunchConfiguration('plot_log')),
Expand Down
5 changes: 2 additions & 3 deletions src/rktl_game/launch/game.launch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
import sys

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


Expand All @@ -15,7 +14,7 @@ def generate_launch_description():
output='screen'
),
launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rosbridge_server'), 'launch/rosbridge_websocket.launch.py')
)
Expand Down
2 changes: 1 addition & 1 deletion src/rktl_launch/launch/rocket_league_sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def generate_launch_description():
launch.actions.IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'rktl_autonomy'), 'launch/rocket_league/rocket_league_agent.launch.py')
'rktl_autonomy'), 'launch/rocket_league_agent.launch.py')
),
launch_arguments={
'weights_name': launch.substitutions.LaunchConfiguration('autonomy_weights')
Expand Down
4 changes: 3 additions & 1 deletion src/rktl_planner/launch/patrol_agent.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

import launch
import launch_ros.actions
from launch.substitutions import PathJoinSubstitution
from ament_index_python.packages import get_package_share_directory



def generate_launch_description():
ld = launch.LaunchDescription([
launch.actions.DeclareLaunchArgument(
Expand All @@ -14,7 +16,7 @@ def generate_launch_description():
),
launch_ros.actions.Node(
package='rktl_planner',
namespace="cars/"+launch.substitutions.LaunchConfiguration("car_name"),
namespace=PathJoinSubstitution(["cars/", launch.substitutions.LaunchConfiguration("car_name")]),
executable='patrol_planner',
name='patrol_planner',
output='screen',
Expand Down
4 changes: 2 additions & 2 deletions src/rktl_planner/launch/simple_agent.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def generate_launch_description():
output="screen",
parameters=[
{
launch.substitutions.PathJoinSubstitution(launch_ros.substitutions.FindPackageShare('rktl_planner'), '/config/path_follower.yaml')
launch.substitutions.PathJoinSubstitution([launch_ros.substitutions.FindPackageShare('rktl_planner'), '/config/path_follower.yaml'])
},
{
"car_name": launch.substitutions.LaunchConfiguration("car_name")
Expand All @@ -44,7 +44,7 @@ def generate_launch_description():
output="screen",
parameters=[
{
launch.substitutions.PathJoinSubstitution(launch_ros.substitutions.FindPackageShare('rktl_planner'), '/config/path_planner.yaml')
launch.substitutions.PathJoinSubstitution([launch_ros.substitutions.FindPackageShare('rktl_planner'), '/config/path_planner.yaml'])
},
{
"car_name": launch.substitutions.LaunchConfiguration("car_name")
Expand Down

0 comments on commit b8f8769

Please sign in to comment.