Planck attitude

General discussion about Celestia that doesn't fit into other forums.
Topic author
asparria
Posts: 5
Joined: 19.02.2007
With us: 17 years 9 months
Location: Spain, EU

Planck attitude

Post #1by asparria » 19.02.2007, 15:08

Hi.

I'm new in the Celestia world so I would like to ask you a couple of questions. I've already seen in the forum you're very nice :)

Where I work we perform some AOCS tests to Herschel/Planck (mostly Planck) and we would like to make some movies and CELX scripts of our results.

Basically, I have a huge file full of quaternions describing Planck's attitude for different phases and I have to display a Planck's 3D model with axis and stuff performing the maneouvres. I've read lots of post regarding reference frames and rotations but I don't have clear if what I'm attempting is feasible.

Planck will be orbiting L2 (the second Lagrangian point) and pointing to the antisun direction. It is spin-stabilized so any change in the attitude is quite complicated, so it's my file full of quaternions.

If it's possible to do this visualization, I can handle to post some nice (public open data) CELX scripts and movies.

I already have one cvs celestia version working and currently I'm learning how to handle celestia itself. Then Lua.

Thanks!
ALIQVANDO BONVS DORMITAT HOMERVS

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #2by chris » 19.02.2007, 22:26

Yet, it is feasible with the latest Celestia 1.5.0 prerelease. Someone involved with INTEGRAL took a file of quaternions representing years worth of attitude data for the spacecraft and used it within Celestia.

For the spacecraft attitude, you just need to provide an ASCII file with time/quaternion pairs. The time is a Julian day number. The attitudes need not be evenly spaced in time. You probably have a file that's already in a format close to this. The default reference frame of a Sun-orbiting object the J2000 ecliptic; you can change easily change this to an equatorial reference frame if that's how Planck's attitude is given.

Do you have heliocentric positions for the spacecraft, or are they relative to L2?

--Chris

Topic author
asparria
Posts: 5
Joined: 19.02.2007
With us: 17 years 9 months
Location: Spain, EU

Post #3by asparria » 20.02.2007, 16:35

Everything is related to L2, actually we suppose Planck is fixed when performing calculations.

Today I managed to create the ".q" file with the time in Julian day, easy. For the orbit I used your example in:

http://shatters.net/forum/viewtopic.php?t=10311&highlight=sampledorientation

I modified it a bit to use the SampledOrientation instead of FixedPosition.

Code: Select all

"Planck" "Sol/Earth"
{
    # Mesh "The mesh file"
    # Radius "The model radius"

    OrbitFrame {
         TwoVector {
            Center "Sol/Earth"
            Primary {
                Type "RelativePosition"
                Axis "x"
                Observer "Sol/Earth"
                Target "Sol"
            }
            Secondary {
                Type "RelativeVelocity"
                Axis "y"
                Observer "Sol/Earth"
                Target "Sol"
            }
        }
    }
SampledOrientation "planck.q"
}


But it doesn't work. I can't select Planck.

I tested INTEGRAL with their ".xyz" and ".q" files and it was amazing. I also experimented with the ".q" file to see a bigger rotation and it worked smooth.

My primary source of knowledge is "The Celestia Notes".

Write you later. I'll try to get it working.[/url]
ALIQVANDO BONVS DORMITAT HOMERVS

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #4by selden » 20.02.2007, 17:58

The specification

Code: Select all

Type "..."

is obsolete. Chris changed it before the prereleases were created. I've now gone through my "Celestia Notes" page and updated all of the older examples to use the newer named block format instead. Sorry for the confusion.

Your SSC file will work if you change it to contain

Code: Select all

"Planck" "Sol"
{
    # Mesh "The mesh file"
    Radius 0.01 # "The model radius"

   OrbitFrame {
         TwoVector {
            Center "Sol/Earth"
            Primary {
                Axis "x"
                RelativePosition {
                  Observer "Sol/Earth"
                  Target "Sol"
                }
            }
            Secondary {
                Axis "y"
                 RelativeVelocity {
                   Observer "Sol/Earth"
                   Target "Sol"
               }
            }
        }
    }

    FixedPosition [ -1500000 0 0 ]

    BodyFrame       { EclipticJ2000     { Center "Sol" } }

   SampledOrientation "planck.q"

    Albedo 1
}

}


The SSC that you posted omitted several required elements. I don't know if the ssc you actually used might have included them.
Specifically:
Radius is required for any body to be drawn.
FixedPosition is required to place the object within the specified OrbitFrame.

Although the BodyFrame value of EclipticJ2000 is supposed to be the default, I tend to include defaults just so there is no confusion.

I've edited the above and verified that it actually works if a valid Quaternion file is in its data directory.
Selden

Topic author
asparria
Posts: 5
Joined: 19.02.2007
With us: 17 years 9 months
Location: Spain, EU

Post #5by asparria » 21.02.2007, 18:53

Thanks!!. I used your code and now I have Planck right in L2. I missed the FixedPosition and the BodyFrame.

However, it doesn't rotate as indicated in the quaternions file, it is just fixed to the OrbitFrame (I took some time to realize it). I have to check my Celestia version, may be it is wrong because it worked for you. I have this two:

http://www.shatters.net/forum/viewtopic.php?t=10528&highlight=0pre2

Currently this CVS (thanx to Phoenix):
http://www.purebytes.de/stuff/celestia/

I've checked the quaternions file and it is correct, the first field is the Julian day, the second is the scalar component of the quaternion, and the rest are the complex part of the quaternion (say x, y, z). I've also checked the coordinate system of the quaternions and it is in the ecliptic plane with X pointing from Sun to Earth, Z perpendicular to the ecliptic, Y completes for a right handed coordinate system.

I used a bunch of 90deg rotations with the INTEGRAL ".xyz" file and it rotates perfectly.

Let me try to explain what I understand so far.

We have defined a new reference that moves together with the Sol/Earth system, center Sol, X pointing from Sun to Earth and it is called OrbitFrame. In the FixedPosition [ -1500000 0 0 ] of the OrbitFrame we draw the 3D model.
Then we define another reference called BodyFrame with center Sol, Z=0 equal to the ecliptic and X pointing to the Sun/Earth vector in the date J2000.
We then define a succession of quaternions that moves the 3D model. This movement is referenced to the BodyFrame.

Well I hope this is correct.

BTW, ultimately I want to superpose the Lissajous to L2, so I think I'd better define first the L2 SSC file and then the Plank SSC file refering to L2. ??What do you think?

I'll try to give you something tomorrow, I don't even know what I'm doing wrong.

... and thanks again for everything :D
ALIQVANDO BONVS DORMITAT HOMERVS

Topic author
asparria
Posts: 5
Joined: 19.02.2007
With us: 17 years 9 months
Location: Spain, EU

Post #6by asparria » 22.02.2007, 14:37

Finally it worked perfectly. I remade the quaternions file. I still don't know what went wrong, probably the ".q" file wasn't correct. I now have a new working one.

here is what I've done:

Code: Select all

"L2" "Sol"
{
   Class "invisible"
   Radius 0.001   

   OrbitFrame {
      TwoVector {
         Center "Sol/Earth"
         Primary {
            Axis "x"
            RelativePosition {
               Observer "Sol/Earth"
               Target "Sol"
            }
         }
         Secondary {
            Axis "y"
            RelativeVelocity {
               Observer "Sol/Earth"
               Target "Sol"
            }
         }
      }
   }
   
   FixedPosition [ -1500000 0 0  ]

   BodyFrame {
      EclipticJ2000 {
         Center "Sol"
      }
   }
}


and this one for Planck:

Code: Select all

"Planck" "Sol/L2"
{
   Class "spacecraft"
   Mesh "planck.3ds"
   Radius 0.03
   
   OrbitFrame {
      BodyFixed {
         Center "Sol/L2"
      }
   }
   
   FixedPosition [ 0 0 0  ]

   BodyFrame {
      EclipticJ2000 {
         Center "Sol/L2"
      }
   }
   
   SampledOrientation "Planck_HCM_1.q"
   
   Albedo 0.7
}


I've tried to use BodyFixed instead of EclipticJ2000 inside Plank's BodyFrame but it didn't give me the right position. I've to study it.

I will try to use a Lua function to define the Lissajous so the Planck's OrbitFrame uses it instead of a BodyFixed one. Else I'll use a SampledOrbit.

Do you know if it is normal that the planets orbits are drawn in front of the satellite model? I would like to see the orbits hided behind the 3D model when appropriate.

Once again thanks for everything. The wikibook is excelent and the Celestia Notes too. If finally I make some documentation I can give it to you.

I'll keep posting with my prorgess.

:wink:
ALIQVANDO BONVS DORMITAT HOMERVS

Topic author
asparria
Posts: 5
Joined: 19.02.2007
With us: 17 years 9 months
Location: Spain, EU

Post #7by asparria » 26.02.2007, 12:08

I would love to see the axis of a body drawn as in this post by Chris:

http://shatters.net/forum/viewtopic.php?p=80271#80271

I don't find any instruction/function/procedure to do so, do you know of any?
ALIQVANDO BONVS DORMITAT HOMERVS

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #8by selden » 26.02.2007, 12:48

Arrows like that require that you provide a 3D model of the arrows and that you orient it correctly within Celestia.

Unfortunately, the internal coordinate system used by CMOD models and the external coordinate system used within Celestia are not yet the same :( so making sure they have the correct relatative orientation is an issue.
Selden

Lunar
Posts: 2
Joined: 22.05.2006
With us: 18 years 6 months

Post #9by Lunar » 24.07.2007, 13:44

Good afternoon Asparria,

I see in your script that you have a 3ds model of Planck? Would it be possible to make the model available to the celestia community?

Kind regards.


Return to “Celestia Users”