Here is how I did it in OSMC (it is related to retropie because i have used retrosmc scripts, based on retropie, as a part of the solution):
Install OSMC and SSH into it. Then...
UDPAGRE OSMC TO KODI LEIA
sudo nano /etc/apt/sources.list
(add the following line in the very first line of the file)
deb http://download.osmc.tv/dev/gmc-18 gmc-18 main
(to save the file, press CTRL+O, ENTER, CTRL+X)
wget -qO - http://download.osmc.tv/dev/gmc-18/pubkey.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get dist-upgrade
dpkg -l | grep mediacenter-osmc | awk '{ print $3 }'
(the last command should show OSMC version 17, which has KODI version 18)
INSTALL RETROSMC AND PS3 DRIVERS
cd /home/osmc
wget https://raw.githubusercontent.com/mcobit/retrosmc/master/install-retrosmc.sh .
chmod +x install-retrosmc.sh
./install-retrosmc.sh
Go to "manage packages" > drivers > ps3controller > install from source (wait) > configuration/options > install ps3 controller (clone support gasia) > pair ps3 controller (clone support gasia) (follow instructions) > Then "connect controller through usb", then disconnect usb, and pair via bluetooth… It may not pair yet.
UNBLOCK BLUETOOTH
apt-get install rfkill
rfkill unblock all
hciconfig hci0 up
MAKE JOYSTICK RECONNECT AUTOMATICALLY IN THE FUTURE
sudo su
echo 'SUBSYSTEM=="input",ACTION=="remove",RUN+="/bin/systemctl restart sixad"' >> /etc/udev/rules.d/999-sixad.rules
sudo udevadm control --reload-rules && udevadm trigger
sed -i 's/exit 0//bin/systemctl restart sixad\nexit 0/g' /etc/rc.local
INSTALL EMULATOR ADDONS
From the Kodi 18 (Leia) main menu, click on the Add-ons icon (open box icon). Select Install From Repository, Click on the Kodi Add-on, Repository, Click on Game Add-ons, Select Emulators, From the giant list of emulators you now see, you have to install the ones you wish to use. If you can't find the "Emulators" section, some distros don't compile them. The script install-retrosmc.sh (above) may have some hidden menus to download and install all cores (emulators) in one shot. Give it a try. Also, check under kodi settings "my addons" to see if you don't already have all the emulators installed.
Now, install some other game addon (research about your options!) which uses "Kodi retroplayer" to launch games. It will require some emulators addons (also called libreto cores) to have been downloaded and installed already on kodi.