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

IMU data gather failed #5

Open bshaffer82 opened 9 years ago

bshaffer82 commented 9 years ago

I'm using a microstrain 3dmgx2 imu its actually the "Intertia-Link" version. I'm running ROS indigo on Ubuntu 14.04 with a USB to serial cable.

Everything comes up and works. I can even see the data for a while but after a seemly random amount of time the serial driver seems to hang up and return the same data.

here is the output from ros: [ INFO] [1422723468.589782946]: Connected to IMU [ Inertia-Link] model [ 4200] s/n [ 3582] options [ 2g 300d/s] [ INFO] [1422723468.590137181]: Initializing IMU time with offset -0.040000. [ INFO] [1422723468.600947773]: Calibrating IMU gyros. [ INFO] [1422723480.824537361]: IMU gyro calibration completed. [ INFO] [1422723480.824765044]: IMU sensor initialized. [ WARN] [1422723523.094316058]: Gathering data took 212.464094 ms. Nominal is 10ms. [ INFO] [1422723552.390574657]: Received CHKSM 47542......Expected 6392 [ WARN] [1422723552.390875254]: IMU data gather failed..... [ INFO] [1422723554.391302682]: Received CHKSM 47542......Expected 6682 [ WARN] [1422723554.391475050]: IMU data gather failed..... [ INFO] [1422723556.391799673]: Received CHKSM 47542......Expected 6585 [ WARN] [1422723556.391944104]: IMU data gather failed..... [ INFO] [1422723558.392243863]: Received CHKSM 47542......Expected 6944 [ WARN] [1422723558.492826479]: Exception thrown while trying to get the IMU reading. This sometimes happens due to a communication glitch, or if another process is trying to access the IMU port. You may try 'lsof|grep /dev/ttyUSB0' to see if other processes have the port open. invalid checksum. Make sure the IMU sensor is connected to this computer. [0xB9B6]---[0x1B20](in microstrain_3dmgx2_imu::IMU:receive)

Because the cheksum is always the same I'm assuming the driver is wedging but I'm not sure where in the code to make a change. Also if I re-launch the IMU driver it runs again for a while and then stops with a similar (although different checksum) error.

Thanks for your help.

bshaffer82 commented 9 years ago

I've continued development on this problem and what I've learned is that this driver is super CPU heavy. I haven't yet tracked down the issue but I believe the reason for the errors above is that the CPU on my computer simply can't handle the computation (Its a slighly older intel - M processor)

According to roslist hz the IMU node is running at around 80 hz. Which is interesting because the code seems to want to run it at 100Hz. I artificially limited the speed and the CPU load went down so I guess now its just a matter of tracking down where the problem is in the driver.

Gathering data from a serial port and publishing it should not take more CPU power than gathering data from a Hokuyo laser scanner (which has to produce and publish more data).

If anyone has found the part of the driver using all the resources I'd appreciate the shortcut. Otherwise stay tuned and I'll post a new version of the driver.