Algorithm for grid with obstacles and movement restriction
You can depict states of the graph as following:
(grid_position,|consecutive_left|,|consecutive_up|)
if you are at state ([2,3],3,0) then you have no other option but to go 
up to ([3,3],0,1)

so you have  n^2 * 4 * 4=16*n^2 states=O(n^2) states.
And you can also save some space by noticing that states such as ([x,y],2,1) are impossible.