It is currently Thu, 21-06-18, 3:02 GMT

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Problem with Timeline
PostPosted: Fri, 01-08-14, 1:50 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 219
Hi,

I'm experimenting a little with Timelines and I've got the following problem...

I've created a Timeline with 2 periods, the first relative to Earth, and the second relative to Io.
The SSC fails however when both periods are defined. Commenting out either the first or second Timeline period allows either definition to work by itself.

eg. This works (Io section commented out):
Code:
"Apollo 11 CSM+LEM"   "Sol"
{
   Class "spacecraft"
   Radius      0.003

   Timeline
   [
   {
   Beginning 2453553.0000 # 2005 Jul  1 12:00:00
   # Ending    2453559.2511 # 2005 Jul  7 18:01:37.8

   OrbitFrame { EclipticJ2000 { Center "Sol/Earth" } }
   SampledOrbit "apolloFreeReturn.xyz"
   
   BodyFrame
   {
      TwoVector
      {
         Center   "Sol/Apollo 11 CSM+LEM"
         Primary
         {
            Axis "-z"
            RelativePosition { Target "Sol" }
         }
         Secondary
         {
            Axis "x"
            RelativeVelocity { Target "Sol" }
         }
      }
   }

   FixedRotation { }
   }
   
   
   # {
   # Beginning 2453559.2511 # 2005 Jul  1 12:00:00
   # # Ending    2453559.2511 # 2005 Jul  7 18:01:37.8

   # OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter/Io" } }
   # SampledOrbit "apolloFreeReturn.xyz"
   
   # BodyFrame
   # {
      # TwoVector
      # {
         # Center   "Sol/Apollo 11 CSM+LEM"
         # Primary
         # {
            # Axis "-z"
            # RelativePosition { Target "Sol" }
         # }
         # Secondary
         # {
            # Axis "x"
            # RelativeVelocity { Target "Sol" }
         # }
      # }
   # }

   # FixedRotation { }
   # }

   ]
}   



... and, so does this (Earth section commented out):
Code:
"Apollo 11 CSM+LEM"   "Sol"
{
   Class "spacecraft"
   Radius      0.003

   Timeline
   [
   # {
   # Beginning 2453553.0000 # 2005 Jul  1 12:00:00
   # # Ending    2453559.2511 # 2005 Jul  7 18:01:37.8

   # OrbitFrame { EclipticJ2000 { Center "Sol/Earth" } }
   # SampledOrbit "apolloFreeReturn.xyz"
   
   # BodyFrame
   # {
      # TwoVector
      # {
         # Center   "Sol/Apollo 11 CSM+LEM"
         # Primary
         # {
            # Axis "-z"
            # RelativePosition { Target "Sol" }
         # }
         # Secondary
         # {
            # Axis "x"
            # RelativeVelocity { Target "Sol" }
         # }
      # }
   # }

   # FixedRotation { }
   # }
   
   
   {
   Beginning 2453559.2511 # 2005 Jul  1 12:00:00
   # Ending    2453559.2511 # 2005 Jul  7 18:01:37.8

   OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter/Io" } }
   SampledOrbit "apolloFreeReturn.xyz"
   
   BodyFrame
   {
      TwoVector
      {
         Center   "Sol/Apollo 11 CSM+LEM"
         Primary
         {
            Axis "-z"
            RelativePosition { Target "Sol" }
         }
         Secondary
         {
            Axis "x"
            RelativeVelocity { Target "Sol" }
         }
      }
   }

   FixedRotation { }
   }

   ]
}   



However, if I have them both enabled at the same time, the object doesn't show up at all (Nothing starting with "Apollo" in the "ENTER" key lookup at all.).
This suggests a syntax error in the SSC, but it seems to conform with the documentation: http://en.wikibooks.org/wiki/Celestia/160Features#Object_timelines.
I can't see any errors at all (and each section works in isolation.)

Anyone have any insights? Is there something I don't know about Timelines?

Cheers
CC

This doesn't work at all (both sections enabled):
Code:
"Apollo 11 CSM+LEM"   "Sol"
{
   Class "spacecraft"
   Radius      0.003

   Timeline
   [
   {
   Beginning 2453553.0000 # 2005 Jul  1 12:00:00
   # Ending    2453559.2511 # 2005 Jul  7 18:01:37.8

   OrbitFrame { EclipticJ2000 { Center "Sol/Earth" } }
   SampledOrbit "apolloFreeReturn.xyz"
   
   BodyFrame
   {
      TwoVector
      {
         Center   "Sol/Apollo 11 CSM+LEM"
         Primary
         {
            Axis "-z"
            RelativePosition { Target "Sol" }
         }
         Secondary
         {
            Axis "x"
            RelativeVelocity { Target "Sol" }
         }
      }
   }

   FixedRotation { }
   }
   
   
   {
   Beginning 2453559.2511 # 2005 Jul  1 12:00:00
   # Ending    2453559.2511 # 2005 Jul  7 18:01:37.8

   OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter/Io" } }
   SampledOrbit "apolloFreeReturn.xyz"
   
   BodyFrame
   {
      TwoVector
      {
         Center   "Sol/Apollo 11 CSM+LEM"
         Primary
         {
            Axis "-z"
            RelativePosition { Target "Sol" }
         }
         Secondary
         {
            Axis "x"
            RelativeVelocity { Target "Sol" }
         }
      }
   }

   FixedRotation { }
   }

   ]
}   


_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Top
 Profile  
 
PostPosted: Fri, 01-08-14, 11:54 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 417
Location: Tuscany, Tyrrhenian Sea
SampledOrbit is deprecated in favour of SampledTrajectory; maybe the former is uncompatible in the form you have specified.

_________________
Never at rest.
Massimo


Top
 Profile  
 
PostPosted: Fri, 01-08-14, 21:45 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 219
Hi Fenerit,

Unfortunately, no, that's not the cause of the problem -- If you think about it, each section works separately, so there's clearly no issues with anything between each of the Timeline section braces {}. Also, we know that SampleOrbit is compatible with Timelines because the Cassini addon (in extras_standard) uses it.

I think it's a good idea though to change SampledOrbit to SampledTrajectory, so I've done so, but as expected this makes no difference -- The problem has something to do with combining both sections, -- separately, they work perfectly.

I'm thinking this may be a bug in the Timeline code, so maybe one of the DEV's can debug the issue using my code.

EDIT: Solved it! It was related to with the way I was using the Beginning / Ending directives. Timeline has some specific limitations around this. eg. A "Beginning" directive is only allowed in the first phase. Subsequent phases implicitly inherit the END time of the previous phase as their start time (Explicit use of a "Beginning" directive is not allowed in these phases.)

Thanks for the suggestion Fenerit. Even though that wasn't the cause of the problem, it did cause me to revisit the issue, and in examining the Cassini addon I realized my mistake when I saw how it handled the Beginning / Ending directives.

CC

FYI, Here's the corrected code:
Code:
# ReferencePoint
"Apollo 11 CSM+LEM" "Sol"
{
   Class "spacecraft"
   Radius     0.003

   Timeline
   [
   {
      Beginning 2453553.0000 # 2005 Jul  1 12:00:00
      Ending   2453559.2511 # 2005 Jul  7 18:01:37.8

      OrbitFrame { EclipticJ2000 { Center "Sol/Earth" } }
      SampledTrajectory
      {
         Source "apolloFreeReturn.xyz"
      }
      
      BodyFrame
      {
         TwoVector
         {
            Center   "Sol/Apollo 11 CSM+LEM"
            Primary
            {
               Axis "-z"
               RelativePosition { Target "Sol" }
            }
            Secondary
            {
               Axis "x"
               RelativeVelocity { Target "Sol" }
            }
         }
      }
      FixedRotation { }
   }
   
   {
      # Beginning 2453559.2511 # 2005 Jul  1 12:00:00
      Ending   2453565.5022 # 2005 Jul  14

      OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter/Io" } }
      SampledTrajectory
      {
         Source "apolloFreeReturn3.xyz"
      }
      
      BodyFrame
      {
         TwoVector
         {
            Center   "Sol/Apollo 11 CSM+LEM"
            Primary
            {
               Axis "-z"
               RelativePosition { Target "Sol" }
            }
            Secondary
            {
               Axis "x"
               RelativeVelocity { Target "Sol" }
            }
         }
      }

      FixedRotation { }
   }
   ]
}

_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Last edited by chuft-captain on Fri, 01-08-14, 22:32 GMT, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri, 01-08-14, 22:27 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 417
Location: Tuscany, Tyrrhenian Sea
I apologize, I do not understand. One thing: the Apollo must jump from an OrbitFrame centered on Earth to an OrbitFrame centered on Jupiter. When the .ssc is read at load, can it do choose between the two, or they are in conflict?

_________________
Never at rest.
Massimo


Top
 Profile  
 
PostPosted: Fri, 01-08-14, 22:34 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 219
Fenerit,

I was updating my last post as you replied. Please re-read it to see that the problem is solved.

Cheers
CC

_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Top
 Profile  
 
PostPosted: Fri, 01-08-14, 22:39 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 219
fenerit wrote:
One thing: the Apollo must jump from an OrbitFrame centered on Earth to an OrbitFrame centered on Jupiter. When the .ssc is read at load, can it do choose between the two, or they are in conflict?
It's not a problem at load time. At runtime, when dealing with a Timeline, Celestia just decides (based on the simulation time) which section of the Timeline to use at that point in time. Hence, the strictness about the Begin / End times having to be contiguous and non-overlapping. (If we were allowed to specify our own Beginning directives, then it would be possible to declare overlapping timeframes, which would cause a confusion at runtime when trying to decide which Timeframe clause to use.)

CC

_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Top
 Profile  
 
PostPosted: Fri, 01-08-14, 22:58 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 417
Location: Tuscany, Tyrrhenian Sea
Good!

_________________
Never at rest.
Massimo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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:  
cron
Powered by phpBB® Forum Software © phpBB Group