http://forum.celestialmatters.org/ 

Spacecraft pitch, yaw and roll using SPICE http://forum.celestialmatters.org/viewtopic.php?f=2&t=909 
Page 1 of 1 
Author:  zamo2k [ Thu, 200717, 17:05 GMT ] 
Post subject:  Spacecraft pitch, yaw and roll using SPICE 
Hello everybody, this is my first post, so I hope I'm in the right place I'm trying to learn how to use the CSPICE Toolkit for some "simple" calculations. I saw several SPICErelated posts in the forum... so I hope there's some SPICE expert around that can help me with this. I'm using Mars Reconnaissance Orbiter data, and I would like to reproduce the following: "Spacecraft pitch angle in the reference frame with the Z axis coaligned with the center of Mars/spacecraft position vector and the X axis in the plane containing the Z axis and the spacecraft velocity vector w.r.t. Mars." The same for yaw and roll. I read the SPICE documentation and tried several functions but I must say I don't really understand sufficiently all the things behind the calculations, and I would need some more focused starting point. Can anybody help me somehow on this? Many thanks in advance! Regards 
Author:  t00fri [ Thu, 200717, 18:31 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
Hi zamo2k, welcome at our Celestial Matters site! I am sure our Spice expert John Van Vliet will provide to you exhaustive info about your Spice questions. Fridger 
Author:  John Van Vliet [ Thu, 200717, 19:53 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
at this time i do not have a set up for MRO ftp://naif.jpl.nasa.gov/pub/naif/pds/da ... 1000/data/ however if you look at "juno" viewtopic.php?f=18&t=846 the spice rotation section there are a few things ALL of the spacecraft need the leapsecond file "naif0012.tls" ftp://naif.jpl.nasa.gov/pub/naif/pds/da ... /data/lsk/ the spacecraft location definitions "juno_v08.tf" ( the mro is "mro_v15.tf" ) ftp://naif.jpl.nasa.gov/pub/naif/pds/da ... 0/data/fk/ you also NEED the spacecraft main frame of reference this is in the tf text file for MRO BIG TEXT FILE!!!! ftp://naif.jpl.nasa.gov/pub/naif/pds/da ... mro_v15.tf it is "MRO_SPACECRAFT" then the current spacecraft clock readings for mro "mro_sclkscet_00064_65536.tsc" ftp://naif.jpl.nasa.gov/pub/naif/pds/da ... data/sclk/ then the spacecraft rotational data ( the *.bc) ftp://naif.jpl.nasa.gov/pub/naif/pds/da ... 0/data/ck/ 
Author:  zamo2k [ Thu, 200717, 21:18 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
Hi! Thank you Fridger for the welcome and John for the reply! I think I already have all the kernels needed to compute what I'm asking (the definition of pitch, yaw and roll of my first post). The point is that I cannot understand how to calculate it. Do you know which functions should I use for that? I found Code: spkezr_c and Code: pxform_c but I don't understand how to use/combine the results I obtain in order to compute what I need.Thanks again in advance for your help! 
Author:  John Van Vliet [ Fri, 210717, 5:06 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
you have worked through the tutorials ? https://naif.jpl.nasa.gov/naif/tutorials.html tutorial #20 is using the ck rotation data some hands on programing lessons https://naif.jpl.nasa.gov/naif/lessons.html https://naif.jpl.nasa.gov/pub/naif/tool ... s/Lessons/ if you are using C api and other docs https://naif.jpl.nasa.gov/pub/naif/tool ... index.html the rotation matrix is what you need "pxform_c" see: https://naif.jpl.nasa.gov/pub/naif/tool ... rames.html 
Author:  zamo2k [ Fri, 210717, 6:39 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
Hello John, good to know that I was on the right way. Yes, I already had a look at the tutorials and I can already compute some stuff (spacecraft position wrt Mars, subpoint on the ellipsoid, etc.). There I also found the reference to the function Code: pxform_c and I already tried to use it.My points are:  what are the "from" and the "to" reference systems to be given in input to the function? I supposed "from" is the reference centered on Mars, and "to" is the spacecraft frame  if I'm right, I obtain a 3x3 matrix but I don't understand how to get out from it the pitch/yaw/roll angles as described in my first post. I tried with some "standard" formulas I found on internet, but I think they do not correspond to that definition. Thank you again for your support and patience! 
Author:  John Van Vliet [ Sat, 220717, 0:07 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
matrix math has always given me a hard time ( i ended up just programming my HP 15C i had back in school  still have ) i would expect the from to be mars equatorial plain and not the the mars physical center ( there is only 22 cm difference from the barycenter ) t00fri or selden might be better at matrix math than i am 
Author:  Selden [ Sat, 220717, 11:45 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
Sorry, not me. I tend to use trig. There are two standards for specifying which elements are rows and which are columns in matrices. One orientation is used in physics and engineering. My undergraduate instructor in linear algebra was a mathematician who used the other orientation. Ever since then I've had serious problems when trying to visualize any calculations which use matrices. I continue to be extremely pissed about that. 
Author:  t00fri [ Sat, 220717, 13:48 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
Usually, in computer science one prefers Quaternions to the Rotation matrix calculus, since the former require fewer operations per rotation compared to using othorgonal matrices. Not knowing about your math background, I suggest you might also have a look at WolframMathWorld concerning rotation matrices : https://www.google.de/url?sa=t&rct=j&q= ... sL94PP8Wg Notably Celestia/celestia.Sci work also with Quaternions throughout. Since I am unfortunately short of spare time, here is a useful discussion about the relation between Rotation matrixes and Quaternions. https://www.google.de/url?sa=t&rct=j&q= ... GQFANSIo_g There are plenty of examples, too. Hope these links are useful for you., Fridger 
Author:  zamo2k [ Mon, 240717, 8:44 GMT ] 
Post subject:  Re: Spacecraft pitch, yaw and roll using SPICE 
Hello everybody! Thank you for your suggestions. I'm glad I'm not the only one fighting with rotations I read that SPICE also can use quaternions. Let's see! Thanks again! 
Page 1 of 1  All times are UTC 
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ 