First of all we can't use actual mortar so I'll be using potato mortar cannon instead
It is easy to build
Now the best part about computers They can be programmed.
Take that old small cnc parts and build a stand x and y axis will now your horizontal and vertical rotation motors
Gyro Stand will be given like those old anti aircraft guns.
hook those stepper motor with it
Now you need to take data from GPS trajectory from PDA or mobile phone as a spotter
Motors will alligned the cannon as per trajectory have been given. it requires many endurance tests before it will be perfected.
That was the old plan which I am not sure why I was working on it
Now the fun part is you can calibrate it with weather station data. With those cheap drone we can build a weather station on one and fly right above the cannon to collect precise wind and moisture data that data will be transmitted to micro controller and it can be programmed to tweak the cannon to slightly left or right according to weather conditions and a target's location. Which requires more testing.
I am posting this here so any one from industry can build one for our troops because it's still illegal for civilians to build a self propelled cannon.
Automatic reloading shells however requires our mechanical engineers.
And yeah it can use any UGV platform scorpion UGV have powered suspensions and support like those mobile cranes it would have been look something like this.

And it can be done with Arduino or raspberry pi.
Peace out.