def getPathTo(self, pointId): """Gets shortest path from point from current location, and updates internal path accordingly. """ r = requests.get(Nav.HOST_ADDR + '/map/goto/' + str(pointId)) self.__model['path'] = Path.fromString(r.text) self._dispatcherClient.send(9002, 'say', {'text': 'Retrieved new path.'}) logging.info('Retrieved new path.')
def getPathTo(self, nodeFrom, nodeTo): """Gets shortest path from point from current location, and updates internal path accordingly. """ try: self._resetNavParams() r = requests.get(Nav.HOST_ADDR + '/map/shortest/' + str(nodeFrom) + '/' + str(nodeTo) ) self.__model['path'] = Path.fromString(r.text) self._dispatcherClient.send(9002, 'say', {'text': 'Retrieved new path.'}) logging.info('Retrieved new path.') except requests.exceptions.RequestException as e: logging.info('Oops! Failed to retrieve shortest path. Is server connected?')