The roll (and all other IMU data fields) appear to start at 0 degrees, as that is their default value until the IMU produces a reading. Typically, the second you move, shake, or otherwise change the state of the IMU, it starts to calibrate itself into a nominally working state. What you are likely seeing with the 5 degree error is that you haven’t mounted the sensor perfectly horizontally with respect to the roll axis.
Back in October, I wrote a small plugin/command that allowed you to zero the roll and pitch from the cockpit, but I don’t think I ever merged it into the current release. I’ll find that code and merge it into the 30.0.4 release that we are currently working on and that will allow you to hit a key on the keyboard to zero your IMU at will. In the new feature release that we are working on (30.1.x), we will also be adding a way to save these settings for your vehicle so those offsets are by default loaded at runtime. I’ll provide instructions here soon for getting those updates.
In the mean time, if you want to manually adjust for that error, you can do this at lines 300-303 in CMPU9150.cpp:
NDataManager::m_navData.PITC = ( MPU.m_fusedEulerPose[VEC3_Y] * RAD_TO_DEGREE ) + <pitchErrorOffset>;
NDataManager::m_navData.ROLL = ( MPU.m_fusedEulerPose[VEC3_X] * RAD_TO_DEGREE ) + <rollErrorOffset>;
In your case, with an error of 5.0 degrees:
NDataManager::m_navData.ROLL = ( MPU.m_fusedEulerPose[VEC3_X] * RAD_TO_DEGREE ) + (-5.0f);
If you are using the BNO055 (OpenROV’s IMU2), your change would be at the bottom of CBNO055.cpp as such:
NDataManager::m_navData.PITC = euler.z() + <pitchErrorOffset>;
NDataManager::m_navData.ROLL = -euler.y() + <rollErrorOffset>;
Let me know if you have any further issues and look out for the updates.