Depending on your level of skill, this would likely not be difficult, but could definitely be a quite involved task.
You would need to work from the 'bottom up' from the point of architecture, in that the robot has various subsystems to be interacted with through software, and each of these subsystems needs to ne interfaced with at the hardware level, and then working upwards, present some API that the higher level functions can access.
Many of the things, like steppers and sensors, will already have APIs & libraries in various languages on the Pi, so start by choosing the language that (a) you prefer, and (b) best supports the stuff you need to talk to.
I'm interested to know how this goes for you.
/ Gerry