I'm using the indigo-devel branch. When my simulated robot comes to a stop, hector_gazebo_imu very rarely publishes an angular_velocity with x, y, and z components that are NaN. It happens when delta.w (gazebo_ros_imu.cpp, line 264) is (apparently) slightly greater than 1. I added some debugging code that prints the following when rate.x, rate.y, or rate.z is NaN:
delta.w must be slightly greater than 1, at a precision greater than what I used to print the message, because assigning the above values to delta does not result in NaNs. If delta.w is set to 1.00000000001, however, rate is set to (NaN, NaN, NaN).
I'm working around this by clamping delta.w to the range [-1, 1] immediately before the acos(delta.w) line.
I'm using the indigo-devel branch. When my simulated robot comes to a stop, hector_gazebo_imu very rarely publishes an angular_velocity with x, y, and z components that are NaN. It happens when delta.w (gazebo_ros_imu.cpp, line 264) is (apparently) slightly greater than 1. I added some debugging code that prints the following when rate.x, rate.y, or rate.z is NaN:
delta.w must be slightly greater than 1, at a precision greater than what I used to print the message, because assigning the above values to delta does not result in NaNs. If delta.w is set to 1.00000000001, however, rate is set to (NaN, NaN, NaN).
I'm working around this by clamping delta.w to the range [-1, 1] immediately before the acos(delta.w) line.