42 from nextage_ros_bridge
import nextage_client
44 _GOINITIAL_TIME_MIDSPEED = 3
45 _PKG =
'nextage_ros_bridge' 50 Test NextageClient with rostest. This does NOT test hardware (i.e. if DIO 51 is connected and functioning); instead, this only verifies if the 52 software works as to the given hardware spec. 54 For tests involving hardware, follow 55 https://github.com/start-jsk/rtmros_hironx/issues/272. 60 cls.
_robot = nextage_client.NextageClient()
62 cls._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
66 cls._robot_04.set_hand_version(version=cls._robot_04.HAND_VER_0_4_2)
68 cls._robot_04.goInitial(_GOINITIAL_TIME_MIDSPEED)
72 cls._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
73 cls._robot_04.goInitial(_GOINITIAL_TIME_MIDSPEED)
80 '''Testing software version 0.5 or newer''' 81 if self._robot.simulation_mode:
82 result = self._robot._hands.handlight_r(is_on=
False)
83 self.assertTrue(result)
85 result = self._robot._hands.handlight_r(is_on=
True)
86 self.assertTrue(result)
89 if self._robot.simulation_mode:
90 result = self._robot_04.handlight_r(is_on=
False)
91 self.assertTrue(result)
93 result = self._robot_04.handlight_r(is_on=
True)
94 self.assertTrue(result)
97 '''Testing software version 0.5 or newer''' 98 if self._robot.simulation_mode:
99 result = self._robot._hands.handlight_l(is_on=
False)
100 self.assertFalse(result)
102 result = self._robot._hands.handlight_l(is_on=
True)
103 self.assertTrue(result)
106 if self._robot.simulation_mode:
107 result = self._robot_04.handlight_l(is_on=
False)
108 self.assertTrue(result)
110 result = self._robot_04.handlight_l(is_on=
True)
111 self.assertTrue(result)
114 '''Testing software version 0.5 or newer''' 115 if self._robot.simulation_mode:
117 result = self._robot._hands.handlight_both(is_on=
False)
118 self.assertFalse(result)
120 result = self._robot._hands.handlight_both(is_on=
True)
121 self.assertTrue(result)
124 if self._robot.simulation_mode:
126 result = self._robot_04.handlight_both(is_on=
False)
and result
127 self.assertFalse(result)
129 result = self._robot_04.handlight_both(is_on=
True)
and result
130 self.assertTrue(result)
132 if __name__ ==
'__main__':
133 rostest.rosrun(_PKG,
'test_nxo_handlight', TestNxoHandlight)
def test_handlight_l_04(self)
def test_handlight_both_04(self)
def test_handlight_both_05(self)
def test_handlight_l_05(self)
def test_handlight_r_04(self)
def test_handlight_r_05(self)