From 17b1c8d1b1026b88f3276134e894075d86e4bc98 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 15 Apr 2024 13:05:16 +0200 Subject: [PATCH] Add tests --- ur_simulation_gz/CMakeLists.txt | 5 +++++ ur_simulation_gz/launch/ur_sim_control.launch.py | 3 ++- ur_simulation_gz/package.xml | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ur_simulation_gz/CMakeLists.txt b/ur_simulation_gz/CMakeLists.txt index 48d5f6c..b547e1c 100644 --- a/ur_simulation_gz/CMakeLists.txt +++ b/ur_simulation_gz/CMakeLists.txt @@ -8,8 +8,13 @@ install(DIRECTORY config launch urdf ) if(BUILD_TESTING) + find_package(launch_testing_ament_cmake) find_package(ament_cmake_pytest REQUIRED) + add_launch_test(test/test_gz.py + TIMEOUT + 180 + ) ament_add_pytest_test(description test/test_description.py) endif() diff --git a/ur_simulation_gz/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py index 8adb070..bc681e3 100644 --- a/ur_simulation_gz/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -171,7 +171,8 @@ def launch_setup(context, *args, **kwargs): launch_arguments={ "gz_args": IfElseSubstitution( gazebo_gui, if_value=" -r -v 4 empty.sdf", else_value=" -s -r -v 4 empty.sdf" - ) + ), + "on_exit_shutdown": "true", }.items(), ) diff --git a/ur_simulation_gz/package.xml b/ur_simulation_gz/package.xml index bf2e3c0..139e8b9 100644 --- a/ur_simulation_gz/package.xml +++ b/ur_simulation_gz/package.xml @@ -28,6 +28,10 @@ xacro ament_cmake_pytest + launch_testing_ament_cmake + launch_testing_ros + liburdfdom-tools + xacro ament_cmake