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

Update moving robot tutorial for ionic #499

Merged
merged 1 commit into from
Sep 4, 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
23 changes: 21 additions & 2 deletions ionic/moving_robot.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,26 @@ The last command will display all messages sent on `/keyboard/keypress` topic.

In the Gazebo window press different keys and you should see data (numbers) on the terminal where you run the `gz topic -e -t /keyboard/keypress` command.

![KeyPublisher](tutorials/moving_robot/keypublisher_data.png)
```
$ gz topic -e -t /keyboard/keypress
data: 68

data: 85

data: 72

data: 74

data: 81

data: 16777235

data: 16777234

data: 16777237

data: 16777236
```

We want to map these keystrokes into messages of type `Twist` and publish them to the `/cmd_vel` topic which our model listens to.
The `TriggeredPublisher` plugin will do this.
Expand Down Expand Up @@ -116,7 +135,7 @@ It accepts messages of type `gz.msgs.Int32` on the `/keyboard/keypress` topic an

Now launch `building_robot.sdf` then add the Key Publisher plugin and our robot should move forward as we press the Up arrow key ↑ (make sure you start the simulation by pressing the play button to see the robot move forward after pressing the Up arrow key).

There is a demo explaining how the [Triggered Publisher](https://github.com/gazebosim/gz-sim/blob/gz-sim7/tutorials/triggered_publisher.md) works.
There is a demo explaining how the [Triggered Publisher](https://github.com/gazebosim/gz-sim/blob/gz-sim9/tutorials/triggered_publisher.md) works.

### Moving using arrow keys

Expand Down
Binary file removed ionic/tutorials/moving_robot/keypublisher_data.png
Binary file not shown.
Loading