test_hironx_controller.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 from test_hironx import *
5 
7 
8  # https://github.com/fkanehiro/hrpsys-base/blob/master/sample/SampleRobot/samplerobot_impedance_controller.py.in
9  def test_impedance_controller(self): # https://github.com/start-jsk/rtmros_hironx/issues/337
10  if not self.robot.ic or self.robot.ic.ref.get_component_profile().version < '315.3.0':
11  self.assertTrue(True)
12  return True
13  # although this is not stable rtc, we'll test them
14  self.robot.goInitial(tm=1)
15  ret = self.robot.startImpedance('rarm') # this returns ret, this is bug
16  #self.assertTrue(ret)
17  ret = self.robot.seq_svc.setWrenches([0,0,0,0,0,0,
18  10,0,0,0,0,0,], 2.0);
19  #self.assertTrue(ret)
20  self.robot.seq_svc.waitInterpolation();
21  ret = self.robot.seq_svc.setWrenches([0,0,0,0,0,0,
22  0,0,0,0,0,0,], 2.0);
23  #self.assertTrue(ret)
24  self.robot.seq_svc.waitInterpolation();
25  ret = self.robot.seq_svc.setWrenches([0,0,0,0,0,0,
26  0,10,0,0,0,0,], 2.0);
27  #self.assertTrue(ret)
28  self.robot.seq_svc.waitInterpolation();
29  ret = self.robot.seq_svc.setWrenches([0,0,0,0,0,0,
30  0,0,0,0,0,0,], 2.0);
31  #self.assertTrue(ret)
32  self.robot.seq_svc.waitInterpolation();
33  ret = self.robot.seq_svc.setWrenches([0,0,0,0,0,0,
34  0,0,10,0,0,0,], 2.0);
35  #self.assertTrue(ret)
36  self.robot.seq_svc.waitInterpolation();
37  #self.assertTrue(ret)
38  ret = self.robot.stopImpedance('rarm')
39  #self.assertTrue(ret)
40  self.assertTrue(True) # this is dummy, current simulate hiro does not have force sensor so it retunrs None
41 
43  '''
44  If Servo Controller RTC are running (which will be always true for
45  the tests because it runs on simulation), kill it then test if servoOn
46  method still succeeds.
47  '''
48  if self.robot.sc_svc:
49  self.robot.sc_svc = None
50  else:
51  print('Servo Controller RTC is not running, so skipping this test.')
52  pass
53  self.assertEqual(self.robot.servoOn(), 1)
54 
55 if __name__ == '__main__':
56  import rostest
57  rostest.rosrun(PKG, 'test_hronx_controller', TestHiroController)
def assertTrue(self, a)
Definition: test_hironx.py:226


hironx_ros_bridge
Author(s): Kei Okada , Isaac I.Y. Saito
autogenerated on Thu May 14 2020 03:52:05