Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility issues with Duo driver 1.0.80.20 #3

Open
bheisele opened this issue Nov 29, 2016 · 4 comments
Open

Compatibility issues with Duo driver 1.0.80.20 #3

bheisele opened this issue Nov 29, 2016 · 4 comments

Comments

@bheisele
Copy link

bheisele commented Nov 29, 2016

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
Copy link

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
Copy link
Contributor

ndepal commented Nov 30, 2016

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
Copy link
Author

bheisele commented Dec 2, 2016

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants