I would suggest you try and separate your power supplies a bit more:
Do "Star earthing" - that is, take all the earths from one central point. The battery's 0V connector could connect to one central connection somewhere on the machine, and you connect to it the motor driver's earth and the raspi's keeping a reasonable separation between them. So any big return currents from the motor driver more directly to battery negative.
The +V connection could split in two in the same way, with a thick wire to the motor driver, and a thin wire to whatever produces your +5V supply for the raspi. (You don't do this if the raspi is being powered by a separate power supply, but its 0V can still be connected as above)
I'm not an expert in heavy DC currents like yours, but a wiring arrangement like this will at least reduce some of the voltage variations to the raspi, caused by voltage drops in the wiring etc.