Skip to content

Commit

Permalink
Improved windows instructions (#360)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
  • Loading branch information
ahcorde authored Sep 21, 2022
1 parent b214318 commit 492dc4e
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 3 deletions.
42 changes: 42 additions & 0 deletions tutorials/04_messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,12 @@ cd build
Run `cmake` and build the code.

```{.sh}
# Linux and MacOS
cmake ..
make publisher subscriber
# Windows
cmake --build . --config Release
```

## Running the examples
Expand All @@ -235,13 +239,21 @@ Open two new terminals and from your `build/` directory run the executables.
From terminal 1:

```{.sh}
# Linux and MacOS
./publisher
# Windows
.\Release\publisher.exe
```

From terminal 2:

```{.sh}
# Linux and MacOS
./subscriber
# Windows
.\Release\subscriber.exe
```

In your subscriber terminal, you should expect an output similar to this one,
Expand Down Expand Up @@ -438,20 +450,33 @@ Run `cmake` and build the example:

```{.sh}
cd build
# Linux and MacOS
cmake ..
make subscriber_generic
# Windows
cmake --build . --config Release
```

From terminal 1:

```{.sh}
# Linux and MacOS
./publisher
# Windows
.\Release\publisher.exe
```

From terminal 2:

```{.sh}
# Linux and MacOS
./subscriber_generic
# Windows
.\Release\subscriber_generic.exe
```

## Using custom Protobuf messages
Expand Down Expand Up @@ -543,20 +568,33 @@ Run `cmake` and build the example:

```{.sh}
cd build
# Linux and MacOS
cmake ..
make
# Windows
cmake --build . --config Release
```

From terminal 1:

```{.sh}
# Linux and MacOS
./publisher_custom_msg
# Windows
.\Release\publisher_custom_msg.exe
```

From terminal 2:

```{.sh}
# Linux and MacOS
./subscriber_custom_msg
# Windows
.\Release\subscriber_custom_msg.exe
```

## Topic remapping
Expand Down Expand Up @@ -585,7 +623,11 @@ You can modify any of the publisher examples to add this option.
From terminal 1:

```{.sh}
# Linux and MacOS
./publisher
# Windows
.\Release\publisher.exe
```

From terminal 2 (requires Gazebo Tools):
Expand Down
45 changes: 43 additions & 2 deletions tutorials/05_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,13 @@ cd build
Run ``cmake`` and build the code.

```{.sh}
# Linux and MacOS
cmake ..
make responser responser_oneway requester requester_async requester_oneway
make responser_no_input requester_no_input requester_async_no_input
# Windows
cmake --build . --config Release
```

## Running the examples
Expand All @@ -610,19 +614,31 @@ Open three new terminals and from your ``build/`` directory run the executables.
From terminal 1:

```{.sh}
# Linux and MacOS
./responser
# Windows
.\Release\responser.exe
```

From terminal 2:

```{.sh}
# Linux and MacOS
./requester
# Windows
.\Release\requester.exe
```

From terminal 3:

```{.sh}
# Linux and MacOS
./requester_async
# Windows
.\Release\requester_async.exe
```

In your requester terminals, you should expect an output similar to this one,
Expand Down Expand Up @@ -651,14 +667,22 @@ From terminal 1:
From terminal 2:

```{.sh}
# Linux and MacOS
./requester_oneway
# Windows
.\Release\requester_oneway.exe
```

In your responser terminal, you should expect an output similar to this one,
showing that your service provider has received a request:

```{.sh}
$ ./responser_oneway
# Linux and MacOS
./responser_oneway
# Windows
.\Release\responser_oneway.exe
Request received: [HELLO]
```

Expand All @@ -668,26 +692,43 @@ For running the examples without input, open three terminals and from your
From terminal 1:

```{.sh}
# Linux and MacOS
./responser_no_input
# Windows
.\Release\responser_no_input.exe
```

From terminal 2:

```{.sh}
# Linux and MacOS
./requester_no_input
# Windows
.\Release\requester_no_input.exe
```

From terminal 3:

```{.sh}
# Linux and MacOS
./requester_async_no_input
# Windows
.\Release\requester_async_no_input.exe
```

In your requesters' terminals, you should expect an output similar to this one,
showing that you have received a response:

```{.sh}
$ ./requester_no_input
# Linux and MacOS
./requester_no_input
# Windows
.\Release\requester_no_input.exe
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
Expand Down
12 changes: 11 additions & 1 deletion tutorials/06_security.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ either use, or not use, authentication.
Two environment variables are used to enable authentications:

1. `GZ_TRANSPORT_USERNAME` : The username
2. `GZ_TRANSPORT_PASSWORD` : The password
2. `GZ_TRANSPORT_PASSWORD` : The password

When both `GZ_TRANSPORT_USERNAME` and `GZ_TRANSPORT_PASSWORD` are set,
the authentication is enabled for a process. Every publisher in a secure
Expand Down Expand Up @@ -58,8 +58,13 @@ Now let's try a secure publisher and an unsecure subscriber.
1. Leave the first terminal running `gz topic -t /foo -e`.
2. Setup authentication in the second terminal:
```
# Linux and MacOS
export GZ_TRANSPORT_USERNAME=user
export GZ_TRANSPORT_PASSWORD=pass
# Windows
set GZ_TRANSPORT_USERNAME=user
set GZ_TRANSPORT_PASSWORD=pass
```
3. Now publish a message in the second terminal:
```
Expand All @@ -72,8 +77,13 @@ Finally, let's create secure subscriber.

1. Open a third terminal, and setup authentication in that terminal.
```
# Linux and MacOS
export GZ_TRANSPORT_USERNAME=user
export GZ_TRANSPORT_PASSWORD=pass
# Windows
set GZ_TRANSPORT_USERNAME=user
set GZ_TRANSPORT_PASSWORD=pass
```
2. Echo the `/foo` topic in the secure third terminal.
```
Expand Down
13 changes: 13 additions & 0 deletions tutorials/10_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,12 @@ cd build
Run `cmake` and build the code.

```{.sh}
# Linux and MacOS
cmake ..
make
# Windows
cmake --build . --config Release
```

## Running the examples
Expand All @@ -239,7 +243,12 @@ Open two new terminals and from your `build/` directory run the recorder.
From terminal 1:

```{.sh}
# Linux and MacOS
./log_record tutorial.tlog
# Windows
.\Release\log_record.exe tutorial.tlog
Press Ctrl+C to finish recording.
Recording...
```
Expand All @@ -261,7 +270,11 @@ gz topic -t /foo -e
And from terminal 1, playback your log file:

```{.sh}
# Linux and MacOS
./log_playback tutorial.tlog
# Windows
.\Release\log_playback.exe tutorial.tlog
```

You should receive one message in terminal 2:
Expand Down

0 comments on commit 492dc4e

Please sign in to comment.