View Single Post
Posts: 482 | Thanked: 550 times | Joined on Oct 2010
#560
Question about that: might it be possible to parse the beginning of the plain-text command such as to extract things such as "turn left", "slight right", "merge", etc. and show an arrow indicating what the next command will be? I would find this very handy when I can't remember the last instruction, but I don't want to take my eyes off the road for long enough to read the blue box.

I believe you are using Python for modrana. Here is an example of what I mean:
Code:
def get_turn_direction(gmaps):
	#calling the google maps string "gmaps"
	gmaps_array = lower(gmaps).split(); #Convert to lowercase and split words
	if gmaps_array[1]=="left":
		if gmaps_array[0]=="turn":
			return "turn_left"
		elif gmaps_array[0]=="bear":
			return "bear_left"
		elif gmaps_array[0]=="exit":
			return "bear_left"
		else:
			return "turn_left"
	elif gmaps_array[1]=="right":
		if gmaps_array[0]=="turn":
			return "turn_right"
		elif gmaps_array[0]=="bear":
			return "bear_right"
		elif gmaps_array[0]=="exit":
			return "bear_right"
		else:
			return "turn_right"
	else:
		if gmaps_array[0]=="merge":
			return "merge"
		elif gmaps_array[2]=="left": #i.e. "Take first left"
			return "turn_left"
		elif gmaps_array[2]=="right":
			return "turn_right"
		elif gmaps_array[0]=="exit": #with no side specified, assume right exit
			return "bear_right"
		elif gmaps_array[0]=="continue":
			return "straight"
		else: #Catchall for other commands that I haven't anticipated
			return "don't_know"
My suggestion is that this be used to display an arrow, sort of like this:
 

The Following User Says Thank You to skykooler For This Useful Post: