Using the ultrasonic sensors for navigation is close, but no cigar just yet!
There's an issue due to having no visibility of the corners of the robot that at 45 degrees or so the front wheel can be millimetres from a wall, and the front and side ultrasonics record a fairly big distance (ie >20cm.) This causes the robot to go dead ahead and hit the obstacle! Now this could be coded out but leads to other issues. As the walls are only ~60cm apart, and the robot is 20cm wide, we get into some loops that contain very complex logic, made worse by sensor noise and the lack of any absolute measurements.
As a simple solution, I got some magnetometer sensors to be used as a compass. GY-271's, and used the following code to get them running https://github.com/Slaveche90/gy271compass
I'll admit, I'm a bit disappointed by the performance, although I shouldn't be surprised! I had massively underestimated the EMF being generated by the rover. My assumption I could simply mount it to the outside of my electronics housing may have been somewhat naïve!
However I still have 20cm unused in the robots height allowance, and 28cm if it deploys into this area, so I'm going to mount the compass on a mast and hopefully keep it isolated from the EM noise of the motors and electronics.
Other than that, the robot is largely finished! All that's left are some final cosmetic prints, and some testing/refinement of the code
Thank you all for following so far, I'll get some code posted here when its ready, but right now it would be a disservice to share the work in progress I currently have!!