def getModuleNamesAndFamilies(self, timeout=1000, **kwargs): '''Gets the module names and families, in a similar fashion to HebiLookup.getNamesAndFamilies() Args: timeout (int): Time, in milliseconds, to wait before timing out when waiting for a response from the group. Returns: (str, str) list: a list of 2-tuples which each contain the name and family of a module found by the lookup. The length of the list is the same as the value returned by getNumModules(). ''' info = self._getInfos(timeout=timeout, **kwargs) modules = [] if len(info) == self.getNumModules(): for module in range(self.getNumModules()): modules.append( (info[module].getName(), info[module].getFamily()) ) return returnArray(modules)
def getNamesAndFamilies(self): '''This function gets the names and families of modules found by the lookup Returns: (str, str) list: a list of 2-tuples which each contain the name and family of a module found by the lookup. The length of the list is the same as the value returned by getNumModules(). ''' return returnArray(self.lookupList.getNamesAndFamilies())
def getInfos(self, **kwargs): '''Gets the feedbacks for all the modules in the group. Args: timeout (int): Time, in milliseconds, to wait before timing out when waiting for a response from the group. Returns: infos (HebiInfo list): a list containing the infos corresponding to each module in the group. ''' return returnArray(self._getInfos(**kwargs))
def getTorques(self, **kwargs): '''Gets the current torques of all the modules in the group. Args: timeout (int): Time, in milliseconds, to wait before timing out when waiting for a response from the group. Returns: torques (float list): A list containing the current angles of the modules in the group. ''' return returnArray(self._getTorques(**kwargs))
def getFeedbacks(self, wait=True, **kwargs): '''Gets the feedbacks for all the modules in the group. getFeedbacks returns a list of feedback objects, which can be queried to get feedback from the module they represent. Args: timeout (int): Time, in milliseconds, to wait before timing out when waiting for a response from the group. Returns: feedbacks (HebiFeedback list): a list containing the feedbacks corresponding to each module in the group. wait (bool): if True, then blocks code until feedback is received. ''' return returnArray(self._getFeedbacks(wait=wait, **kwargs))