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