Skip to content
Open
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
59 changes: 22 additions & 37 deletions examples/rust/mini-adas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ A recorder can be added to the example and switched on in the primary via a CLI
## Running

You need to run the following commands in separate terminals.
If you want to benchmark, you should also add the `--release` flag.

```sh
# Use 400ms cycle time
cargo run --bin adas_primary 400
bazel run //examples/rust/mini-adas:adas_primary -- 400
```

```sh
cargo run --bin adas_secondary 1
bazel run //examples/rust/mini-adas:adas_secondary -- 1
```

```sh
cargo run --bin adas_secondary 2
bazel run //examples/rust/mini-adas:adas_secondary -- 2
```

If you want to include recording,
Expand All @@ -28,20 +27,20 @@ and start the recorder.
```sh
# Use 400ms cycle time
# Wait for recorder with ID 900
cargo run --bin adas_primary 400 900
bazel run //examples/rust/mini-adas:adas_primary -- 400 900
```

```sh
cargo run --bin adas_secondary 1
bazel run //examples/rust/mini-adas:adas_secondary -- 1
```

```sh
cargo run --bin adas_secondary 2
bazel run //examples/rust/mini-adas:adas_secondary -- 2
```

```sh
# Start recorder with ID 900
cargo run --features recording --bin adas_recorder 900
bazel run //examples/rust/mini-adas:adas_recorder -- 900
```

You may also use more than one recorder by specifying multiple recorder agent ids as a dot-separated
Expand All @@ -51,61 +50,47 @@ list to the primary and then start all the corresponding recorders.
```sh
# Use 400ms cycle time
# Wait for two recorders with IDs 900 and 901
cargo run --bin adas_primary 400 900.901
bazel run //examples/rust/mini-adas:adas_primary -- 400 900.901
```

```sh
cargo run --bin adas_secondary 1
bazel run //examples/rust/mini-adas:adas_secondary -- 1
```

```sh
cargo run --bin adas_secondary 2
bazel run //examples/rust/mini-adas:adas_secondary -- 2
```

```sh
# Start recorder with ID 900
cargo run --features recording --bin adas_recorder 900
bazel run //examples/rust/mini-adas:adas_recorder -- 900
```

```sh
# Start recorder with ID 901
cargo run --features recording --bin adas_recorder 901
bazel run //examples/rust/mini-adas:adas_recorder -- 901
```


## Different signalling layer

The easiest way to switch the signalling layer is by changing the default feature in the `Cargo.toml`.
Then you can just use the commands from above.
The easiest way to switch the signalling layer is by changing the crate_features in the `BUILD.bazel`,
make sure to switch it for every target you're using. Then you can just use the commands from above.

Alternatively, you can pass `--no-default-features` and the right `--features` flag.
Note that for mpsc-only signalling, there can be only a primary process without
any secondaries or recorders, because mpsc does not support inter-process signalling.

```sh
# Use 400ms cycle time
cargo run --no-default-features --features signalling_direct_tcp --bin adas_primary 400
```
## Running tracer

```sh
cargo run --no-default-features --features signalling_direct_tcp --bin adas_secondary 1
```
In order to start tracing use:

```sh
cargo run --no-default-features --features signalling_direct_tcp --bin adas_secondary 2
bazel run //feo-tracer:feo_tracer -- -o out.dat
```
where `out.dat` is the tracing data output.

### Direct Mode with a Recorder

To run with a recorder in direct mode.

```sh
# Use 400ms cycle time and wait for recorder 900
cargo run --no-default-features --features "signalling_direct_tcp,com_iox2" --bin adas_primary -- 400 900
```
You can specify the tracing duration in seconds and log level using:

```sh
# Start recorder with ID 900 in direct mode
cargo run --no-default-features --features "signalling_direct_tcp,recording,com_iox2" --bin adas_recorder -- 900
bazel run //feo-tracer:feo_tracer -- -d 10 -l INFO -o out.dat
```

Note that for mpsc-only signalling, there can be only a primary process without
any secondaries or recorders, because mpsc does not support inter-process signalling.
Loading