Using IMU data to detect ROV collisions

I want the ROV to move backward when it hits a fixed object, so I need to read the IMU data so THAT I can determine whether the ROV hit an object or not. I don’t know which IMU data I can use. I read the following two pieces of data about the IMU.

RAW_IMU {time_usec : 1032607166, xacc : 25, yacc : -18, zacc : -996, xgyro : 0, ygyro : -4, zgyro : -36, xmag : 119, ymag : 161, zmag : 334, id : 0, temperature : 0}
SCALED_IMU2 {time_boot_ms : 1032607, xacc : -20, yacc : -39, zacc : -976, xgyro : -2, ygyro : 7, zgyro : 9, xmag : 0, ymag : 0, zmag : 0, temperature : 0}

Thanks for your reply.

Hi @robotmark,

Have you done any testing? The MAVLink Inspector in QGroundControl allows you to plot data live, and you can also analyse and make plots from your telemetry data files.

I expect any of RAW_IMU, SCALED_IMU2 and VIBRATION should work fine, but you’ll need to choose one and determine reasonable thresholds based on testing with your vehicle and the kind of collisions you’re wanting to detect.

I recommend combining values from different directions to avoid the detection being orientation dependent. You can do that as a vector magnitude calculation, but for collision detection purposes it’s likely sufficient to just add together the values that you’re interested in (making sure to use calibrated sensors, of course).

1 Like

I found the right acceleration using matplotlib, thank you very much.

1 Like