This is a ROS2 driver (written in Python, so expect your RPi to have one core at 50% all the time if you run this) for the MPU9250 Accelerometer, Gyroscope and Magnetometer sensor package. Works alright if the sensor is calibrated. This is a wraper around the nice library form niru-5. He also has some examples and shows how to calibrate the sensor.
ROS2 wrapper around https://github.com/niru-5/imusensor