Added IMU to my diffbot #59
Replies: 1 comment 2 replies
-
Thank you @joeuser846 for sharing, this is very useful! I will hopefully soon integrate the IMU as well. Very interesting to know that this "high level" approach (connecting the IMU directly to the SBC) works well for you! An alternative way I planned to do it is to connect the IMU to the micro controller (Teensy in my case), use a suitable low-level library and finish implementing the main.cpp script of the diffbot/diffbot_base/scripts/base_controller/src/main.cpp Lines 53 to 71 in 2f154a8 However, I might as well start out with the high level method. Could you also please share some details on how much effort it was to tune |
Beta Was this translation helpful? Give feedback.
-
Thought you might be interested that I successfully added an IMU to my diffbot using the Adafruit BNO055 breakout board. This board supports I2C to the Rpi or Jetson Nano on the diffbot and works with this driver. Just be sure to follow the instructions here if using a Rpi.
I then use robot_localization to fuse the odom from ros_control as implemented in diffbot with the IMU. I basically tell robot_localization to ignore yaw input from the motor encoders and substitute yaw from the IMU data. It beautifully fixes the really bad odom from my tank/track based diffbot variant. Tracked vehicles have a major problem with slipping when turning that makes pure encoder odom pretty useless.
I was hung-up for a while trying to get the new transform tree sorted until I discovered a parameter in diffbot_control .yaml that allows you to suppress publishing of the base_footprint -> odom transform which then permits robot_localization do it instead without any conflicts. This fixed my final problem:
I can now drive and navigate around with very good accuracy despite the inevitable track slippage.
Beta Was this translation helpful? Give feedback.
All reactions