Playing with robots for kids - Which letter will I reach? TL;DR: Given an array of chars and a robot in a starting position of the array, write an algorithm than can read a string with movements (F for "go forward", R for "rotate 90 degrees right" and L for "rotate 90 degrees left") and calculate the ending position of the robot. More details in the complete text.


We have at home a very simple programmable device for kids: a small vehicle with buttons to make the vehicle go forward, turn 90 degrees left or turn 90 degrees right. Something similar to this:



We also have a foam mat with letters like this:



The purpose of all this is to teach the kids both the alphabet and the rudiments of programming, all at once.

The challenge

Suppose we have randomly arranged our foam mat like this:

+---+---+---+---+---+---+---+
| E | R | L | B | I | X | N |
+---+---+---+---+---+---+---+
| O | A | Q | Y | C | T | G |
+---+---+---+---+---+---+---+
| F | W | H | P | D | Z | S |
+---+---+---+---+---+---+---+
    | K | V | U | M | J |   
    +---+---+---+---+---+
            |   |
            +---+


Suppose also we have modified the vehicle so that when we program a "go forward" command, the vehicle goes forward exactly size of one square in the mat. So, if the vehicle is in the U square and goes north, it stops exactly in the P square.

The instructions are all given to the vehicle before it starts to move, and those are:


F: The vehicle goes forward into the next square.
R: The vehicle turns 90 degrees right in its place (no further movement).
L: The vehicle turns 90 degrees left in its place (no further movement).


Once the instructions are given, you can press the "GO" button and send the vehicle to a given position as it will follow every instruction in the given order. So, you can tell the kid to insert the needed instructions for the vehicle to go to a given letter.

You must write the shortest program/function that processes a string (input parameter) with a set of instructions and calculates the letter the vehicle stops over (output string).

Details:


The vehicle always starts at the blank square at the bottom, and facing north (towards the U square).
The input string will contain only the letters F, R, L and G (for the "go" button). You can use lowercase letters for the mat and the instructions, if you prefer so.
The algorithm must obey every instruction in the string before the first G (every instruction after that is ignored as the vehicle has started moving).
If the vehicle goes out of the mat at any given moment (even if the input string has not been completely processed), the algorithm must return the string Out of mat.
If not, the algorithm must return the letter the vehicle has stopped over. The starting point counts as a  char (or an empty string).


Examples:

Input: FFG
Output: P

Input: FRFRFG
Output: Out of mat

Input: RRFFG
Output: Out of mat

Input: FFFRFFLFG
Output: X

Input: FFFRFFLF
Output:      &lt;-- Nothing or a whitespace (the robot has not started moving)

Input: FFFRRFFFG
Output:      &lt;-- Nothing or a whitespace (the robot has returned to the starting point)

Input: RRRRRLFFFLFFRFRFGFFRRGRFF
Output: L    (Everything after the first G is ignored)


This is code-golf, so may the shortest program for each language win!
JavaScript (ES6), 194 176 169 163 bytes
Saved some bytes thanks to @Luke and @Arnauld.
s=&gt;(p=35,d=3,t='ERLBIXN1OAQYCTG1FWHPDZS11KVUMJ11111 11',[...s].every(i=&gt;i=='L'?d--:i&gt;'Q'?d++:i&lt;'G'?+t[p+=[1,8,-1,-8][d%4]]||!t[p]?p=1/0:p:0)?'':t[p]||'Out of mat')

Ungolfed:
s=&gt;(
  p=35,
  d=3,
  t='ERLBIXN1OAQYCTG1FWHPDZS11KVUMJ11111 11',
  [...s].every(i=&gt;i=='L'?d--:
                  i&lt;'Q'?d++:
                  i&lt;'G'?+t[p+=[1,8,-1,-8][d%4]]||!t[p]?p=1/0:p:
                  0
              )?'':
               t[p]||'Out of mat'
)



f=
s=&gt;(p=35,d=3,t='ERLBIXN1OAQYCTG1FWHPDZS11KVUMJ11111 11',[...s].every(i=&gt;i=='L'?d--:i&gt;'Q'?d++:i&lt;'G'?+t[p+=[1,8,-1,-8][d%4]]||!t[p]?p=1/0:p:0)?'':t[p]||'Out of mat')

console.log(f('FFG')); //P
console.log(f('FRFRFG')); //Out of mat
console.log(f('RRFFG')); //Out of mat
console.log(f('FFFRFFLFG')); //X
console.log(f('FFFRFFLF')); //(space)
console.log(f('FFFRRFFFG')); //(space)
console.log(f('RRRRRLFFFLFFRFRFGFFRRGRFF')); //L
console.log(f('FFFFFRRFG')); //Out of mat