Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Settings #24

Open
tbalatka opened this issue Jun 24, 2024 · 1 comment
Open

New Settings #24

tbalatka opened this issue Jun 24, 2024 · 1 comment

Comments

@tbalatka
Copy link

I noticed newly added settings in linorobot2_hardware/config/custom/gendrv_wifi_config.h, see below. Just wondering how these settings relate to the magnetometer settings (//#define MAG_BIAS { 0, 0, 0 })? Or is this information in your Wiki?

Many thanks!

#define ACCEL_COV { 0.01, 0.01, 0.01 }
#define GYRO_COV { 0.001, 0.001, 0.001 }
#define ORI_COV { 0.01, 0.01, 0.01 }
#define MAG_COV { 1e-12, 1e-12, 1e-12 }
#define POSE_COV { 0.001, 0.001, 0.001, 0.001, 0.001, 0.001 }
#define TWIST_COV { 0.001, 0.001, 0.001, 0.003, 0.003, 0.003 }

@hippo5329
Copy link
Owner

hippo5329 commented Jun 26, 2024

To enable magnetometer, you will need to enable madgwick to fuse magnetometer into /imu/data and update the ekf configuration to fuse yaw from magnetometer into /odom.
https://github.com/hippo5329/linorobot2_hardware/wiki#enable-magnetometer

The default the magnetometer settings (//#define MAG_BIAS { 0, 0, 0 }) is before magnetometer calibration. You will need to calibrate magnetometer to remove hard iron bias, mostly from battery, motor, lidar and chassis etc.
https://github.com/hippo5329/linorobot2_hardware/wiki#magnetometer-calibration

The covariance matrix depends on the precision of the sensors. They are usually based on the datasheets. Covariance equals standard deviation squared. The lower covariance, the higher precision. If the sensor is very noisy, we can decrease the ratio of this sensor to fusion by increase the covariance. That is fine tuning.
https://github.com/hippo5329/linorobot2_hardware/wiki#fine-tune-covariance

The covariance matrix for magnetometer may seem odd at first. It is because the unit for magnetometer is Telsa in ROS.

The magnetometer is quite noisy in my robots probably due to the location I mounted it. So I gave a higher covariance and madgwick orientation_stddev:=0.01 in the bring up launch. It would be better to mount the magnetometer on a pole higher away from the interference.

I am new to robotic. All the covariance matrix and magnetometer usage are based on the search and experiments result. I might be wrong..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants