- #1
Snark1994
- 18
- 0
I'm trying to write AI code for a program, in which a spaceship has to rotate to face a target. I've somewhat idealised the situation - the ship can yaw, pitch and roll with a maximum angular acceleration along each axis.
I'm representing the rotation of the ship relative to the world reference frame, as well as its angular velocity and acceleration as quaternions - so my code to update the ship is essentially:
executed at each timestep. The question is essentially what value do I need for d2rot (the second differential of the ship's rotation, if that wasn't clear i.e. angular acceleration) in order for the ship to end up pointing in the right direction fairly quickly?
I've found a couple of papers:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.175.5952&rep=rep1&type=pdf seems to be doing what I want, but the maths is above my head and from what I understand of the opening page, the authors are working with matrices, not quaternions.
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19740020927_1974020927.pdf which is a translation of a Russian paper made in the 1970s, and I'm not completely convinced it's trying to solve the same problem.
Thanks for any help / pointers! :)
I'm representing the rotation of the ship relative to the world reference frame, as well as its angular velocity and acceleration as quaternions - so my code to update the ship is essentially:
Code:
d2rot = get_d2rot_somehow()
drot = d2rot * drot
rot = drot * rot
executed at each timestep. The question is essentially what value do I need for d2rot (the second differential of the ship's rotation, if that wasn't clear i.e. angular acceleration) in order for the ship to end up pointing in the right direction fairly quickly?
I've found a couple of papers:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.175.5952&rep=rep1&type=pdf seems to be doing what I want, but the maths is above my head and from what I understand of the opening page, the authors are working with matrices, not quaternions.
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19740020927_1974020927.pdf which is a translation of a Russian paper made in the 1970s, and I'm not completely convinced it's trying to solve the same problem.
Thanks for any help / pointers! :)