17 from ament_index_python.packages
import get_package_share_directory
18 from launch
import LaunchDescription
19 from launch.actions
import ExecuteProcess
20 from launch_pytest.tools
import process
as process_tools
21 from launch_ros.actions
import Node
23 from moveit_configs_utils
import MoveItConfigsBuilder
38 .robot_description(file_path=
"config/panda.urdf.xacro")
39 .planning_pipelines(
"ompl", [
"ompl"])
40 .trajectory_execution(file_path=
"config/gripper_moveit_controllers.yaml")
48 run_move_group_node = Node(
49 package=
"moveit_ros_move_group",
50 executable=
"move_group",
52 parameters=[moveit_config.to_dict()],
57 executable=
"static_transform_publisher",
59 arguments=[
"0.0",
"0.0",
"0.0",
"0.0",
"0.0",
"0.0",
"world",
"panda_link0"],
62 robot_state_publisher = Node(
63 package=
"robot_state_publisher",
64 executable=
"robot_state_publisher",
65 name=
"robot_state_publisher",
67 parameters=[moveit_config.robot_description],
71 ros2_controllers_path = os.path.join(
74 "ros2_controllers.yaml",
76 ros2_control_node = Node(
77 package=
"controller_manager",
78 executable=
"ros2_control_node",
79 parameters=[moveit_config.robot_description, ros2_controllers_path],
85 "panda_arm_controller",
86 "panda_hand_controller",
87 "joint_state_broadcaster",
91 cmd=[
"ros2 run controller_manager spawner {}".format(controller)],
100 robot_state_publisher,
109 package=
"moveit_ros_trajectory_cache",
110 executable=
"test_trajectory_cache",
111 name=
"test_trajectory_cache_node",
114 parameters=[moveit_config.to_dict()],
118 @launch_pytest.fixture
120 return LaunchDescription(
122 + [trajectory_cache_test_runner_node, launch_pytest.actions.ReadyToTest()]
129 expected
in output.splitlines()
130 ), f
"Did not get expected: {expected} in output:\n\n{output}"
135 @pytest.mark.launch(fixture=launch_description)
138 assert process_tools.wait_for_output_sync(
140 trajectory_cache_test_runner_node,
141 lambda x: x.count(
"[PASS]") == 169,
146 assert not process_tools.wait_for_output_sync(
148 trajectory_cache_test_runner_node,
149 lambda x:
"[FAIL]" in x,
def get_package_share_directory(pkg_name)
def trajectory_cache_test_runner_node(moveit_config)
def test_all_tests_pass(trajectory_cache_test_runner_node, launch_context)
def launch_description(trajectory_cache_test_runner_node, robot_fixture)
def validate_stream(expected)
def robot_fixture(moveit_config)