diff --git a/docs/how_to_run.md b/docs/how_to_run.md index 6928580..45ac6ce 100644 --- a/docs/how_to_run.md +++ b/docs/how_to_run.md @@ -8,22 +8,24 @@ To run all benchmarks, just select your middleware implementation and go ahead w 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 +# go to moveit_middleware_benchmark package's directory +cd src/moveit_middleware_benchmark +# conduct all benchmarks +sh src/moveit_middleware_benchmark/scripts/run_all_benchmarks.sh -i ./src/moveit_middleware_benchmark/middleware_configurations/rmw_cyclonedds/config.sh -d /benchmark_results ``` 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 +-i ./src/moveit_middleware_benchmark/middleware_configurations/rmw_cyclonedds/config.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!" +export RMW_IMPLEMENTATION=rmw_zenoh_cpp 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" @@ -49,13 +51,6 @@ benchmark_results/ └── 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. diff --git a/middleware_configurations/rmw_cyclonedds/config.sh b/middleware_configurations/rmw_cyclonedds/config.sh new file mode 100644 index 0000000..3d70b54 --- /dev/null +++ b/middleware_configurations/rmw_cyclonedds/config.sh @@ -0,0 +1,3 @@ +echo "The configurations for rmw_cyclonedds_cpp is started!" +export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp +echo "The configurations for rmw_cyclonedds_cpp is finished!" \ No newline at end of file diff --git a/middleware_configurations/rmw_cyclonedds/config_rmw_cyclonedds.sh b/middleware_configurations/rmw_cyclonedds/config_rmw_cyclonedds.sh deleted file mode 100644 index e69de29..0000000 diff --git a/middleware_configurations/rmw_fastrtps/config.sh b/middleware_configurations/rmw_fastrtps/config.sh new file mode 100644 index 0000000..9dd57af --- /dev/null +++ b/middleware_configurations/rmw_fastrtps/config.sh @@ -0,0 +1,3 @@ +echo "The configurations for rmw_fastrtps_cpp is started!" +export RMW_IMPLEMENTATION=rmw_fastrtps_cpp +echo "The configurations for rmw_fastrtps_cpp is finished!" \ No newline at end of file diff --git a/middleware_configurations/rmw_fastrtps/config_rmw_fastrtps.sh b/middleware_configurations/rmw_fastrtps/config_rmw_fastrtps.sh deleted file mode 100644 index e69de29..0000000 diff --git a/middleware_configurations/rmw_zenoh/config_rmw_zenoh.sh b/middleware_configurations/rmw_zenoh/config.sh similarity index 86% rename from middleware_configurations/rmw_zenoh/config_rmw_zenoh.sh rename to middleware_configurations/rmw_zenoh/config.sh index fa0920d..ad969e5 100644 --- a/middleware_configurations/rmw_zenoh/config_rmw_zenoh.sh +++ b/middleware_configurations/rmw_zenoh/config.sh @@ -1,4 +1,5 @@ echo "The configurations for rmw_zenoh_cpp is started!" +export RMW_IMPLEMENTATION=rmw_zenoh_cpp 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" diff --git a/scripts/run_all_benchmarks.sh b/scripts/run_all_benchmarks.sh index bd2f6df..799dac8 100644 --- a/scripts/run_all_benchmarks.sh +++ b/scripts/run_all_benchmarks.sh @@ -2,9 +2,8 @@ helpFunction() { echo "" - echo "Usage: $0 -i initial_script -m middleware_name -d benchmark_results_directory" + echo "Usage: $0 -i initial_script -d benchmark_results_directory" echo -i "\t-i initial_script to run once all benchmarks are started" - echo -m "\t-m selected middleware to benchmark" echo -d "\t-d the directory the benchmark results is saved" exit 1 # Exit script after printing help } @@ -13,20 +12,18 @@ while getopts "i:m:d:" opt do case "$opt" in i ) initial_script="$OPTARG" ;; - m ) middleware_name="$OPTARG" ;; d ) benchmark_results_directory="$OPTARG" ;; ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent esac done # Print helpFunction in case parameters are empty -if [ -z "$initial_script" ] || [ -z "$middleware_name" ] || [ -z "$benchmark_results_directory" ] +if [ -z "$initial_script" ] || [ -z "$benchmark_results_directory" ] then echo "Some or all of the parameters are empty"; helpFunction fi -echo "middleware name is $middleware_name" echo "benchmark results directory is $benchmark_results_directory" echo "Benchmarking is starting!" @@ -34,12 +31,10 @@ echo "Starting initial scripts before benchmarks run!" sh "$initial_script" echo "Initial script has finished! Now starting to benchmark middleware with scenarios!" -export RMW_IMPLEMENTATION=${middleware_name} - mkdir ${benchmark_results_directory}/scenario_basic_service_client -p ros2 daemon stop -ros2 launch moveit_middleware_benchmark scenario_basic_service_client_benchmark.launch.py benchmark_command_args:="--benchmark_out=${benchmark_results_directory}/scenario_basic_service_client/${middleware_name}.json --benchmark_out_format=json" +ros2 launch moveit_middleware_benchmark scenario_basic_service_client_benchmark.launch.py benchmark_command_args:="--benchmark_out=${benchmark_results_directory}/scenario_basic_service_client/${RMW_IMPLEMENTATION}.json --benchmark_out_format=json" mkdir ${benchmark_results_directory}/scenario_perception_pipeline -p ros2 daemon stop -ros2 launch moveit_middleware_benchmark scenario_perception_pipeline_benchmark.launch.py benchmark_command_args:="--benchmark_out=${benchmark_results_directory}/scenario_perception_pipeline/${middleware_name}.json --benchmark_out_format=json" +ros2 launch moveit_middleware_benchmark scenario_perception_pipeline_benchmark.launch.py benchmark_command_args:="--benchmark_out=${benchmark_results_directory}/scenario_perception_pipeline/${RMW_IMPLEMENTATION}.json --benchmark_out_format=json" selected_test_case_index:=0