Skip to content

Commit df68589

Browse files
committed
Allow to launch the joy launchfile
1 parent ddd2ced commit df68589

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

linorobot2_bringup/launch/bringup.launch.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,18 @@
1414

1515
from launch import LaunchDescription
1616
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
17-
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression
17+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
1818
from launch.launch_description_sources import PythonLaunchDescriptionSource
1919
from launch_ros.actions import Node
2020
from launch_ros.substitutions import FindPackageShare
2121
from launch.conditions import IfCondition, UnlessCondition
2222

2323

2424
def generate_launch_description():
25-
sensors_launch_path = PathJoinSubstitution(
26-
[FindPackageShare('linorobot2_bringup'), 'launch', 'sensors.launch.py']
27-
)
28-
2925
joy_launch_path = PathJoinSubstitution(
3026
[FindPackageShare('linorobot2_bringup'), 'launch', 'joy_teleop.launch.py']
3127
)
3228

33-
description_launch_path = PathJoinSubstitution(
34-
[FindPackageShare('linorobot2_description'), 'launch', 'description.launch.py']
35-
)
36-
3729
ekf_config_path = PathJoinSubstitution(
3830
[FindPackageShare("linorobot2_base"), "config", "ekf.yaml"]
3931
)
@@ -52,31 +44,31 @@ def generate_launch_description():
5244

5345
return LaunchDescription([
5446
DeclareLaunchArgument(
55-
name='custom_robot',
47+
name='custom_robot',
5648
default_value='false',
5749
description='Use custom robot'
5850
),
5951

6052
DeclareLaunchArgument(
61-
name='extra',
53+
name='extra',
6254
default_value='false',
6355
description='Launch extra launch file'
6456
),
6557

6658
DeclareLaunchArgument(
67-
name='base_serial_port',
59+
name='base_serial_port',
6860
default_value='/dev/ttyACM0',
6961
description='Linorobot Base Serial Port'
7062
),
7163

7264
DeclareLaunchArgument(
73-
name='odom_topic',
65+
name='odom_topic',
7466
default_value='/odom',
7567
description='EKF out odometry topic'
7668
),
77-
69+
7870
DeclareLaunchArgument(
79-
name='joy',
71+
name='joy',
8072
default_value='false',
8173
description='Use Joystick'
8274
),
@@ -108,5 +100,10 @@ def generate_launch_description():
108100
IncludeLaunchDescription(
109101
PythonLaunchDescriptionSource(custom_robot_launch_path),
110102
condition=IfCondition(LaunchConfiguration("custom_robot")),
111-
)
103+
),
104+
105+
IncludeLaunchDescription(
106+
PythonLaunchDescriptionSource(joy_launch_path),
107+
condition=IfCondition(LaunchConfiguration("joy")),
108+
),
112109
])

0 commit comments

Comments
 (0)