Skip to content

Commit

Permalink
Added documentations for scripts and made the configs for rmw_zenoh e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
CihatAltiparmak committed Jul 31, 2024
1 parent b9d154f commit 28782e2
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
86 changes: 86 additions & 0 deletions docs/how_to_run.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,89 @@
## Run All Benchmarks
If you haven't taken a look at [How To Install](how_to_install.md) section, please firstly start with [How To Install](how_to_install.md) Because it's assumed that you applied [How To Install](how_to_install.md) section in this section.

To run all benchmarks, just select your middleware implementation and go ahaed with `run_all_benchmarks.sh` bash script. This command initially will run the script you chose. In this example, it's used the default config scripts which the necessary middleware configuration is applied. This property serves the functionality for the users to apply some custom configurations freely.

```shell
# go to workspace this repository is built
cd ws
source /opt/ros/rolling/setup.sh
source install/setup.sh
# select your middleware
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
sh src/moveit_middleware_benchmark/scripts/run_all_benchmarks.sh -i ./src/moveit_middleware_benchmark/middleware_configurations/rmw_cyclonedds/config_rmw_cyclonedds.sh -d /benchmark_results -m rmw_cyclonedds_cpp
```

Let's explain all operations at `run_all_benchmarks.sh`.

#### selection of initial script
```
-i ./src/moveit_middleware_benchmark/middleware_configurations/rmw_cyclonedds/config_rmw_cyclonedds.sh
```

This argument is for selecting the initial scripts to be run. In this repository, These initial scripts is used for configuring middleware so that middleware is used more effectively. For example, you can use the initial script to configure TCP settings for rmw_zenoh like below.

```shell
echo "The configurations for rmw_zenoh_cpp is started!"
sudo sysctl -w "net.ipv4.tcp_rmem=4096 4096 4096"
sudo sysctl -w "net.ipv4.tcp_wmem=4096 4096 4096"
sudo sysctl -w "net.ipv4.tcp_mem=4096 4096 4096"
echo "The configurations for rmw_zenoh_cpp is finished!"
```

#### directory selection to save benchmark results
```
-d /benchmark_results
```

This argument indicates where the benchmark results are saved. For scenario_perception_benchmark and scenario_basic_service_client, the results of these scenarios are written in the shape of the below directory tree. It should be added that `run_all_benchmarks.sh` script uses json format to save the benchmark results.

```
benchmark_results/
├── scenario_basic_service_client
│   ├── rmw_cyclonedds_cpp.json
│   ├── rmw_fastrtps_cpp.json
│   └── rmw_zenoh_cpp.json
└── scenario_perception_pipeline
├── rmw_cyclonedds_cpp.json
├── rmw_fastrtps_cpp.json
└── rmw_zenoh_cpp.json
```

#### middleware selection
```
-m rmw_cyclonedds_cpp
```

This argument is important for both saving the benchmark results correctly and run `export RMW_IMPLEMENTATION=...` command correctly.

## Plot Visualization of Benchmark Results

After running `run_all_benchmarks.sh`, you can also visualize the box plots of benchmark results. Suppose that you have some benchmark results stored in below directory and the directory named `benchmark_results` is located in `ws` directory which this repository is built.


```
benchmark_results/
├── scenario_basic_service_client
│   ├── rmw_cyclonedds_cpp.json
│   ├── rmw_fastrtps_cpp.json
│   └── rmw_zenoh_cpp.json
└── scenario_perception_pipeline
├── rmw_cyclonedds_cpp.json
├── rmw_fastrtps_cpp.json
└── rmw_zenoh_cpp.json
```

Just give the directory of benchmark results as argument and then visualize the benchmark results in plot.
```shell
cd ws
python3 src/moveit_middleware_benchmark/scripts/box_plot_visualizer.py benchmark_results

```

**NOTE THAT THE BELOW PICTURE DOESN'T PRESENT REAL RESULTS. IT'S JUST FOR SHOWCASE**

![](./pictures/box_plot_example.png)

## Scenarios

### [Perception Pipeline Benchmark](scenarios/perception_pipeline_benchmark.md)
Expand Down
Binary file added docs/pictures/box_plot_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions middleware_configurations/rmw_zenoh/config_rmw_zenoh.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "The configurations for rmw_zenoh_cpp is started!"
# sudo sysctl -w "net.ipv4.tcp_rmem=4096 4096 4096"
# sudo sysctl -w "net.ipv4.tcp_wmem=4096 4096 4096"
# sudo sysctl -w "net.ipv4.tcp_mem=4096 4096 4096"
sudo sysctl -w "net.ipv4.tcp_rmem=4096 4096 4096"
sudo sysctl -w "net.ipv4.tcp_wmem=4096 4096 4096"
sudo sysctl -w "net.ipv4.tcp_mem=4096 4096 4096"
echo "The configurations for rmw_zenoh_cpp is finished!"

0 comments on commit 28782e2

Please sign in to comment.