19
19
# THE SOFTWARE.
20
20
21
21
from launch import LaunchDescription
22
- from launch .actions import DeclareLaunchArgument , RegisterEventHandler
22
+ from launch .actions import (
23
+ DeclareLaunchArgument ,
24
+ IncludeLaunchDescription ,
25
+ RegisterEventHandler ,
26
+ )
23
27
from launch .event_handlers import OnProcessExit
24
- from launch .substitutions import PathJoinSubstitution
28
+ from launch .launch_description_sources import PythonLaunchDescriptionSource
29
+ from launch .substitutions import PathJoinSubstitution , TextSubstitution
25
30
from launch_ros .actions import Node
26
31
from launch_ros .substitutions import FindPackageShare
27
32
@@ -48,18 +53,27 @@ def generate_launch_description() -> LaunchDescription:
48
53
]
49
54
50
55
# The ISMC expects state information to be provided in the FSD frame
51
- mobile_to_maritime_velocity_state = Node (
52
- package = "mobile_to_maritime" ,
53
- executable = "mobile_twist_stamped_to_maritime_twist" ,
54
- name = "velocity_state_transform" ,
55
- parameters = [
56
- {
57
- "in_topic" : "/mavros/local_position/velocity_body" ,
58
- "out_topic" : "/integral_sliding_mode_controller/system_state" ,
59
- "qos_reliability" : "best_effort" ,
60
- "qos_durability" : "volatile" ,
61
- }
62
- ],
56
+ message_transformer = IncludeLaunchDescription (
57
+ PythonLaunchDescriptionSource (
58
+ PathJoinSubstitution (
59
+ [
60
+ FindPackageShare ("message_transforms" ),
61
+ "launch" ,
62
+ "message_transforms.launch.py" ,
63
+ ]
64
+ )
65
+ ),
66
+ launch_arguments = {
67
+ "parameters_file" : PathJoinSubstitution (
68
+ [
69
+ FindPackageShare ("blue_demos" ),
70
+ "control_integration" ,
71
+ "config" ,
72
+ "transforms.yaml" ,
73
+ ]
74
+ ),
75
+ "ns" : TextSubstitution (text = "control_integration" ),
76
+ }.items (),
63
77
)
64
78
65
79
controller_manager = Node (
@@ -151,7 +165,7 @@ def generate_launch_description() -> LaunchDescription:
151
165
return LaunchDescription (
152
166
[
153
167
* args ,
154
- mobile_to_maritime_velocity_state ,
168
+ message_transformer ,
155
169
controller_manager ,
156
170
* delay_thruster_spawners ,
157
171
delay_tam_controller_spawner_after_thruster_controller_spawners ,
0 commit comments