Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 from nextage_ros_bridge.base_hands import BaseHands
00038 from nextage_ros_bridge.command.toolchanger_command import ToolchangerCommand
00039 from nextage_ros_bridge.command.handlight_command import HandlightCommand
00040
00041
00042 class BaseToolchangerHands(BaseHands):
00043 '''
00044 This class holds methods that are specific to the hands of NEXTAGE OPEN,
00045 accompanied with toolchanger.
00046 '''
00047
00048
00049 def __init__(self, parent):
00050 '''
00051 Since this class operates requires an access to
00052 hrpsys.hrpsys_config.HrpsysConfigurator, valid 'parent' is a must.
00053 Otherwise __init__ returns without doing anything.
00054
00055 @type parent: hrpsys.hrpsys_config.HrpsysConfigurator
00056 @param parent: derived class of HrpsysConfigurator.
00057 '''
00058 super(BaseToolchangerHands, self).__init__(parent)
00059 if not parent:
00060 return
00061 self._parent = parent
00062
00063 self.handlight_l_command = HandlightCommand(self, self.HAND_L)
00064 self.handlight_r_command = HandlightCommand(self, self.HAND_R)
00065 self.toolchanger_l_command = ToolchangerCommand(self, self.HAND_L)
00066 self.toolchanger_r_command = ToolchangerCommand(self, self.HAND_R)
00067
00068 def turn_handlight(self, hand=None, on=True):
00069 '''
00070 @param hand: Both hands if None.
00071 @type on: bool
00072 @param on: Despite its type, it's handled as str in this method.
00073 '''
00074 if self.HAND_L == hand:
00075 self.handlight_l_command.execute(on)
00076 elif self.HAND_R == hand:
00077 self.handlight_r_command.execute(on)
00078 elif not hand:
00079 self.handlight_l_command.execute(on)
00080 self.handlight_r_command.execute(on)