Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed instances where mobile_to_maritime API wasn't updated (backport #320) #323

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blue_bringup/launch/bluerov2/bluerov2.launch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ launch:
file: $(find-pkg-share blue_bringup)/launch/$(var model_name)/thrusters.launch.yaml

- include:
file: $(find-pkg-share mobile_to_maritime)/launch/tf.launch.yaml
file: $(find-pkg-share message_transforms)/launch/tf.launch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ launch:
file: $(find-pkg-share blue_bringup)/launch/$(var model_name)/thrusters.launch.yaml

- include:
file: $(find-pkg-share mobile_to_maritime)/launch/tf.launch.yaml
file: $(find-pkg-share message_transforms)/launch/tf.launch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ launch:
file: $(find-pkg-share blue_bringup)/launch/$(var model_name)/thrusters.launch.yaml

- include:
file: $(find-pkg-share mobile_to_maritime)/launch/tf.launch.yaml
file: $(find-pkg-share message_transforms)/launch/tf.launch.yaml
11 changes: 11 additions & 0 deletions blue_demos/control_integration/config/transforms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/control_integration/message_transforms:
ros__parameters:

incoming_topics:
- /mavros/local_position/velocity_body

transforms:
/mavros/local_position/velocity_body:
outgoing_topic: /integral_sliding_mode_controller/system_state
message_type: geometry_msgs/msg/TwistStamped
frame_id: base_link_fsd
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
# THE SOFTWARE.

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
from launch.actions import (
DeclareLaunchArgument,
IncludeLaunchDescription,
RegisterEventHandler,
)
from launch.event_handlers import OnProcessExit
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution, TextSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare

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

# The ISMC expects state information to be provided in the FSD frame
mobile_to_maritime_velocity_state = Node(
package="mobile_to_maritime",
executable="mobile_twist_stamped_to_maritime_twist",
name="velocity_state_transform",
parameters=[
{
"in_topic": "/mavros/local_position/velocity_body",
"out_topic": "/integral_sliding_mode_controller/system_state",
"qos_reliability": "best_effort",
"qos_durability": "volatile",
}
],
message_transformer = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[
FindPackageShare("message_transforms"),
"launch",
"message_transforms.launch.py",
]
)
),
launch_arguments={
"parameters_file": PathJoinSubstitution(
[
FindPackageShare("blue_demos"),
"control_integration",
"config",
"transforms.yaml",
]
),
"ns": TextSubstitution(text="control_integration"),
}.items(),
)

controller_manager = Node(
Expand Down Expand Up @@ -151,7 +165,7 @@ def generate_launch_description() -> LaunchDescription:
return LaunchDescription(
[
*args,
mobile_to_maritime_velocity_state,
message_transformer,
controller_manager,
*delay_thruster_spawners,
delay_tam_controller_spawner_after_thruster_controller_spawners,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
# THE SOFTWARE.

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
from launch.actions import (
DeclareLaunchArgument,
IncludeLaunchDescription,
RegisterEventHandler,
)
from launch.event_handlers import OnProcessExit
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution, TextSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare

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

# The ISMC expects state information to be provided in the FSD frame
mobile_to_maritime_velocity_state = Node(
package="mobile_to_maritime",
executable="mobile_twist_stamped_to_maritime_twist",
name="velocity_state_transform",
parameters=[
{
"in_topic": "/mavros/local_position/velocity_body",
"out_topic": "/integral_sliding_mode_controller/system_state",
"qos_reliability": "best_effort",
"qos_durability": "volatile",
}
],
message_transformer = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[
FindPackageShare("message_transforms"),
"launch",
"message_transforms.launch.py",
]
)
),
launch_arguments={
"parameters_file": PathJoinSubstitution(
[
FindPackageShare("blue_demos"),
"control_integration",
"config",
"transforms.yaml",
]
),
"ns": TextSubstitution(text="control_integration"),
}.items(),
)

controller_manager = Node(
Expand Down Expand Up @@ -150,7 +164,7 @@ def generate_launch_description() -> LaunchDescription:
return LaunchDescription(
[
*args,
mobile_to_maritime_velocity_state,
message_transformer,
controller_manager,
*delay_thruster_spawners,
delay_tam_controller_spawner_after_thruster_controller_spawners,
Expand Down