It is currently Fri, 20-10-17, 17:54 GMT

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu, 20-07-17, 17:05 GMT 
Offline

Joined: Sat, 15-07-17, 17:13 GMT
Posts: 4
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 SPICE-related 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 co-aligned 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


Top
 Profile  
 
PostPosted: Thu, 20-07-17, 18:31 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4496
Location: Hamburg, Germany
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

_________________
Image


Top
 Profile  
 
PostPosted: Thu, 20-07-17, 19:53 GMT 
Offline
User avatar

Joined: Tue, 04-09-07, 21:55 GMT
Posts: 766
Location: N 42.38846 W 83.45456
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/

_________________
"I don't pitch Linux to my friends, I let Microsoft do that for me."
Using OpenSUSE 42.1 & Scientific Linux 6.7


Top
 Profile  
 
PostPosted: Thu, 20-07-17, 21:18 GMT 
Offline

Joined: Sat, 15-07-17, 17:13 GMT
Posts: 4
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!


Top
 Profile  
 
PostPosted: Fri, 21-07-17, 5:06 GMT 
Offline
User avatar

Joined: Tue, 04-09-07, 21:55 GMT
Posts: 766
Location: N 42.38846 W 83.45456
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

_________________
"I don't pitch Linux to my friends, I let Microsoft do that for me."
Using OpenSUSE 42.1 & Scientific Linux 6.7


Top
 Profile  
 
PostPosted: Fri, 21-07-17, 6:39 GMT 
Offline

Joined: Sat, 15-07-17, 17:13 GMT
Posts: 4
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!


Top
 Profile  
 
PostPosted: Sat, 22-07-17, 0:07 GMT 
Offline
User avatar

Joined: Tue, 04-09-07, 21:55 GMT
Posts: 766
Location: N 42.38846 W 83.45456
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

_________________
"I don't pitch Linux to my friends, I let Microsoft do that for me."
Using OpenSUSE 42.1 & Scientific Linux 6.7


Top
 Profile  
 
PostPosted: Sat, 22-07-17, 11:45 GMT 
Offline
User avatar

Joined: Sun, 02-09-07, 23:16 GMT
Posts: 119
Location: Upstate NY, USA
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. :wall: 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.

_________________
Selden


Top
 Profile  
 
PostPosted: Sat, 22-07-17, 13:48 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4496
Location: Hamburg, Germany
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

_________________
Image


Top
 Profile  
 
PostPosted: Mon, 24-07-17, 8:44 GMT 
Offline

Joined: Sat, 15-07-17, 17:13 GMT
Posts: 4
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group