Linorobot2 Compass / Magnetometer

198 views
Skip to first unread message

Kim Olesen

unread,
Jan 20, 2022, 3:57:09 AM1/20/22
to LINOROBOT
Is the Compass / Magnetometer not working in Linorobot2 ? Don't see any data in imu topic.
Could be a fake MPU9250 as it's I2C address is wrong...

Best regards    
 

Logan Naidoo

unread,
Jan 24, 2022, 7:45:07 AM1/24/22
to LINOROBOT
in this design of linorobot2, the imu is physically connected to the microcontroller's i2c pins.  its data is published on topic /imu/data over the micro-ros link back to the Ros2 platform running on your chosen SBC (RPi | Jetson Nano | laptop or other).
to test the receiving of imu/data you can $ros2 topic list to check if /imu/data exists as a topic.  you can then view the topic data by $ros2 topic echo /imu/data. You can then tilt your robot in various 3D planes (XYZ) and check if the data values change.
normally Z = 9.8m/s/s and if you tilt completely along X-axis then X=9.8m/s/s. this will confirm the IMU is reading the gravity acceleration correctly.

If you dont get any /imu/data readings then there is something connected incorrectly or your choice of (IMU) driver is not correct in your config file.

The imu/data is merged with wheel-encoder data via the EKF.yaml configuration file which then produces a more accurate fusion of both sets of information to estimate the POSE of the robot.
I feel the currect configuration of using wheel-encoder velocities, instead of distance, is a decision taking by the designer of linorobot/2 and this does have its pros' and con's. But to change this you need to goto the firmware and change the underlying kinematic formulae used to calulate wheel motion in either velocity or distance and then got back and change the EKF.yaml file for correct fusion of the datasets.

hope this helps.

Kim Olesen

unread,
Jan 24, 2022, 12:54:31 PM1/24/22
to LINOROBOT
Hi

IMU is working but orientation data is always 0,0,0.. Gyro and Accelerometer is working. I can't see any code in Linorobot2 firmware that support Orientation data, Library's is there but not used..
Hope there be a future fix :-) i think this is needed when running gps navigation.


header:
  stamp:
    sec: 1643046675
    nanosec: 242000000
  frame_id: imu_link
orientation:
  x: 0.0
  y: 0.0
  z: 0.0
  w: 0.0
orientation_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
  x: -3.315196276011553
  y: -0.048059839053502036
  z: -4.3658711578739755
angular_velocity_covariance:
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
linear_acceleration:
  x: 2.4213648496661335
  y: -8.514294797787443
  z: 5.942043711198494
linear_acceleration_covariance:
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06

Best regards

Kim Olesen

unread,
Jan 24, 2022, 3:49:38 PM1/24/22
to LINOROBOT
MPU9250 magnetometer is 3DOF (xyz) and Orientation is in Quaternions, so xyzw need to be calculated,  any ideas ?. 
And can it be done without calibration..

best regards  
Reply all
Reply to author
Forward
0 new messages