Build a simple robotic vehicle

Hi Guys

My name is Ebra and hope you guys help me with my task in University. The task is to build a simple robotic vehicle, start at A point and move forward until it hits a wall ( point B) and then come back to point A ( where it starts). I have designed the vehicle and try to build it but the main thing is the main task. so can anyone help me with that?
i have many ideas to do that such use a push button infront of the vehicle so when it hits the wall, it presses on the push button and it will move back but i dont know the distance so i can not programme it.
or i should let the vehicle flip when it hits the wall.
reminder. it should be hand controlled. no bluetooth or other things to control the vehicle. just starting it and let go and decide what the vehicle does.

thanks

Ebra

If you can have a microcontroller onboard, it’s a matter of using an encoder, a motor controller and a push button.
The microcontroller would read the encoder counts until the button in pressed, then reverse the motor and count down, hence returning to the original position.
robotshop.com/en/microcontrollers.html
robotshop.com/en/brushed-mot … llers.html
robotshop.com/en/contact-sensors.html
robotshop.com/en/encoder-disks.html

Ex: robotshop.com/en/2wd-beginne … =RB-Elf-42
robotshop.com/en/cytron-simp … =RB-Cyt-39

If you can bump the wall, then add a pair of microswitches on the front. Back away slightly, rotate 180 degrees, then return.