Skip to content

IMU Angles (new API) vs Camera Angles + Gimbal BUG #1975

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

Open
stavBodik opened this issue May 21, 2019 · 2 comments
Open

IMU Angles (new API) vs Camera Angles + Gimbal BUG #1975

stavBodik opened this issue May 21, 2019 · 2 comments
Labels

Comments

@stavBodik
Copy link

stavBodik commented May 21, 2019

My goal is to get the angles of the camera using IMU with gimbal , I know 2 methods which should give me this info :

float yawCamera, pitchCamera, rollCamera;
VectorMath::toEulerianAngle(image_info.camera_orientation, pitchCamera, rollCamera, yawCamera);

or

float yawCamera1, pitchCamera1, rollCamera1;
msr::airlib::ImuBase::Output imu_data = client.getImuData();
VectorMath::toEulerianAngle(imu_data.orientation, rollCamera1, pitchCamera1, yawCamera1);

The first thing missing is that IMU API (second method) gives the orientation of the body and not of the camera,
In image processing we care about the orientation of the camera not the body.
(the same for accelerations)

The second thing is probably a bug , when using GIMBAL with 100% fixed angles ,
This methods should return the orientation of the camera with respect to the GIMBAL .

"Gimbal": {
"Stabilization": 1,
"Pitch": -90, "Roll": 0, "Yaw": 0
}

This methods should return ~ 0,-90,0 constantly.

*EDIT another bug , from the documentation :

". When any of the angles is omitted from json or set to NaN, that angle is not stabilized (i.e. it moves along with vehicle body)."

when i set the settings as 2 problems :

"Gimbal": {
"Stabilization": 1,
"Pitch": -90, "Roll": 0, "Yaw": NaN
}

Error : cannot read "N"

"Gimbal": {
"Stabilization": 1,
"Pitch": -90, "Roll": 0
}

The image recorded stays with yaw 0 , but the angles from image_info.camera_orientation changes .

@stavBodik
Copy link
Author

No one want to fix it ?

@ACLeighner
Copy link

Ill add that the problem seems to be that simGetCameraInfo returns the camera pose combined with the body pose, so you are getting the camera pose in world coordinates rather than relative to the body. I haven't tried it yet but you might be able to simply subtract the body pose from what simGetCameraInfo gives you. Its on my list of things to try so ill come back if I figure it out.

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

No branches or pull requests

3 participants