ros-drivers / microstrain_3dmgx2_imu

A driver for IMUs compatible the microstrain 3DM-GX2 and 3DM-GX3 protoco
GNU Lesser General Public License v2.1
16 stars 29 forks source link

PR2 gyro not calibrated(Groovy dist.) #2

Closed Po-Jen closed 10 years ago

Po-Jen commented 11 years ago

Recently, We found that gyro not calibrated after starting PR2. (http://i.imgur.com/u14e6TH.png)

We restarted PR2 for several times, but in the stage of "roslaunch /etc/ros/robot.launch", we got messages: [INFO] [WallTime: 1378216918.856922] Calibrating imu [ INFO] [1378216919.879526152]: Imu sensor not active any more [ INFO] [1378216920.926892010]: Connected to IMU [ Inertia-Link] model [ 4200] s/n [ 4005] options [ 5g 300d/s] [ INFO] [1378216920.926968132]: Initializing IMU time with offset -0.040000. [ INFO] [1378216920.937860218]: Calibrating IMU gyros. [ERROR] [1378216933.070920653]: Imu: calibration check failed: average angular drift = 32.911123 mdeg/sec > 11.459156 mdeg/sec [ INFO] [1378216934.072936843]: IMU sensor initialized. [INFO] [WallTime: 1378216934.086080] Calibrating imu finished [ INFO] [1378216934.101103988]: Initializing Imu sensor [ INFO] [1378216934.101169765]: Imu sensor activated

You can see the whole calibration messages at http://notepad.cc/calibration-message

chadrockey commented 11 years ago

@ahendrix I purposely set this calibration level a little too low so that users had to purposely set the value according to their IMU model and application.

Are you still available to set the PR2's max_drift_rate parameter? It's in radians/second.

Po-Jen commented 11 years ago

We can set the value of max_drift_rate in the launch file to 0.001 (10 times of default value 0.0001). And after setting, no error exists when running "roslaunch etc/ros/robot.launch".

However, we don't know what's the proper value. What should we learn to know how to set the value?

Thanks.

chadrockey commented 11 years ago

You can generally evaluate the performance of your gyro by 1 degree / drift_rate. So in your case, you'll see one degree of IMU rotation error roughly every 3 seconds. Given that the PR2 has wheel odometry and a kalman filter averaging these measurements, this is probably okay. (In a quadrotor it would probably not be okay since there's typically no real odometry, so it's compensated for with either GPS or a compass).

ahendrix commented 11 years ago

@chadrockey I still have access to PR2s and I can set and test new drift rates. What's the proper way to arrive at a good drift rate setting? Is there documentation for this?

As a side note, the migration guide is not clear that this needed to be set or upgraded when updating to Groovy. Has the calibration procedure changed, or is it just the default max_drift_rate that has changed?

chadrockey commented 11 years ago

@ahendrix Run the calibration like 10 or 20 times on various PR2s. Plot out the results and make sure there are no outliers. I'm assuming almost all PR2 initializations are good in terms of fused odometry.

Now, while the PR2 IMU is initializing, bump the PR2 or turn it slightly with the joystick. This will give you a bad calibration. As long as 3x or 5x the good calibration error is less than the 'bumped' calibrations, 3x or 5x * 'good value' will give you a threshold to use. You want it to warn when it has been moved while initializing, but not when it went well.

As for the migration guide, I assumed the PR2 had the best IMU. We had changed the calibration checks to make them more robust to various other errors. The IMU tested must have been either a good specimen or a better unit than the PR2s - the best IMU in the product line should set the calibration threshold. I'm back to hardware-less maintainer mode on this package, so you'll have to let me know what appropriate thresholds are. I'm willing to change the behavior in Hydro forward if you can test an appropriate number of devices.

ahendrix commented 11 years ago

@chadrockey My observation has been that the PR2 gyro calibrates successfully about half of the time, so the threshold value is probably very close. I'll run through the calibration on all of the PR2s we have here and get some baseline calibration data.

ahendrix commented 10 years ago

Data for the four in-house robots that we have (all data in mdeg/sec):

imu_data

Three deviations above the overall mean is 89.632846 (rounded to 90); this should cover most/all units in the field.

If I bump or teleop the robot while it's calibrating, I see drift values >700mdeg/sec, which is way outside of the established spec for a "good" IMU on a bad day.

@chadrockey does this seem reasonable to you?

chadrockey commented 10 years ago

@ahendrix Yeah, that looks great to me. If something does go above 90, it's probably best to warn anyway. Don't forget to convert to radians/second for the parameter.

@Po-Jen Thanks for the report.

ahendrix commented 10 years ago

Gyro rate updated and released into Groovy as pr2_robot 1.5.3, and Hydro as pr2_robot 1.6.6.

Build and sync pending.

Po-Jen commented 10 years ago

@chadrockey Thanks for your answer : )

JorgeCaba commented 9 years ago

I'm working with robot_location and microstrain_3dmgx2_imu. When I launch imu_node i have the same error about calibration, but when i do: rosparam list to show the parameters that i can change, max_drift_rate not shown. Where i have find it? Thanks.