moveit2
The MoveIt Motion Planning Framework for ROS 2.
unittest_pilz_industrial_motion_planner.test.py
Go to the documentation of this file.
1 import launch_testing
2 import pytest
3 import unittest
4 
5 from launch import LaunchDescription
6 from launch_ros.actions import Node
7 from launch_testing.util import KeepAliveProc
8 
9 import sys
10 import os
11 
12 sys.path.append(os.path.dirname(__file__))
13 from common_parameters import load_moveit_config
14 
15 
16 @pytest.mark.rostest
18 
19  # Load the context
20  test_config = load_moveit_config()
21 
22  planning_plugin = {
23  "planning_plugin": "pilz_industrial_motion_planner/CommandPlanner"
24  }
25 
26  # run test
27  unittest_pilz_industrial_motion_planner = Node(
28  package="pilz_industrial_motion_planner",
29  executable="unittest_pilz_industrial_motion_planner",
30  name="unittest_pilz_industrial_motion_planner",
31  parameters=[
32  test_config.to_dict(),
33  planning_plugin,
34  ],
35  output="screen",
36  )
37  return (
38  LaunchDescription(
39  [
40  unittest_pilz_industrial_motion_planner,
41  KeepAliveProc(),
42  launch_testing.actions.ReadyToTest(),
43  ]
44  ),
45  {
46  "unittest_pilz_industrial_motion_planner": unittest_pilz_industrial_motion_planner
47  },
48  )
49 
50 
51 class TestTerminatingProcessStops(unittest.TestCase):
53  self, proc_info, unittest_pilz_industrial_motion_planner
54  ):
55  proc_info.assertWaitForShutdown(
56  process=unittest_pilz_industrial_motion_planner, timeout=4000.0
57  )
58 
59 
60 @launch_testing.post_shutdown_test()
61 class TestOutcome(unittest.TestCase):
62  def test_exit_codes(self, proc_info, unittest_pilz_industrial_motion_planner):
63  launch_testing.asserts.assertExitCodes(
64  proc_info, process=unittest_pilz_industrial_motion_planner
65  )
def test_exit_codes(self, proc_info, unittest_pilz_industrial_motion_planner)
def test_gtest_run_complete(self, proc_info, unittest_pilz_industrial_motion_planner)