//I have built a robot using the raspberrypi 4 and programmed it with java and maven builder , it responds faster and better then python See Python is good , but in java its smooth , but first you really need to install jdk , check webiste and documentations , after all the setup , you can simply paste my code and connect the peripherals or GPIO according to the given number or you can customize on your own , its completely your choice, hope it helps
one LOve Rasta!