-
Notifications
You must be signed in to change notification settings - Fork 2
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
Gimbal Convention #30
Comments
I've been reading the SimpleBGC 32bit software user manual. A few things jumped out at me. On page 46:
Looking at the hardware: I can see that:
Therefore we have a Camera →PITCH →ROLL →YAW →Frame gimbal. With that in mind, on page 101 it says:
So it looks like the gimbal accepts As a side note: there is bug in PX4 related to gimbals like ours. When pitch is +/-90 degrees there is gimbal lock. We're probably going to want to merge this fixes ASAP: PX4/PX4-Autopilot#19951 But until that fix is applied, I take it that our quaternion is converted into Euler angles using the 3-2-1 convention. And I'm not sure what to say about the problems in this video: I think the worst case scenario would be us having to send With all that said, the software manual helped us constrain the possible gimbal conventions: For the neutral orientation, it looks like the yaw angle is relative to the [body] frame. It also seems like the a roll and pitch angles are indeed "absolute" For the axes of rotation:
If we go by our experiments then it's probably true that:
But please correct me if I'm wrong. Also it looks like the community needs an open source gimbal controller because STORM32 and SimpleBGC still use Euler angles and that's causing issues. |
We should consider enabling the |
@n-snyder may take note of this. |
Everyone, I discussed the gimbal configuration with SD (Nate and Adam) today to find out if there were any reference documents behind their decisions for how to configure +ve and -ve for yaw, pitch, and roll. There are no reference documents. What I think this might mean is that if we want DR to be sufficiently flexible to work with diverse gimbal configurations, we might need some sort of configuration file that tells us how the currently installed gimbal is configured. @murphym18 how hard would it be to integrate configuration information into the math calculations? |
I created https://github.com/DroneResponse/DR-OnboardAutonomy/issues/125 with my thoughts on how we might integrate gimbal configuration. So long as the SD-HX10 gimbal can accept a quaternion, then the approach I described there seems like it will work. But are we sure we can send a quaternion? This video at 45 seconds shows a problem: https://drive.google.com/file/d/1T53yEPoDFjyx29tSguazxO6zlD1KEMAp/edit Was the problem caused by the wires getting twisted? Or is there something wrong with our code? There is a known bug in PX4 that effects our gimbal. We're probably going to want to cherry pick PX4/PX4-Autopilot#19951 or update PX4 after they merge it. But this bug should not have caused the problem in the video. |
Thank you for sharing this video. There are acceptance tests that we perform for the gimbal (without using quaternions), and I'll ensure that ours includes combined pitch and yaw with angles similar to this. |
thank you @n-snyder In case it’s helpful, the gimbal is yawing left 90 degrees and pitching up 45 degrees |
@JaneClelandHuang, I fixed the issue where the gimbal seemed to point upward all the time. The issue was that the knob on the RC for pitch was slightly out of calibration, so that the center position was demanding upward pitch. I calibrated the RC knob on the Taranis, and in PX4 I added deadzone to the channel controlling pitch. I have an improvement to this fix planned for the next set of aircraft. I suspect that the issue in the video that @murphym18 posted is unrelated. |
We were discussing the convention of the gimbal and I am copying some of the things we discussed for reference:
I had a confusion about the convention the gimbal and Gazebo are having and then @murphym18 said this:
So far I’ve seen three conventions (but six are possible):
The “pitch” axis points right.
The “roll” axis points backwards.
The “yaw” axis points down.
However, This webpage does not specify a vector for any of the axes. So we don’t know what direction the vector (1, 0, 0) maps to.
My best guess is that (1, 0, 0) is the roll access, (0, 1, 0) is the yaw axis and (0, 0, 1) is the pitch axis. But that could be wrong. In fact, they list yaw first. So if we assume that (1, 0, 0) is yaw, and we apply right hand rule, then (0, 1, 0) is the pitch axis and (0, 0, 1) points backwards… I’m not sure.
the x-axis points backwards? (b/c -1 * forward == backwards)
the y-axis points left? (b/c -1 * right == left)
the z-axis points up? (b/c -1 * down == up)
I have seen some evidence that this Interpretation might be correct:
PX4 issue #19933 - gimbal orientation broken in case of pitch == -90 and yaw != 0
Specifically, I’m referring to this image from the github issue:
The axes are labeled with blue rotation arrows. And I think the side with the blue label is the positive direction. If this is the case, then my interpretation above seems correct (x=backwards, y=left, z=down). But I wouldn’t say this is strong evidence.
The core question
For me, it would be most helpful if we could answer the following questions:
Then at some point, @murphym18 said this:
According to the gimbal controller:
I think, the answers are:
They said on the phone that the gimbal frame doesn't follow the drone's body frame exactly. Nate gave a good reason as to why: The gimbal tries to keep the camera level with the horizon where down in the image points towards the ground. And to do so, the gimbal updates its orientation very quickly using an IMU. This way the video will look stable even if the drone is moving around. This is good because if we had to command the gimbal to keep the image level with the horizon, then we'd record worse video because our sensor data is older and our commands arrive later. The controller has the newest data since it's connected to the sensors and its commands arrive earlier because it's directly connected to the motors.
Then at some point, I made the following assumption which may not be accurate:
Okay, then just to confirm, this is the Gazebo convention and drone is the exact opposite:
roll (+ angles=rotate right, - angles=rotate left)
pitch (+ angles=look up, - angles=look down)
yaw (+ angles=turn right, - angles=turn left)
So, drone is:
roll (- angles=rotate right, + angles=rotate left)
pitch (- angles=look up, + angles=look down)
yaw (- angles=turn right, + angles=turn left)
The drone should match Ankit's simulator's convention however.
Then @murphym18 replied to that:
I think it's confusing to say that the gimbal convention for gazebo is opposite from the SD-HX10 convention. And I don't think Ankit's convention is the same as the SD-HX10's convention.
To describe each gimbal convention we need to know:
The neutral orientation. This is how the neutral frame moves with the drone.
The spatial direction of each principal axis. We know this property when we can point in the direction of the "roll," "pitch," and "yaw" axes
The numerical vector associated with each principal axis. We know this property when we can assign numbers to the roll pitch and yaw axes.
For the SD-HX10 gimbal convention
The neutral orientation follows the body frame of the drone partially (the gimbal frame moves when the drone changes its compass heading)
spatially: It seems like roll is around the "backwards" axis, pitch is around the "left" axis, and yaw is around the "up" axis.
numerical: the roll axis is (1, 0, 0), the pitch axis is (0, 1, 0) and the yaw axis is (0, 0, 1)
For the Gazebo gimbal convention
The neutral orientation follows the body frame exactly
spatially: the roll axis points forward, the pitch axis points right, the yaw axis points down (this one property might be opposite from the SD-HX10, however)
numerically: the roll axis is (1, 0, 0), the pitch axis is (0, 1, 0), the yaw axis is (0, 0, 1)
For the convention Ankit showed us, I don't have much information. I have this link: https://compsci290-s2016.github.io/CoursePage/Materials/EulerAnglesViz/
From this link, I can say:
It looks like the neutral orientation follows the body frame exactly. Is this true?
spatially: roll axis points backwards, the pitch axis points right, the yaw axis points down
numerically: I have no information. But I would guess that the roll axis is (1, 0, 0), the pitch axis is (0, 1, 0) and the yaw axis is (0, 0, 1)
It seems like there are differences between all three conventions.
The text was updated successfully, but these errors were encountered: