From 349043aafcbb4c6c2a1f385c74c016fd9b1746af Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:39:31 -0700 Subject: [PATCH] Integrate latest mobile_to_maritime API (#316) (#319) * Added message transforms * Fixed launch file * cleanup launch file (cherry picked from commit 608e987f1f66d4ed998a55887774ed2dcd7f9e3b) Co-authored-by: Evan Palmer --- .../teleoperation/config/joy_teleop.yaml | 2 +- .../teleoperation/config/transforms.yaml | 10 ++++++++++ .../launch/joy_teleop.launch.yaml | 18 +++++++----------- docs/docs/tutorials/teleop.mdx | 11 +++++++++-- 4 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 blue_demos/teleoperation/config/transforms.yaml diff --git a/blue_demos/teleoperation/config/joy_teleop.yaml b/blue_demos/teleoperation/config/joy_teleop.yaml index c1d3dd7a..aa19c8b6 100644 --- a/blue_demos/teleoperation/config/joy_teleop.yaml +++ b/blue_demos/teleoperation/config/joy_teleop.yaml @@ -8,7 +8,7 @@ joy_teleop: manual_control: type: topic interface_type: geometry_msgs/msg/Twist - topic_name: cmd_vel + topic_name: /cmd_vel deadman_axes: [2] axis_mappings: linear-x: diff --git a/blue_demos/teleoperation/config/transforms.yaml b/blue_demos/teleoperation/config/transforms.yaml new file mode 100644 index 00000000..00c04540 --- /dev/null +++ b/blue_demos/teleoperation/config/transforms.yaml @@ -0,0 +1,10 @@ +message_transforms: + ros__parameters: + + incoming_topics: + - /cmd_vel + + transforms: + /cmd_vel: + outgoing_topic: /integral_sliding_mode_controller/reference + message_type: geometry_msgs/msg/Twist diff --git a/blue_demos/teleoperation/launch/joy_teleop.launch.yaml b/blue_demos/teleoperation/launch/joy_teleop.launch.yaml index 34598461..966f3620 100644 --- a/blue_demos/teleoperation/launch/joy_teleop.launch.yaml +++ b/blue_demos/teleoperation/launch/joy_teleop.launch.yaml @@ -5,8 +5,8 @@ launch: default: $(find-pkg-share blue_demos)/teleoperation/config/joy_teleop.yaml - arg: - name: use_maritime - default: "true" + name: transforms_file + default: $(find-pkg-share blue_demos)/teleoperation/config/transforms.yaml - node: pkg: joy_linux @@ -22,12 +22,8 @@ launch: param: - from: $(var joy_file) - - node: - pkg: mobile_to_maritime - exec: mobile_twist_to_maritime_twist - param: - - name: in_topic - value: cmd_vel - - name: out_topic - value: /integral_sliding_mode_controller/reference - if: $(var use_maritime) + - include: + file: $(find-pkg-share message_transforms)/launch/message_transforms.launch.py + arg: + - name: parameters_file + value: $(var transforms_file) diff --git a/docs/docs/tutorials/teleop.mdx b/docs/docs/tutorials/teleop.mdx index f2e1796a..6e468a91 100644 --- a/docs/docs/tutorials/teleop.mdx +++ b/docs/docs/tutorials/teleop.mdx @@ -51,10 +51,17 @@ Docker as described in the [installation instructions](/installation). [REP-105](https://ros.org/reps/rep-0105.html); however, the launched ISMC adheres to the maritime conventions recorded in [REP-156](https://github.com/ros-infrastructure/rep/pull/398). To convert the velocity commands to the appropriate convention, run the - following `mobile_to_maritime` message filter in a new terminal: + `message_transforms` node in a new terminal: ```bash - ros2 run mobile_to_maritime mobile_twist_to_maritime_twist --ros-args -p in_topic:=/cmd_vel -p out_topic:=/integral_sliding_mode_controller/reference + ros2 launch message_transforms message_transforms.launch.py parameters_file:= + ``` + + where `` should be replaced with the path to the + `transforms.yaml` file in the `blue_demos` package, e.g., + + ```bash + ros2 launch message_transforms message_transforms.launch.py parameters_file:=./blue_demos/teleoperation/config/transforms.yaml ``` 5. You should now be able to teleoperate the BlueROV2 using your keyboard.