BodyFrame for ScriptedRotation

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

BodyFrame for ScriptedRotation

Post #1by mjoubert » 05.04.2007, 10:26

Hi all,

I use ScriptedRotation to send solar panel attitude. Usually, it's given in local frame. Follow the corresponding ssc definition :

ScriptedRotation
{
Module "rtorbits"
Function "rtattitude"
ObjectID "SOLARPANEL"
}
BodyFrame { BodyFixed { Center "Sol/Earth/MySpacecraft" } }


However, attitude reference frame seems to be J2000 (Earth centered). So I'm currently using a quaternion product to display solar panels properly.

My question is : Is this the expected behaviour? (maybe it's not possible to use a different frame than J2000)

Mathieu (spacebel)

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

Post #2by selden » 05.04.2007, 10:55

Your example uses a BodyFrame declaration which uses J2000.

Have you tried other BodyFrame declarations?

See http://en.wikibooks.org/wiki/Celestia/R ... e_property
Selden

Topic author
mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

Post #3by mjoubert » 05.04.2007, 11:44

Hi Selden,

None of other BodyFrame is correct.

When sending quaternion 1 0 0 0 to solar panel object, I'd it to "stick" the spacecraft is refering to. I cannot find a ssc definition that provide this behaviour with ScriptedRotation.

Thank you for your answer.

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

Post #4by chris » 05.04.2007, 17:03

Mathieu,

What you are doing should be working. The attitude reference frame should be the body fixed frame of the spacecraft. It's possible that there's some strange interaction between ScriptedRotations and reference frames. I will have a chance to test this case later today. It would be useful to see the complete ssc file that you're using.

--Chris

Topic author
mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

Post #5by mjoubert » 06.04.2007, 09:37

Code: Select all

"MySpacecraft" "Sol/Earth"
{
   Class "spacecraft"
   Mesh ""
   Radius 0.00205
   ScriptedOrbit
   {
      Module   "rtorbits"
      Function "rtposition"
      ObjectID "SATID"
      BoundingSphereRadius 10000
   }
   ScriptedRotation
   {
      Module   "rtorbits"
      Function "rtattitude"
      ObjectID "SATID"
   }
   OrbitFrame { EquatorJ2000 { Center "Sol/Earth" } }
   BodyFrame { EquatorJ2000 { Center "Sol/Earth" } }
}

"MySpacecraft-mesh" "Sol/Earth/MySpacecraft"
{
   Class "spacecraft"
   Mesh "MySpacecraft_BODY.3ds"
   Radius 0.00205
   Albedo 0.7
   FixedPosition [-0.00198 -0.000115 0.0]
   OrbitFrame { BodyFixed { Center "Sol/Earth/MySpacecraft" } }
   FixedRotation { }
   BodyFrame { BodyFixed { Center "Sol/Earth/MySpacecraft" } }
   
}

"MySpacecraft-solarpanel" "Sol/Earth/MySpacecraft"
{
   Class "spacecraft"
   Mesh ""
   Radius 0.004823
   Albedo 0.7
   FixedPosition [-0.000855 0.0 0.0]
   OrbitFrame { BodyFixed { Center "Sol/Earth/MySpacecraft" } }
   ScriptedRotation
   {
      Module   "rtorbits"
      Function "rtattitude"
      ObjectID "SATID-sp"
   }
   BodyFrame { EquatorJ2000 { Center "Sol/Earth/MySpacecraft" } }
}

"MySpacecraft-solarpanelmesh" "Sol/Earth/MySpacecraft/MySpacecraft-solarpanel"
{
   Class "spacecraft"
   Mesh "MySpacecraft_solarpanel.3ds"
   Radius 0.004823
   Albedo 0.7
   FixedPosition [-7e-05 0.0 0.0]
   OrbitFrame { BodyFixed { Center "Sol/Earth/MySpacecraft/MySpacecraft-solarpanel" } }
   FixedRotation { }
   BodyFrame { BodyFixed { Center "Sol/Earth/MySpacecraft/MySpacecraft-solarpanel" } }
   
}

Topic author
mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

Post #6by mjoubert » 10.04.2007, 10:23

If I replace SriptedRotation by SampledOrientation, everything works well.

So this problem is probably linked to ScriptedRotation.


Return to “Development”