Best way to connect IMU.
I am trying to create an AGV (Automated Guided Vehicle) prototype, ROS is installed in Raspberry Pi 4B and the motor commands are given via Arduino. How best to connect IMU (MPU9250) to the setup? I am adding IMU for more accurate odometry. Since the Arduino is a single threaded board can it handle both the control of motors and transmit IMU data? Or should I connect it via gpio to the Raspberry Pi?
EDIT: I am using Ubuntu 18.04 64 bit on the Raspberry Pi. I can upgrade to Ubuntu 20.04 but nothing further, since those are the versions supported by ROS.
What serial interface does the IMU use? Using raw GPIO pins is not a good idea because taking an interrupt for every bit is going to kill your cpu performance.
So do you recommend using another Arduino or similar board for IMU?
You didn't answer my question. Typical serial interfaces are I2C, SPI or RS232. If the RPI has an available serial port that matches what the IMU uses, it makes sense to use it.
It uses I2C interface. Does the fact RPI supports I2C mean that connecting via GPIO would be a better idea?