Skip to content

Commit

Permalink
Merged in t8_tutorial_out_update (pull request gazebosim#411)
Browse files Browse the repository at this point in the history
Transport 8 tutorial update

Approved-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Dec 9, 2019
2 parents 3895b1b + f0bb2a5 commit cb64565
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 25 deletions.
1 change: 1 addition & 0 deletions tutorials/02_installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page installation Installation

Next Tutorial: \ref nodestopics
Previous Tutorial: \ref introduction

## Overview

Expand Down
1 change: 1 addition & 0 deletions tutorials/03_nodesAndTopics.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page nodestopics Nodes and Topics

Next Tutorial: \ref messages
Previous Tutorial: \ref installation

## Nodes

Expand Down
22 changes: 12 additions & 10 deletions tutorials/04_messages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page messages Messages

Next Tutorial: \ref services
Previous Tutorial: \ref nodestopics

## Overview

Expand All @@ -16,7 +17,7 @@ cd ~/ign_transport_tutorial

## Publisher

Download the [publisher.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/publisher.cc) file within the `ign_transport_tutorial`
Download the [publisher.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/publisher.cc) file within the `ign_transport_tutorial`
folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -131,7 +132,7 @@ The method *Publish()* sends a message to all the subscribers.

## Subscriber

Download the [subscriber.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/subscriber.cc)
Download the [subscriber.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/subscriber.cc)
file into the `ign_transport_tutorial` folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -211,7 +212,7 @@ until you hit *CTRL-C*. Note that this function captures the *SIGINT* and

## Building the code

Download the [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/CMakeLists.txt) file within the `ign_transport_tutorial` folder.
Download the [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/CMakeLists.txt) file within the `ign_transport_tutorial` folder.

Once you have all your files, go ahead and create a `build/` directory within
the `ign_transport_tutorial` directory.
Expand Down Expand Up @@ -247,7 +248,7 @@ In your subscriber terminal, you should expect an output similar to this one,
showing that your subscriber is receiving the topic updates:

```{.sh}
caguero@turtlebot:~/ign_transport_tutorial/build$ ./subscriber
$ ./subscriber
Msg: HELLO
Msg: HELLO
Expand All @@ -256,6 +257,7 @@ Msg: HELLO
Msg: HELLO
Msg: HELLO
```

## Advertise Options
Expand Down Expand Up @@ -345,7 +347,7 @@ between Ignition Transport and another protocol or if you want to just print the
content of a generic protobuf message using `DebugString()`, among other use
cases.

Download the [subscriber_generic.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/subscriber_generic.cc) file within the `ign_transport_tutorial` folder and open it with your favorite editor:
Download the [subscriber_generic.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/subscriber_generic.cc) file within the `ign_transport_tutorial` folder and open it with your favorite editor:

```{.cpp}
#include <google/protobuf/message.h>
Expand Down Expand Up @@ -461,12 +463,12 @@ often the integration of the message generation into the build system of your
project. Next, you can find an example of a publisher and subscriber using a
custom Protobuf message integrated with CMake.

Download the [publisher_custom_msg.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/publisher_custom_msg.cc)
and the [subscriber_custom_msg.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/subscriber_custom_msg.cc)
Download the [publisher_custom_msg.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/publisher_custom_msg.cc)
and the [subscriber_custom_msg.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/subscriber_custom_msg.cc)
files within the `ign_transport_tutorial`. Then, create a `msgs` folder and
download the [stringmsg.proto](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/msgs/stringmsg.proto)
and the [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/msgs/CMakeLists.txt)
files within the `msgs` folder. Finally, we'll need the main [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/CMakeLists.txt)
download the [stringmsg.proto](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/msgs/stringmsg.proto)
and the [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/msgs/CMakeLists.txt)
files within the `msgs` folder. Finally, we'll need the main [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/CMakeLists.txt)
file. You should have this file from the previous examples. Otherwise,
download and place it within the `ign_transport_tutorial` folder.

Expand Down
9 changes: 6 additions & 3 deletions tutorials/05_services.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page services Services

Next Tutorial: \ref security
Previous Tutorial: \ref messages

## Overview

Expand Down Expand Up @@ -569,7 +570,7 @@ request timed out or reached the service provider and ``result`` shows if the
service was successfully executed.

We also have the async version for service request without input. You should
download [requester_no_input.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/requester_no_input.cc>)
download [requester_async_no_input.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/requester_async_no_input.cc>)
file within the ``ign_transport_tutorial`` folder.

## Building the code
Expand Down Expand Up @@ -622,12 +623,13 @@ showing that your requesters have received their responses:

```{.sh}
$ ./requester
Response: [Hello World!]
Response: [HELLO]
```

```{.sh}
$ ./requester_async
Response: [Hello World!]
Press <CTRL-C> to exit
Response: [HELLO]
```

For running the oneway examples, open two terminals and from your ``build/``
Expand Down Expand Up @@ -679,6 +681,7 @@ showing that you have received a response:

```{.sh}
$ ./requester_no_input
Press <CTRL-C> to exit
Response: [This is it! This is the answer. It says here...that a bolt of
lightning is going to strike the clock tower at precisely 10:04pm, next
Saturday night! If...If we could somehow...harness this lightning...channel
Expand Down
3 changes: 2 additions & 1 deletion tutorials/06_security.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page security Security

Next Tutorial: \ref relay
Previous Tutorial: \ref services

## Overview

Expand Down Expand Up @@ -30,7 +31,7 @@ Two environment variables are used to enable authentications:
2. `IGN_TRANSPORT_PASSWORD` : The password

When both `IGN_TRANSPORT_USERNAME` and `IGN_TRANSPORT_PASSWORD` are set,
then authentication is enabled for a process. Every publisher in a secure
the authentication is enabled for a process. Every publisher in a secure
process will require subscribers to provide the correct username and
password. Also, every subscriber will only connect to secure publishers.

Expand Down
11 changes: 6 additions & 5 deletions tutorials/07_relay.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page relay Relay

Next Tutorial: \ref logging
Previous Tutorial: \ref security

## Overview

Expand All @@ -24,13 +25,13 @@ install Docker following any of the existing guides available
([here](https://bitbucket.org/osrf/vrx/wiki/tutorials/installDocker)'s one).

We're going to build a Docker image and run it inside your host computer.
Download the [build.bash](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/docker/build.bash), [run.bash](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/docker/run.bash) and
[Dockerfile](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/example/docker/ign-transport/Dockerfile) files.
Download the [build.bash](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/docker/build.bash), [run.bash](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/docker/run.bash) and
[Dockerfile](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/docker/ign-transport/Dockerfile) files.

```{.sh}
wget https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/docker/build.bash
wget https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/docker/run.bash
wget https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/docker/ign-transport/Dockerfile -O ign-transport/Dockerfile
wget https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/docker/build.bash
wget https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/docker/run.bash
wget https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/docker/ign-transport/Dockerfile -O ign-transport/Dockerfile
chmod +x build.bash run.bash
```

Expand Down
20 changes: 14 additions & 6 deletions tutorials/10_logging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page logging Logging

Next Tutorial: \ref envvars
Previous Tutorial: \ref relay

## Overview

Expand All @@ -24,7 +25,7 @@ cd ~/ign_transport_tutorial

## Record

Download the [record.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/log/example/record.cc)
Download the [record.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/record.cc)
file within the `ign_transport_tutorial` folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -125,7 +126,7 @@ stops the log recording as expected.

## Play back

Download the [playback.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/log/example/playback.cc)
Download the [playback.cc](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/playback.cc)
file within the `ign_transport_tutorial` folder and open it with your favorite
editor:

Expand Down Expand Up @@ -214,7 +215,7 @@ thread until all messages have been published.

## Building the code

Download the [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/default/log/example/CMakeLists.txt)
Download the [CMakeLists.txt](https://bitbucket.org/ignitionrobotics/ign-transport/raw/ign-transport8/example/CMakeLists.txt)
file within the `ign_transport_tutorial` folder.

Once you have all your files, go ahead and create a `build/` directory within
Expand All @@ -238,7 +239,7 @@ Open two new terminals and from your `build/` directory run the recorder.
From terminal 1:

```{.sh}
./example_record tutorial.tlog
./log_record tutorial.tlog
Press Ctrl+C to finish recording.
Recording...
```
Expand All @@ -260,7 +261,7 @@ ign topic -t /foo -e
And from terminal 1, playback your log file:

```{.sh}
./example_playback tutorial.tlog
./log_playback tutorial.tlog
```

You should receive one message in terminal 2:
Expand All @@ -286,4 +287,11 @@ And here's how you can play back the previous log file using `ign`:
ign log playback --file tutorial.tlog
```

For further options, check `ign log record -h` and `ign log playback -h`.
For further options, try running:
```{.sh}
ign log record -h
```
and
```{.sh}
ign log playback -h
```
1 change: 1 addition & 0 deletions tutorials/20_env_variables.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page envvars Environment Variables

Next Tutorial: \ref contribute
Previous Tutorial: \ref logging

## Overview

Expand Down
1 change: 1 addition & 0 deletions tutorials/21_contribute.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\page contribute How to contribute

Next Tutorial: \ref development
Previous Tutorial: \ref envvars

## Overview

Expand Down
2 changes: 2 additions & 0 deletions tutorials/22_development.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
\page development Development

Previous Tutorial: \ref contribute

## Overview

The purpose of this section is to describe the internal design of Ignition
Expand Down

0 comments on commit cb64565

Please sign in to comment.