Skip to content

Commit

Permalink
Integrate latest mobile_to_maritime API (#316) (#317)
Browse files Browse the repository at this point in the history
* Added message transforms

* Fixed launch file

* cleanup launch file

(cherry picked from commit 608e987)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
  • Loading branch information
mergify[bot] and evan-palmer authored Sep 24, 2024
1 parent 4a64479 commit 8772c8a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion blue_demos/teleoperation/config/joy_teleop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions blue_demos/teleoperation/config/transforms.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 7 additions & 11 deletions blue_demos/teleoperation/launch/joy_teleop.launch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
11 changes: 9 additions & 2 deletions docs/docs/tutorials/teleop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:=<path/to/transforms.yaml>
```

where `<path/to/transforms.yaml>` 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.
Expand Down

0 comments on commit 8772c8a

Please sign in to comment.