Skip to content

Commit

Permalink
extend tests with frame convention check
Browse files Browse the repository at this point in the history
  • Loading branch information
Aron Svastits committed May 10, 2024
1 parent ac4facc commit 8b6d484
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kuka_agilus_support/test/test_kr_agilus.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
import launch.actions
import launch_testing.actions
import launch_testing.markers
from launch_ros.actions import Node
import pytest
import os
import re

from launch.launch_description_sources.python_launch_description_source import (
PythonLaunchDescriptionSource,
Expand Down Expand Up @@ -49,6 +51,12 @@ def generate_test_description(test_file):
[get_package_share_directory("kuka_agilus_support"), "/launch/", test_file]
)
),
# Echo tf between base_link and flange
Node(
package="tf2_ros",
executable="tf2_echo",
arguments=["world", "flange"],
),
launch_testing.actions.ReadyToTest(),
]
)
Expand All @@ -60,3 +68,11 @@ def test_read_stdout(self, proc_output):
proc_output.assertWaitFor("got segment base", timeout=5)
proc_output.assertWaitFor("got segment flange", timeout=5)
proc_output.assertWaitFor("got segment tool0", timeout=5)

# Check ROS-In frame convention: world and flange should be aligned if joint angles are
# zero and world-base_link rotation is identity
proc_output.assertWaitFor(
re.compile(r"Rotation: in Quaternion \[-?0\.000, -?0\.000, -?0\.000, 1\.000\]"),
timeout=5,
stream="stdout",
)

0 comments on commit 8b6d484

Please sign in to comment.