14
14
15
15
from launch import LaunchDescription
16
16
from launch .actions import DeclareLaunchArgument , IncludeLaunchDescription
17
- from launch .substitutions import LaunchConfiguration , PathJoinSubstitution , PythonExpression
17
+ from launch .substitutions import LaunchConfiguration , PathJoinSubstitution
18
18
from launch .launch_description_sources import PythonLaunchDescriptionSource
19
19
from launch_ros .actions import Node
20
20
from launch_ros .substitutions import FindPackageShare
21
21
from launch .conditions import IfCondition , UnlessCondition
22
22
23
23
24
24
def generate_launch_description ():
25
- sensors_launch_path = PathJoinSubstitution (
26
- [FindPackageShare ('linorobot2_bringup' ), 'launch' , 'sensors.launch.py' ]
27
- )
28
-
29
25
joy_launch_path = PathJoinSubstitution (
30
26
[FindPackageShare ('linorobot2_bringup' ), 'launch' , 'joy_teleop.launch.py' ]
31
27
)
32
28
33
- description_launch_path = PathJoinSubstitution (
34
- [FindPackageShare ('linorobot2_description' ), 'launch' , 'description.launch.py' ]
35
- )
36
-
37
29
ekf_config_path = PathJoinSubstitution (
38
30
[FindPackageShare ("linorobot2_base" ), "config" , "ekf.yaml" ]
39
31
)
@@ -52,31 +44,31 @@ def generate_launch_description():
52
44
53
45
return LaunchDescription ([
54
46
DeclareLaunchArgument (
55
- name = 'custom_robot' ,
47
+ name = 'custom_robot' ,
56
48
default_value = 'false' ,
57
49
description = 'Use custom robot'
58
50
),
59
51
60
52
DeclareLaunchArgument (
61
- name = 'extra' ,
53
+ name = 'extra' ,
62
54
default_value = 'false' ,
63
55
description = 'Launch extra launch file'
64
56
),
65
57
66
58
DeclareLaunchArgument (
67
- name = 'base_serial_port' ,
59
+ name = 'base_serial_port' ,
68
60
default_value = '/dev/ttyACM0' ,
69
61
description = 'Linorobot Base Serial Port'
70
62
),
71
63
72
64
DeclareLaunchArgument (
73
- name = 'odom_topic' ,
65
+ name = 'odom_topic' ,
74
66
default_value = '/odom' ,
75
67
description = 'EKF out odometry topic'
76
68
),
77
-
69
+
78
70
DeclareLaunchArgument (
79
- name = 'joy' ,
71
+ name = 'joy' ,
80
72
default_value = 'false' ,
81
73
description = 'Use Joystick'
82
74
),
@@ -108,5 +100,10 @@ def generate_launch_description():
108
100
IncludeLaunchDescription (
109
101
PythonLaunchDescriptionSource (custom_robot_launch_path ),
110
102
condition = IfCondition (LaunchConfiguration ("custom_robot" )),
111
- )
103
+ ),
104
+
105
+ IncludeLaunchDescription (
106
+ PythonLaunchDescriptionSource (joy_launch_path ),
107
+ condition = IfCondition (LaunchConfiguration ("joy" )),
108
+ ),
112
109
])
0 commit comments