42 This class provides methods that are generic for the hands of 43 Kawada Industries' dual-arm robot called Nextage Open. 73 _MSG_ERR_NOTIMPLEMENTED =
'The method is not implemented in the derived class' 77 Since this class operates requires an access to 78 hrpsys.hrpsys_config.HrpsysConfigurator, valid 'parent' is a must. 79 Otherwise __init__ returns without doing anything. 81 @type parent: hrpsys.hrpsys_config.HrpsysConfigurator 82 @param parent: derived class of HrpsysConfigurator. 88 def _dio_writer(self, digitalout_indices, dio_assignments,
89 padding=_DIO_ASSIGN_OFF):
91 This private method calls HrpsysConfigurator.writeDigitalOutputWithMask, 92 which this class expects to be available via self._parent. 94 According to the current (Oct 2013) hardware spec, numbering rule 95 differs regarding 0 (numeric figure) in dout and mask as follows: 97 * 0 is "OFF" in the digital output. 98 * 2/1/2014 Assignment modified 0:ON --> 0:OFF 99 * 0 is "masked" and not used in mask. Since using '0' is defined in 100 hrpsys and not in the robots side, we'll always use '0' for 103 @type digitalout_indices: int[] 104 @param digitalout_indices: Array of indices of digital output that NEED to be 106 eg. If you're targetting on 25 and 26th places in 107 the DIO array but only 25th is 1, then the 109 @type dio_assignments: int[] 110 @param dio_assignments: range(32). Also called as "masking bits" or 111 just "mask". This number corresponds to the 112 assigned digital pin of the robot. 114 eg. If the target pins are 25 and 26, 115 dio_assignments = [24, 25] 116 @param padding: Either 0 or 1. DIO bit array will be populated with 118 Usually this method assumes to be called when turning 119 something "on". Therefore by default this value is ON. 121 @return: True if dout was writable to the register. False otherwise. 138 rospy.logdebug(
'digitalout_indices={}'.format(digitalout_indices))
140 for i
in digitalout_indices:
141 dout[i - 1] = signal_alternate
144 for i
in dio_assignments:
156 print_index.append(n)
157 print_index.extend(print_index)
158 print_index.extend(print_index)
165 print(
'dout, mask:\n{},\n{}\n{}'.format(dout, mask, print_index))
167 is_written_dout =
False 169 is_written_dout = self._parent.writeDigitalOutputWithMask(dout,
171 except AttributeError
as e:
172 rospy.logerr(
'AttributeError from robot.\nTODO: Needs handled.')
173 rospy.logerr(
'\t{}'.format(
"Device was not found. Maybe you're" +
175 return is_written_dout
179 Initialize dio. All channels will be set '0' (off), EXCEPT for 180 tool changers (channel 19 and 24) so that attached tools won't fall. 192 for i
in range(16, 32):
def gripper_l_close(self)
string _MSG_ERR_NOTIMPLEMENTED
def handtool_r_attach(self)
def __init__(self, parent)
def handlight_l(self, is_on=True)
def handtool_l_eject(self)
def airhand_r_release(self)
def handlight_r(self, is_on=True)
def airhand_l_release(self)
def handtool_l_attach(self)
def airhand_l_drawin(self)
def handtool_r_eject(self)
def handlight_both(self, is_on=True)
def airhand_r_drawin(self)
def gripper_r_close(self)
def _dio_writer(self, digitalout_indices, dio_assignments, padding=_DIO_ASSIGN_OFF)