コード例 #1
0
ファイル: nav.py プロジェクト: poemking/easyNav-pi-nav
	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.')
コード例 #2
0
ファイル: nav.py プロジェクト: easyNav/easyNav-pi-nav
	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?')