-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add activation tests for iiqka and kss drivers (#138)
* fix doc * add test that also activates the driver * add activation test for rsi * fix effort controller name * run Ci weekly * add test_depend * add kuka_controllers as exec_depend * fix depends * try test_depend * add upstream * try hacky upstream ws solution * fix deps * format * fix md and add ptp home * remove post_shutdown * extend md with krl home pos --------- Co-authored-by: Aron Svastits <svastits1@gmail.com>
- Loading branch information
Showing
17 changed files
with
205 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Copyright 2024 Áron Svastits | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import unittest | ||
|
||
import launch | ||
import launch.actions | ||
import launch_testing.actions | ||
import launch_testing.markers | ||
import pytest | ||
|
||
from launch.launch_description_sources.python_launch_description_source import ( | ||
PythonLaunchDescriptionSource, | ||
) | ||
from launch.actions.include_launch_description import IncludeLaunchDescription | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
# Launch driver startup | ||
@pytest.mark.launch_test | ||
@launch_testing.markers.keep_alive | ||
def generate_test_description(): | ||
return launch.LaunchDescription( | ||
[ | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
[ | ||
get_package_share_directory("kuka_iiqka_eac_driver"), | ||
"/launch/", | ||
"startup.launch.py", | ||
] | ||
) | ||
), | ||
launch.actions.TimerAction( | ||
period=2.0, | ||
actions=[ | ||
launch.actions.ExecuteProcess( | ||
cmd=["ros2", "lifecycle", "set", "robot_manager", "configure"], | ||
output="screen", | ||
), | ||
], | ||
), | ||
launch.actions.TimerAction( | ||
period=4.0, | ||
actions=[ | ||
launch.actions.ExecuteProcess( | ||
cmd=["ros2", "lifecycle", "set", "robot_manager", "activate"], | ||
output="screen", | ||
), | ||
], | ||
), | ||
launch_testing.actions.ReadyToTest(), | ||
] | ||
) | ||
|
||
|
||
class TestDriverActivation(unittest.TestCase): | ||
def test_read_stdout(self, proc_output): | ||
# Check for successful initialization | ||
proc_output.assertWaitFor("got segment base", timeout=5) | ||
proc_output.assertWaitFor( | ||
"Successful initialization of hardware 'lbr_iisy3_r760'", timeout=5 | ||
) | ||
# Check whether disabling automatic activation was successful | ||
proc_output.assertWaitFor("Hardware Component with name '' does not exists", timeout=5) | ||
# Check for successful configuration and activation | ||
proc_output.assertWaitFor( | ||
"Successful 'configure' of hardware 'lbr_iisy3_r760'", timeout=10 | ||
) | ||
proc_output.assertWaitFor("Successful 'activate' of hardware 'lbr_iisy3_r760'", timeout=15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright 2024 Áron Svastits | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import unittest | ||
|
||
import launch | ||
import launch.actions | ||
import launch_testing.actions | ||
import launch_testing.markers | ||
import pytest | ||
|
||
from launch.launch_description_sources.python_launch_description_source import ( | ||
PythonLaunchDescriptionSource, | ||
) | ||
from launch.actions.include_launch_description import IncludeLaunchDescription | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
# Launch driver startup | ||
@pytest.mark.launch_test | ||
@launch_testing.markers.keep_alive | ||
def generate_test_description(): | ||
return launch.LaunchDescription( | ||
[ | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
[ | ||
get_package_share_directory("kuka_kss_rsi_driver"), | ||
"/launch/", | ||
"startup.launch.py", | ||
] | ||
) | ||
), | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
[ | ||
get_package_share_directory("kuka_rsi_simulator"), | ||
"/launch/", | ||
"kuka_rsi_simulator.launch.py", | ||
] | ||
) | ||
), | ||
launch.actions.TimerAction( | ||
period=2.0, | ||
actions=[ | ||
launch.actions.ExecuteProcess( | ||
cmd=["ros2", "lifecycle", "set", "robot_manager", "configure"], | ||
output="screen", | ||
), | ||
], | ||
), | ||
launch.actions.TimerAction( | ||
period=4.0, | ||
actions=[ | ||
launch.actions.ExecuteProcess( | ||
cmd=["ros2", "lifecycle", "set", "robot_manager", "activate"], | ||
output="screen", | ||
), | ||
], | ||
), | ||
launch_testing.actions.ReadyToTest(), | ||
] | ||
) | ||
|
||
|
||
class TestDriverActivation(unittest.TestCase): | ||
def test_read_stdout(self, proc_output): | ||
# Check for successful initialization | ||
proc_output.assertWaitFor("got segment base", timeout=5) | ||
proc_output.assertWaitFor( | ||
"Successful initialization of hardware 'kr6_r700_sixx'", timeout=5 | ||
) | ||
# Check whether disabling automatic activation was successful | ||
proc_output.assertWaitFor("Hardware Component with name '' does not exists", timeout=5) | ||
# Check for successful configuration and activation | ||
proc_output.assertWaitFor("Successful 'configure' of hardware 'kr6_r700_sixx'", timeout=10) | ||
proc_output.assertWaitFor("Successful 'activate' of hardware 'kr6_r700_sixx'", timeout=15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters