acceptancetest_rtm.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 
3 # Software License Agreement (BSD License)
4 #
5 # Copyright (c) 2014, TORK (Tokyo Opensource Robotics Kyokai Association)
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 #
12 # * Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # * Redistributions in binary form must reproduce the above
15 # copyright notice, this list of conditions and the following
16 # disclaimer in the documentation and/or other materials provided
17 # with the distribution.
18 # * Neither the name of TORK. nor the
19 # names of its contributors may be used to endorse or promote products
20 # derived from this software without specific prior written permission.
21 #
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 # POSSIBILITY OF SUCH DAMAGE.
34 
35 import time
36 
37 from hironx_ros_bridge.constant import Constant
38 from hironx_ros_bridge.testutil.abst_acceptancetest import AbstAcceptanceTest
39 
40 
42 
43  def __init__(self, robot_client):
44  '''
45  @type robot_client: hironx_ros_bridge.hironx_client.HIRONX
46  '''
47  self._robotclient = robot_client
48 
49  def go_initpos(self):
50  self._robotclient.goInitial()
51 
52  def set_joint_angles(self, joint_group, joint_angles, msg_tasktitle=None,
53  task_duration=7.0, do_wait=True):
54  '''
55  @see: AbstAcceptanceTest.set_joint_angles
56  '''
57  print("== RTM; {} ==".format(msg_tasktitle))
58  self._robotclient.setJointAnglesOfGroup(
59  joint_group, joint_angles, task_duration, do_wait)
60 
61  def set_pose(self, joint_group, position, rpy, msg_tasktitle,
62  task_duration=7.0, do_wait=True, ref_frame_name=None):
63 
64  print("== RTM; {} ==".format(msg_tasktitle))
65  self._robotclient.setTargetPose(joint_group, position, rpy,
66  task_duration, ref_frame_name)
67  if do_wait:
68  self._robotclient.waitInterpolationOfGroup(joint_group)
69 
71  self, joint_group, dx=0, dy=0, dz=0, dr=0, dp=0, dw=0,
72  msg_tasktitle=None, task_duration=7.0, do_wait=True):
73  if joint_group == Constant.GRNAME_LEFT_ARM:
74  eef = 'LARM_JOINT5'
75  elif joint_group == Constant.GRNAME_RIGHT_ARM:
76  eef = 'RARM_JOINT5'
77 
78  print("== RTM; {} ==".format(msg_tasktitle))
79  self._robotclient.setTargetPoseRelative(
80  joint_group, eef, dx, dy, dz, dr, dp, dw,
81  task_duration, do_wait)
def set_pose_relative(self, joint_group, dx=0, dy=0, dz=0, dr=0, dp=0, dw=0, msg_tasktitle=None, task_duration=7.0, do_wait=True)
def set_joint_angles(self, joint_group, joint_angles, msg_tasktitle=None, task_duration=7.0, do_wait=True)
def set_pose(self, joint_group, position, rpy, msg_tasktitle, task_duration=7.0, do_wait=True, ref_frame_name=None)


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