Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Dec 12, 2023
1 parent 0710d15 commit 82b1e49
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
find_package(rostest REQUIRED)
find_package(mrs_uav_testing REQUIRED)

add_subdirectory(modalities)

Expand Down
2 changes: 0 additions & 2 deletions test/failsafe_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ foreach(MODALITY ${MODALITIES})

add_rostest(${TEST_NAME}.test
ARGS
package_name:=${PROJECT_NAME}
test_name:=${TEST_NAME}
modality:=${MODALITY}
)

Expand Down
17 changes: 11 additions & 6 deletions test/failsafe_controller/failsafe_controller.test
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<launch>

<arg name="this_path" default="$(dirname)" />

<arg name="UAV_NAME" default="uav1" />
<arg name="UAV_TYPE" default="x500" />

<!-- these will be filled in from the CMakeLists -->
<arg name="path" default="$(find mrs_uav_controllers)/test/failsafe_controller" />
<arg name="test_name" default="" />
<arg name="package_name" default="" />
<!-- automatically deduce the test name -->
<arg name="test_name" default="$(eval arg('this_path').split('/')[-1])" />

<!-- automatically deduce the package name -->
<arg name="import_eval" default="eval('_' + '_import_' + '_')"/>
<arg name="package_eval" default="eval(arg('import_eval') + '(\'rospkg\')').get_package_name(arg('this_path'))" />
<arg name="package" default="$(eval eval(arg('package_eval')))" />

<!-- params from the CMakeLists build matrix -->
<arg name="modality" default="" />
Expand All @@ -17,7 +22,7 @@

<include file="$(find mrs_multirotor_simulator)/launch/hw_api.launch">
<arg name="UAV_NAME" default="$(arg UAV_NAME)" />
<arg name="custom_config" default="$(arg path)/config/hw_api/hw_api_$(arg modality).yaml" />
<arg name="custom_config" default="$(dirname)/config/hw_api/hw_api_$(arg modality).yaml" />
</include>

<include file="$(find mrs_uav_testing)/launch/mrs_uav_system.launch">
Expand All @@ -26,7 +31,7 @@
<arg name="UAV_NAME" default="$(arg UAV_NAME)" />
</include>

<test pkg="$(arg package_name)" type="test_$(arg test_name)" test-name="$(arg test_name)" time-limit="60.0">
<test pkg="$(arg package)" type="test_$(arg test_name)" test-name="$(arg test_name)" time-limit="60.0">
<param name="test" value="$(arg test_name)" />
<param name="uav_name" value="$(arg UAV_NAME)" />
<param name="modality" value="$(arg modality)" />
Expand Down
2 changes: 0 additions & 2 deletions test/modalities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ foreach(CONTROLLER ${CONTROLLERS})

add_rostest(${TEST_NAME}.test
ARGS
package_name:=${PROJECT_NAME}
test_name:=${TEST_NAME}
controller:=${CONTROLLER}
modality:=${MODALITY}
)
Expand Down
19 changes: 12 additions & 7 deletions test/modalities/modalities.test
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<launch>

<arg name="this_path" default="$(dirname)" />

<arg name="UAV_NAME" default="uav1" />
<arg name="UAV_TYPE" default="x500" />

<!-- these will be filled in from the CMakeLists -->
<arg name="path" default="$(find mrs_uav_controllers)/test/modalities" />
<arg name="test_name" default="" />
<arg name="package_name" default="" />
<!-- automatically deduce the test name -->
<arg name="test_name" default="$(eval arg('this_path').split('/')[-1])" />

<!-- automatically deduce the package name -->
<arg name="import_eval" default="eval('_' + '_import_' + '_')"/>
<arg name="package_eval" default="eval(arg('import_eval') + '(\'rospkg\')').get_package_name(arg('this_path'))" />
<arg name="package" default="$(eval eval(arg('package_eval')))" />

<!-- params from the CMakeLists build matrix -->
<arg name="controller" default="" />
Expand All @@ -18,17 +23,17 @@

<include file="$(find mrs_multirotor_simulator)/launch/hw_api.launch">
<arg name="UAV_NAME" default="$(arg UAV_NAME)" />
<arg name="custom_config" default="$(arg path)/config/hw_api/hw_api_$(arg modality).yaml" />
<arg name="custom_config" default="$(dirname)/config/hw_api/hw_api_$(arg modality).yaml" />
</include>

<include file="$(find mrs_uav_testing)/launch/mrs_uav_system.launch">
<arg name="automatic_start" default="false" />
<arg name="platform_config" default="$(find mrs_multirotor_simulator)/config/mrs_uav_system/$(arg UAV_TYPE).yaml" />
<arg name="custom_config" default="$(arg path)/config/custom_config_$(arg controller).yaml" />
<arg name="custom_config" default="$(dirname)/config/custom_config_$(arg controller).yaml" />
<arg name="UAV_NAME" default="$(arg UAV_NAME)" />
</include>

<test pkg="$(arg package_name)" type="test_$(arg test_name)" test-name="$(arg test_name)" time-limit="60.0">
<test pkg="$(arg package)" type="test_$(arg test_name)" test-name="$(arg test_name)" time-limit="60.0">
<param name="test" value="$(arg test_name)" />
<param name="uav_name" value="$(arg UAV_NAME)" />
</test>
Expand Down

0 comments on commit 82b1e49

Please sign in to comment.