moveit2
The MoveIt Motion Planning Framework for ROS 2.
test_moveit_joy.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 # Software License Agreement (BSD License)
5 #
6 # Copyright (c) 2015, TORK (Tokyo Opensource Robotics Kyokai Association)
7 # All rights reserved.
8 #
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
11 # are met:
12 #
13 # * Redistributions of source code must retain the above copyright
14 # notice, this list of conditions and the following disclaimer.
15 # * Redistributions in binary form must reproduce the above
16 # copyright notice, this list of conditions and the following
17 # disclaimer in the documentation and/or other materials provided
18 # with the distribution.
19 # * Neither the name of Tokyo Opensource Robotics Kyokai Association
20 # nor the names of its contributors may be used to endorse or promote
21 # products derived from this software without specific prior written
22 # permission.
23 #
24 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 # POSSIBILITY OF SUCH DAMAGE.
36 
37 
38 import unittest
39 
41 import rospy
42 import rostest
43 import os
44 
45 _PKGNAME = "moveit_ros_visualization"
46 _NODENAME = "test_moveit_joy"
47 
48 
49 class TestMoveitJoy(unittest.TestCase):
50  def __init__(self, *args, **kwargs):
51  super(TestMoveitJoy, self).__init__(*args, **kwargs)
52 
53  def test_constructor(self):
54  # As there is no robot model loaded, the constructor will raise an exception
55  # However, at least we tested, that MoveitJoy constructor can be called...
56  self.assertRaises(RuntimeError, MoveitJoy)
57 
58 
59 if __name__ == "__main__":
60  rospy.init_node(_NODENAME)
61  rostest.rosrun(_PKGNAME, _NODENAME, TestMoveitJoy)
62  # Don't get trapped by https://github.com/ros/ros_comm/issues/870
63  os._exit(0) # exit without cleanup
def __init__(self, *args, **kwargs)