Distance, inclination, orientation and as axes are different measurements. Select the appropriate sensor for each sensor and check how to use the data in robot control.
The robot can use ToF to check the obstacle, IMU to monitor the inclination and encoder the position of the mechanism. None of these measurements alone provide the exact location of the entire robot in the space.
Do not combine data from different coordinate systems without conversion. A magnet with an engine or steel structure can affect magnetic measurements.
Select products according to the above criteria; the list is not a confirmation that they are all interchangeable.
Laser TOF module VL53L0X for measuring distances I2C 5v
Gyroscope modules MPU-6050 for Arduino I2C 5V
IMU BNO055 9-DOF absolute orientation sensor
BNO086 Qwiic IMU breakout module for VR and robotics 3 axes
AS5600 Magnetic Encoder Cotter 12bit I2C Module
ESP32 38 pin WIFI IoT Bluetooth
Look
Arduino and ESP32: overview of power supply, signal levels and module connections
Look
EV4300 – instructions for use in Slovene (V2.0)