ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Best way to connect IMU.

asked 2022-01-12 06:38:55 -0600

androadi gravatar image

updated 2022-01-16 22:34:10 -0600

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.

edit retag flag offensive close merge delete

Comments

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-01-15 10:07:50 -0600 )edit

So do you recommend using another Arduino or similar board for IMU?

androadi gravatar image androadi  ( 2022-01-16 22:23:24 -0600 )edit

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-01-17 07:34:30 -0600 )edit

It uses I2C interface. Does the fact RPI supports I2C mean that connecting via GPIO would be a better idea?

androadi gravatar image androadi  ( 2022-01-18 02:36:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-15 05:38:56 -0600

crnewton gravatar image

I'd recommend to ditch the Arduino and connect the IMU and motor controllers directly to your RPI. This way you don't have to implement arduino<->ROS communication (rosserial), so less work, and a cheaper setup. You can utilize ROS to handle control of motors and transmit IMU data, this wouldn't be a problem to do with Arduino but now you can keep everything inside ros nodes (easier to manage, easier to debug).

But keep in mind that there is no 'should'. There are also a lot of posts on this forum about arduino-ros communication and implementation.

edit flag offensive delete link more

Comments

But from hearing the advise of others and my own personal experience, using GPIO pins on Raspi is highly discouraged. Also I am using Ubuntu 18.04 64 bit on it. I can upgrade to Ubuntu 20.04 but nothing further, since those are the versions supported by ROS.

androadi gravatar image androadi  ( 2022-01-16 22:32:48 -0600 )edit

What's wrong with the Raspberry Pi GPIO? maybe for specific usecases it doesn't meet requirements, but the raspberry pi isn't so popular for no reason..

crnewton gravatar image crnewton  ( 2022-05-24 02:38:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-12 06:38:55 -0600

Seen: 555 times

Last updated: Jan 16 '22