From 4b0337f2c3bd00a888fd842ec2eb6f175fa5e115 Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Sun, 28 Apr 2024 10:07:02 -0700 Subject: [PATCH] README: add mag devices Signed-off-by: Thomas Chou --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 349c94ff..f6e004a0 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,15 @@ Supported IMUs: - **MPU6050** - **MPU9150** - **MPU9250** +- **QMI8658** + +Supported MAGs: + +- **HMC5883L** +- **AK8963** +- **AK8975** +- **AK09918** +- **QMC5883L** ### 4. Connection Diagram Below are connection diagrams you can follow for each supported motor driver and IMU. For simplicity, only one motor connection is provided but the same diagram can be used to connect the rest of the motors. You are free to decide which microcontroller pin to use just ensure that the following are met: @@ -163,6 +172,37 @@ Constants' Meaning: - **USE_MPU9250_IMU** - MPU9250 IMUs. +- **USE_QMI8658_IMU** - QMI8658 IMUs. + +- **USE_HMC5883L_IMU** - HMC5883L MAGs. + +- **USE_AK8963_MAG** - AK8963 MAGs. + +- **USE_AK8975_MAG** - AK8975 MAGs. + +- **USE_AK09918_MAG** - AK09918 MAGs. + +- **USE_QMC5883L_MAG** - QMC5883L MAGs. + +- **MAG_BIAS** - Magnetometer calibration, eg { -352, -382, -10 }. + +If you enable magnetometer device, you will need to enable Magdwick filter by adding "madgwick:=true" in robot bringup. The topic from imu will be named as imu/data_raw. The Madgwick filter will fuse imu/data_raw and imu/mag to imu/data. + + ros2 launch linorobot2_bringup bringup.launch.py madgwick:=true + +Magnetometer calibration should be taken on board with all hardware installed, inlcuding all connectors, battery and motors. The calibration package will rotate the robot slowly for 60 sec. And compute the hard iron bias. More info [here](https://github.com/mikeferguson/robot_calibration#the-magnetometer_calibration-node). + + sudo apt-get install ros-humble-robot-calibration -y + ros2 run robot_calibration magnetometer_calibration + ... + mag_bias_x: 1971.27 + mag_bias_y: -1115.39 + mag_bias_z: -2522.52 + +Update the robot configuration MAG_BIAS. + + #define MAG_BIAS { 1971.27, -1115.39, -2522.52 } + Next, fill in the robot settings accordingly: #define K_P 0.6