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 error on shutdown #1

Closed ahendrix closed 11 years ago

ahendrix commented 11 years ago

I usually see the following error when stopping ROS on the PR2. I believe it's a shutdown problem in the imu driver.

[ WARN] [1374611959.939988898]: 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 /etc/ros/sensors/imu' to see if other processes have the port open. poll failed  [Interrupted system call] (in microstrain_3dmgx2_imu::IMU:read_with_timeout)
chadrockey commented 11 years ago

Does something not respect ros::isShuttingDown()?

This already has an attempted fix: https://github.com/ros-drivers/microstrain_3dmgx2_imu/blob/hydro-devel/src/imu_node.cc#L345

chadrockey commented 11 years ago

Happens on roslaunch, but not rosrun. I suspect that ros::isShuttingDown() doesn't listen to XML RPC shutdown requests.

chadrockey commented 11 years ago

@ahendrix Has the imu started streaming data when you see this? I think it's an issue with shutting down before we've finished initializing and calibrating.

ahendrix commented 11 years ago

Yes; the IMU has finished calibrating and is streaming data when I see this.

$ rostopic echo is_calibrated 
data: True
$ rostopic hz data 
subscribed to [/data]
average rate: 99.987
    min: 0.010s max: 0.010s std dev: 0.00006s window: 100
average rate: 99.998
    min: 0.010s max: 0.010s std dev: 0.00006s window: 200
average rate: 100.001
    min: 0.010s max: 0.010s std dev: 0.00007s window: 300
chadrockey commented 11 years ago

Found the issue, not waiting for long enough to check isShuttingDown(), updated to be 0.10s. Make another issue if this is too large of a wait for a communication error during operation.

Also fixed a similar issue with shutting down during calibration.

https://github.com/ros-drivers/microstrain_3dmgx2_imu/commit/9943ea14308eefcaa1898d571c95a67155c584dc

And released: https://github.com/ros/rosdistro/pull/1522

ahendrix commented 11 years ago

Confirmed; this is no longer happening after the upgrade to 1.5.10.

Thanks Chad!