Skip to content

Commit 2d17d70

Browse files
authored
Fixed instances where mobile_to_maritime API wasn't updated (#320)
* Fixed instances where old m2m api was used * precommit
1 parent 608e987 commit 2d17d70

File tree

6 files changed

+72
-33
lines changed

6 files changed

+72
-33
lines changed

blue_bringup/launch/bluerov2/bluerov2.launch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ launch:
122122
file: $(find-pkg-share blue_bringup)/launch/$(var model_name)/thrusters.launch.yaml
123123

124124
- include:
125-
file: $(find-pkg-share mobile_to_maritime)/launch/tf.launch.yaml
125+
file: $(find-pkg-share message_transforms)/launch/tf.launch.yaml

blue_bringup/launch/bluerov2_heavy/bluerov2_heavy.launch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ launch:
122122
file: $(find-pkg-share blue_bringup)/launch/$(var model_name)/thrusters.launch.yaml
123123

124124
- include:
125-
file: $(find-pkg-share mobile_to_maritime)/launch/tf.launch.yaml
125+
file: $(find-pkg-share message_transforms)/launch/tf.launch.yaml

blue_bringup/launch/bluerov2_heavy_reach/bluerov2_heavy_reach.launch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ launch:
122122
file: $(find-pkg-share blue_bringup)/launch/$(var model_name)/thrusters.launch.yaml
123123

124124
- include:
125-
file: $(find-pkg-share mobile_to_maritime)/launch/tf.launch.yaml
125+
file: $(find-pkg-share message_transforms)/launch/tf.launch.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/control_integration/message_transforms:
2+
ros__parameters:
3+
4+
incoming_topics:
5+
- /mavros/local_position/velocity_body
6+
7+
transforms:
8+
/mavros/local_position/velocity_body:
9+
outgoing_topic: /integral_sliding_mode_controller/system_state
10+
message_type: geometry_msgs/msg/TwistStamped
11+
frame_id: base_link_fsd

blue_demos/control_integration/launch/bluerov2_controllers.launch.py

+29-15
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
# THE SOFTWARE.
2020

2121
from launch import LaunchDescription
22-
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
22+
from launch.actions import (
23+
DeclareLaunchArgument,
24+
IncludeLaunchDescription,
25+
RegisterEventHandler,
26+
)
2327
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
2530
from launch_ros.actions import Node
2631
from launch_ros.substitutions import FindPackageShare
2732

@@ -48,18 +53,27 @@ def generate_launch_description() -> LaunchDescription:
4853
]
4954

5055
# 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(),
6377
)
6478

6579
controller_manager = Node(
@@ -151,7 +165,7 @@ def generate_launch_description() -> LaunchDescription:
151165
return LaunchDescription(
152166
[
153167
*args,
154-
mobile_to_maritime_velocity_state,
168+
message_transformer,
155169
controller_manager,
156170
*delay_thruster_spawners,
157171
delay_tam_controller_spawner_after_thruster_controller_spawners,

blue_demos/control_integration/launch/bluerov2_heavy_controllers.launch.py

+29-15
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
# THE SOFTWARE.
2020

2121
from launch import LaunchDescription
22-
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
22+
from launch.actions import (
23+
DeclareLaunchArgument,
24+
IncludeLaunchDescription,
25+
RegisterEventHandler,
26+
)
2327
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
2530
from launch_ros.actions import Node
2631
from launch_ros.substitutions import FindPackageShare
2732

@@ -47,18 +52,27 @@ def generate_launch_description() -> LaunchDescription:
4752
]
4853

4954
# The ISMC expects state information to be provided in the FSD frame
50-
mobile_to_maritime_velocity_state = Node(
51-
package="mobile_to_maritime",
52-
executable="mobile_twist_stamped_to_maritime_twist",
53-
name="velocity_state_transform",
54-
parameters=[
55-
{
56-
"in_topic": "/mavros/local_position/velocity_body",
57-
"out_topic": "/integral_sliding_mode_controller/system_state",
58-
"qos_reliability": "best_effort",
59-
"qos_durability": "volatile",
60-
}
61-
],
55+
message_transformer = IncludeLaunchDescription(
56+
PythonLaunchDescriptionSource(
57+
PathJoinSubstitution(
58+
[
59+
FindPackageShare("message_transforms"),
60+
"launch",
61+
"message_transforms.launch.py",
62+
]
63+
)
64+
),
65+
launch_arguments={
66+
"parameters_file": PathJoinSubstitution(
67+
[
68+
FindPackageShare("blue_demos"),
69+
"control_integration",
70+
"config",
71+
"transforms.yaml",
72+
]
73+
),
74+
"ns": TextSubstitution(text="control_integration"),
75+
}.items(),
6276
)
6377

6478
controller_manager = Node(
@@ -150,7 +164,7 @@ def generate_launch_description() -> LaunchDescription:
150164
return LaunchDescription(
151165
[
152166
*args,
153-
mobile_to_maritime_velocity_state,
167+
message_transformer,
154168
controller_manager,
155169
*delay_thruster_spawners,
156170
delay_tam_controller_spawner_after_thruster_controller_spawners,

0 commit comments

Comments
 (0)