ethz-ait / duo_vio

Duo-VIO: Fast, Light-weight, Stereo Inertial Odometry
Other
75 stars 50 forks source link

Compatibility issues with Duo driver 1.0.80.20 #3

Open bheisele opened 7 years ago

bheisele commented 7 years ago

I had to change a few things in your code to make it work with the driver in driverDUOStereo.cpp:

  1. change EnumerateResolutions to EnumerateDUOResolutions, and GetLibVersion to GetDUOLibVersion
  2. convert angular velocities from deg. to rad. and invert the z-component: original version: imu_msg.angular_velocity.x = +pFrameData->IMUData[i].gyroData[0]; imu_msg.angular_velocity.y = -pFrameData->IMUData[i].gyroData[1]; imu_msg.angular_velocity.z = +pFrameData->IMUData[i].gyroData[2]; replace with imu_msg.angular_velocity.x = +pFrameData->IMUData[i].gyroData[0] 0.017453293; imu_msg.angular_velocity.y = -pFrameData->IMUData[i].gyroData[1] 0.017453293; imu_msg.angular_velocity.z = -pFrameData->IMUData[i].gyroData[2]* 0.017453293;
jasonwurzel commented 7 years ago

good points, I had to change them as well. Additionally, didn't you have to change the acceleration signs as well to -x, y, -z: imu_msg.linear_acceleration.x = -pFrameData->IMUData[i].accelData[0]*9.80665; imu_msg.linear_acceleration.y = pFrameData->IMUData[i].accelData[1]*9.80665; imu_msg.linear_acceleration.z = -pFrameData->IMUData[i].accelData[2]*9.80665;

this would also be in line with what duo3d support replied to me after asking them about the imu-cam extrinsics:

On the DUO MLX, the IMU chip is mounted upside down with the following orientation with regards to camera coordinate system (-1, 1, -1). Meaning you have to negate x and z axis or rotate chip along y axis by 180 degrees.

I don't really get why we have to change the gyro signs to +x,-y,-z then, but observing the system in action, it seems to be correct.

ndepal commented 7 years ago

We have also had to change sings of the individual IMU measurements several times when we updated the DUO drivers/firmware. It seems like the signs need to be checked whenever the driver/firmware is updated.

bheisele commented 7 years ago

signs for accel and gyro should be the same: +, -, -. This agrees with the ros-wrapper code provided by duo manufacturer: https://github.com/duo3d/duo3d_driver/blob/master/src/duo3d_driver.cpp (lines #408-414)

the directions of the axes are (for upright cameras w. optical axes parallel to ground): x from left to right camera, y down, z forward.

YacongWang commented 6 years ago

I have found the sign of acc and gyro in the driver should be corrected as +, -, +, and then the extrinsic for the cam-imu will be (1, 1, 1), for the IMU frame is left-hand convention when you check the positive directions of X, Y and Z axes of IMU. That's important to check the positive direction of IMU frame!