Open bheisele opened 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.
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.
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.
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!
I had to change a few things in your code to make it work with the driver in driverDUOStereo.cpp: