realtime interface to Celestia

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

realtime interface to Celestia

Post #1by tec » 14.03.2006, 16:48

Hello Everyone,
I was wondering if there is a way to render my space vehicle real-time. For example, I am calculating a space vehicle's position and orientation using a 6DOF simulation. I want to feed these position into Celestia using some kind of interface such as UDP or shared memory. Is there a way to send Celestia information other than scripts? This information will have to be updated without restarting Celestia.

Thanks
Tim

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #2by Christophe » 14.03.2006, 17:31

No, such an interface does not exist yet. The easiest way to achieve this is probably to implement your own custom orbit.
Christophe

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Post #3by t00fri » 14.03.2006, 18:26

Christophe wrote:No, such an interface does not exist yet. The easiest way to achieve this is probably to implement your own custom orbit.


Also I don't really see why such a feature should be of wider interest given the general design criteria we tend to apply to the core of Celestia.

A mere referral to 6DOF simulation software is NOT enough for my taste at least. Celestia offers perfect ability to put bodies into space along some rather general trajectories.

Bye Fridger

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

Post #4by selden » 14.03.2006, 19:20

Tim,

It really isn't necessary to post the same question in more than one forum. It just leads to confusion. I'll move my response from the Users forum posting to here and delete that post entirely.

===========
Unfortunately, Celestia does not (yet?) support the changing of an object's location or orbital parameters in realtime.

(A model's orientation can be changed in realtime, but I don't think CelX provides access to that functionality. It's normally done using the mouse.)

Celestia doesn't have a UDP or shared memory I/O interface, either, although several people have requested such a feature for similar reasons, although not recently.

However, one can pass parameters to Celestia while it's running under Windows by using the command-line interface and the "--once" qualifier. I wouldn't call it realtime, though: it's rather slow. I don't know if this works under Linux or MacOS.

The command-line qualifiers are

Code: Select all

    * --dir <path>
            change root celestia directory to <path>
    * --fullscreen
            start Celestia in fullscreen mode
    * --once
            send the command line to a running instance of Celestia. If no running instance exists, a new one is started.
    * --url <url>|<filename>
            start in the given <url> or if the parameter is the name of a script file, execute <filename>.
    * --verbose > <filename>
            write debug messages to <filename>


I think we'd all appreciate it if you could describe the program you call "6DOF." Usually that acronym just means that whatever it is works with 6 degrees of freedom -- presumably 3 of location and 3 of orientation.

If you can persuade the program to precalculate the trajectory (maybe run it through the complete trajectory ahead of time), then you can use the location coordinates that it calculates to create an xyz trajectory file that Celestia can use. Of course, that's only three of the six coordinates. Celestia does not (yet?) support having orientation specifications in a trajectory file.

(Maybe Harald can be persuaded to provide a Lua interface to the orientation code?)

Of course, this still is extremely awkward if you need to make iterative changes for things like midcourse corrections.
Selden

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

updating the scene in realtime

Post #5by tec » 14.03.2006, 19:53

Hello,
I am looking for a tool to display the space vehicles in realtime. These space vehicles might be calculated by many different hosts on a network.

A good anology to this requirement is a DIS exercise. My background is ground based systems. I am used to using flat earth and displaying vehicles on roads. The vehicles were read from the network in a message packet called DIS Protocol data units (DIS PDUs). These exercises could have over 1000 vehicles driving around at once. That is why I need a UDP or shared memory interface.

Now, my requirements are to launch satellites into space and perform midcourse correction. I have searched around the internet and I think Celestia is the best candidate. It's maturity and support have convinced me that it will meet and exceed my requirements.

Is there anyway that the next version of Celestia can provide orientation of the 3DS models? The DIS protocol messages support location, velocity, acceleration (for dead reckoning), appearance, articulated parts (for models), and type of vehicle.

The post processing of these trajectories would not allow for man-in-the-loop decisions. The DIS protocol is great for man-in-the-loop because of manned simulators like cars, trucks, etc can play together and interact.

I will read on --once, CelX and Lua.

Thanks
Tim

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Re: updating the scene in realtime

Post #6by t00fri » 14.03.2006, 20:09

tec wrote:...
A good anology to this requirement is a DIS exercise.
...


Could you perhaps manage to describe your tasks without subscribing to american-style "acronymia" ;-)

In my field of research, for example, DIS means "Deep Inelastic Scattering" and I wonder how much you happen to know about this meaning of the acronym DIS? ;-)

Bye Fridger

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

acronyms

Post #7by tec » 14.03.2006, 20:42

Sorry Sir,
DIS stands for Distributed Interactive Simulation. It is a standard for bringing together many simulations.

One thing I have not mentioned yet is an application called a Stealth. A Stealth is a 3D application that displays all vehicles on the network. So who ever adheres to the DIS standard will be displayed in the Stealth. The word Stealth is used because it can see everything but no one can see the Stealth.

A good example is the GPS script which I downloaded. I think there are 21 satellites. How could I simulate and control the GPS orbits from the ground and view it which I adjust the orbit ? I also want to make sure I can see the correct orientation of the GPS satellite because of obvious reasons like LOS (line of sight).

I am trying to make Celestia a Stealth. I would like all participants on the network to be displayed on the Stealth. The DIS standard can be used. It has been widely tested and well documented.

I would also like to have Celestia render a sensor's view. This can be done with the split screen capability that already exists. THe sensor's FOV infortmation could be broadcast using UDP or shared memory and the view could display the stars and other objects in the sensor's FOV.

The UDP utility would create a great opportunity for other areas.

Thanks
Tim

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

Post #8by selden » 14.03.2006, 20:52

Tim,

Unfortunately, your "line of sight" example is a poor one. It's one that Celestia currently cannot do.

Unless... do you have access to an accurate 3D model of the Earth's surface? If so, is it or can it be made publicly available?

Celestia uses a spherical model to represent the Earth's surface. This doesn't work at all when trying to determine the line of sight to a satellite in low Earth orbit.
Selden

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

LOS functionality

Post #9by tec » 14.03.2006, 21:44

Actually, Celestia is a great candidate for the LOS function. I don't want to look back at the earth. I want the space vehcile's sensor's view to look out at the stars. I would like to see the placement of the stars relative to the other space vehicles that I inject into Celestia. I would also like to watch my space vehicles perform IMU (Inertial Measurement Units) alignments. The IMU needs to perform an alignment to calibrate out the mis alignments in the inerial navigation. The stars are used to do this.

I have read over the LUA interface. Can someone tell me how I would add an object like the Explorer1 example using LUA/CelX? The Explorer object (*.ssc) is a good example of what I am trying to perform. I would like to do this realtime but I understand the LUA is a script. I was hoping to add the Explorer vehicle and render it using the Explorer 3DS model. Is it possible to add an object and tell Celestia to use a certain 3DS model?

Tim

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

Post #10by selden » 14.03.2006, 21:47

Not yet with Lua at runtime, only with SSC catalogs which are loaded at start-time.

My understanding is that Harald has been thinking about how that might be done, however.
Selden

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

dialog between Chris, Harald and me

Post #11by tec » 16.03.2006, 14:35

I agree that it could be very useful to have orientation data for objects in Celestia. In other data files, Celestia uses axis-angle orientations instead of Euler angles, so I'd prefer to continue this. Celestia also uses ICRF as the reference frame, not ECEF--I don't know enough about ECEF to be able to say how simple the conversion is.

We should have a separate file type for trajectories that also contain orientations. When parsing data files, Celestia treats end-of-line markers as ordinary white space, so it would not be able to discern whether extra data on a line was for an orientation or just the next position.

I assume that you also would like to interpolate between orientations?
Interpolating Euler angles and using glRotate is unsatisfactory. We should instead convert the orientations to quaternions and use Celestia's quaternion spherical interpolation functions.

--Chris

>
> Wow. It sounds like many people would like a simple orientation interface.
> I
> would like to see a small taste of the orientation in Celestia using
> the xyz file. Maybe this would spark more dialog from others in the
> community. I would like to help write the code but I would need help
> finding the right files to modify. I could also spent my time testing
> the orientation and its coordinate system. Could you initially direct
> me to which files I need.
>
> Here is my xyz file plan. If the xyz file has more double floating
> point numbers in the current line, then I will assume these are the 3
> orientation pointing vectors. For now, I will assume they are ECEF. I
> can change the coordinate system later if it needs changing. I will
> simply change the model's rotation using the glRotate commands.
>
> glPushMatrix
> glRotate( 'x", rotationx[t] );
> glRotate( y", rotationy[t] );
> glRotate( 'z", rotationz[t] );
> glTranslate( existing array );
> glPopMatrix();
>
> What file reads in the xyz file? I will add another vector list for
> orientation just like the position.
>
> What file renders the xyz file? I will add the above gl calls to
> orient the model.
>
>
> We should probably move this discussion to the forum so others can
> contribute.
>
> Tim
>
>> Subject: Re: orientation
>
>
> On Wednesday 15 March 2006 17:52, Tim Curry wrote:
>> Hello,
>> I need a feature in Celestia that I think does not exist. I want
>> to orient an object that is already in the scene such as the IIS. The
>> IIS does not keep the same orientation in real life and I want to
>> orient it as a function of time. I thought about doing this using the
>> script file but the calls are not there for orientation. Is this
>> possible? Are there plans for adding the obj:setorientation ?
>

> There had been some work in that area and the idea of
> "background-scipts" which resulted from it. This happened about two
> years ago, as a result from this forum thread:
> http://celestiaproject.net/forum/viewtopic.php?t=4543
>
> There was more about this on the developers mailinglist on 8./9. March
> 2004. The list is archived here (but difficult to follow as presented):
>
http://sourceforge.net/mailarchive/foru ... s=25&style
> =flat&viewmonth=200403&viewday=8
>
http://sourceforge.net/mailarchive/foru ... s=25&style
> =flat&viewmonth=200403&viewday=9
>
> Chris preferred callbacks, but the discussion never came to a result,
> and the idea (and the code) was forgotten.
>
> Harald
>

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

realtime development

Post #12by tec » 22.03.2006, 04:05

Hello Everyone,

I have been working on the realtime interface and I have a few questions. I am now able to compile the code using the Microsoft .Net soultion files. I used the .mak files to reconstruct the project files.

I have established a UDP message set for updating the position of the models in the celestia.cfg file. I am currently reading the UDP message in the main loop. Where in the code do the models use their xyz positions to render to models? I need some kind of reference to change the positions from the main loop (winmain.cpp before the tick()) when I get these new positions and orientations. I understand the orientation is not being used but I will add that code. I found a Body class. Should I try to get a pointer to the body class that points to that model?

My next question is the coordinate system called ICRF , Chris said in his last email that Celestia uses the ICRF reference frame. Can anyone tell me how it is defined?

I have also included the quaternions after the position in the xyz file. This will allow the user to move the model to any orientation as a function of time. Don't worry, I will give examples for this new format. It will not be called *.xyz. Chris doesn't want it to conflict with the existing formats.

I am documenting all of my changes and I will give everyone an update as soon as I progress farther. Feel free to give me any of your design ideas. Now is the time for your input. I currently have messages to do the following:

1. change position/orientation/appearance
2. fire a weapon
3. show a detonation
4. render a laser from ponit to point.

I will show everyone the message formats later.

Thanks for any help.
Tim

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

Post #13by selden » 22.03.2006, 11:12

Tim,

Unfortunately, I'm not a C++ coder, so I'm really not familiar with which parts of the program you'd need to modify.

However, in order to get support from the more serious users of the software, I'd suggest rephrasing some of your goals in non-gaming terms.

e.g.

+ Firing thrusters
+ Displaying exhaust plumes
+ Aligning communications antennas
+ Rendering point-to-point alignment vectors
Selden

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

realtime development update

Post #14by tec » 30.03.2006, 20:47

I wanted to give everyone an update on how the realtime interface is going. I have accomplished much over the last few weeks. I have a driver application that runs on the remote PC that sends UDP messages over the network. It updates the location and orienation of the corresponding body. The body will actually move to the new location.

My current issue is getting the correct coordinate system for the bodies. I know the bodies should be in heliocentric coordinate system but I cannot figure out which way x, y, and z is pointing. I printed the planets location during a debug session but I cannot tell from those positions. I know the origin is in the center of the sun. Is the x axis pointing through the center of the earth? Which way is z?

Thanks,
Tim

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

Post #15by selden » 30.03.2006, 21:14

My understanding is that it is equivalent to the ecliptic coordinate system.

Here's what Chris Laurel posted quite some time ago about the SampledOrbit definition, which I assume you're using:

Chris Laurel wrote: Each row in a .xyz file is a Julian date followed by a Cartesian coordinate. The units of the coordinates are kilometers. The coordinate system is astrocentric; in our Solar System, this means that the center of the Sun is at (0, 0, 0). The xy plane is the ecliptic plane of the star system at the reference epoch J2000.0; in our Solar System, this is the Earth's orbital plane on Jan 1, 2000. The positive z axis is perpendicular to this plane in the directional sense of Earth's north pole. The x axis points from the Sun to Earth's ascending node, and the y axis completes the right handed coordinate system.
[...]
What I said was actually not quite correct . . . The origin is the center of the parent object, whether it's a star or a planet. If the parent is a planet, the +z axis is the planet's north pole and the xy plane is the planet's equatorial plane at the reference epoch J2000. The x axis points at the ascending node of the equatorial plane on the ecliptic.

The good thing is that these are exactly the same conventions used by JPL's Horizons system by default, so very little processing of Horizons generated ephemerides is necessary. For Sun orbiting objects, just select a center of @10 (Sun), vector output, and eclip for the reference plane.
Selden

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

eclipitical coordinates

Post #16by tec » 31.03.2006, 15:53

You are right. I am using the SampledOrbit class. I don't understand one part of Chris' explaination. He states:

The xy plane is the ecliptic plane of the star system at the reference epoch.

Then Chris states:

The positive z axis is perpendicular to this plane in the directional sense of Earth's north pole.

How can the z axis be the earth's North pole if the earth is canted by 23.5 degrees in it's orbit around the sun?

One more question. What does he mean by:

The x axis points from the Sun to Earth's ascending node.

What is the Earth's ascending node?

Thanks
Tim

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

Post #17by selden » 31.03.2006, 16:16

It's not precisely the North pole's axis, it's perpendicular to the xy plane in the same hemisphere as the Earth's North pole's axis.

The Earth's ascending node is the direction of the Vernal point, aka "the first point of Ares", which actually is in Pisces these days. It's the direction where RA = 0.0, Dec = 0.0.
Selden

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

realtime status

Post #18by tec » 13.04.2006, 14:52

Here are some emails between a few of us. I used email because the forum was down. Some people has asked to see the src code so I will place the realtime code on my web page later this evening. Check out

http://www.knology.net/~tec/ later this evening US central time

Tim

----------------------------------------------------------------------------------


What forum are you talking about? Certainly NOT the Celestia forum. I am a member of the Celestia forum since it's beginning.

Bye Fridger

Tim Curry wrote:
> I would have to disagree with you about i). There are many forum conversations with respect to implementing the realtime functionality. This is one of the reasons I took on this task. The dates on the forum dialog extend for many years.
>
> As far as ii) is concerned, the Celestia user needs a better way of integrating their objects of study. Currently, there is no way to marry together a user's simulation and Celestia. Many scientists and engineers use simulation to create high fidelity math models of orbital mechanics. You can see from the forum that there are simulation experts that will take advantage of this functionality.
>
> Please reconsider your initial response.
>
> Tim
>
> ________________________________
>
> From: Fridger Schrempp [mailto:fridger.schrempp@desy.de]
> Sent: Fri 4/7/2006 1:31 PM
> To: Tim Curry
> Subject: Re: Celestia Realtime Code
>
>
>
> Tim,
>
> we only tend to implement features into the core code of Celestia that
> i) are of interest for a /larger/ subcommunity of potential users, ii)
> strictly focus an Celestia's design philosophy as a /scientific/
> and|or educational simulation of the Universe. Celestia is NOT a
> shooter game or a military simulator.
>
> So far, you failed to convince me that your realtime features comply
> with i) and ii) in any way.
> Your code changes would only make it easier for people to convert
> Celestia code into (commercial) games. While not being illegal, the
> latter is NOT in the interest of Celestia's developers!
>
> Bye Fridger
>
>
> Tim Curry wrote:
>
>> Hello,
>>
>> I have implemeted many of the realtime features that Celestia
>> users and I have needed. I wanted someone to take a look at my code.
>> Please direct me to the correct person if you guys are no interested
>> in helping. I have put much work into the realtime features and I
>> want this to be integrated back into a future release of Celstia. I
>> also plan to put more work in the realtime feature in the future. I
>> will post this message as soon a the shatters.net is back up.
>>
>> Here are the features that I have implemented.
>> 1. I can now send new entities across the network and Celestia adds
>> those bodies to its list.
>> 2. The user can press 'Z' to go to the next network entity.
>> 3. I have implemented xyzq files that include x, y, z, and quaternoins.
>> 4. I have a web site dedicated to Celestia RealTime integration. I
>> have not published it, yet. I want to wait until I someone else to
>> look at my code.
>> 5. I have a great client tool that reads from a file a broadcasts UDP
>> messages to Celestia.
>> 6. Interpolating the orientation quaternions.
>>
>> Near Future:
>> 1. Sending messages to render lines.
>> 2. Special Effects.
>>
>>
>> Thanks
>> Tim
>>
>
>
>

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

realtime web page

Post #19by tec » 13.04.2006, 21:06

The realtime web page is up and running.

See http://www.knology.net/~tec

Tim

Topic author
tec
Posts: 51
Joined: 14.03.2006
With us: 18 years 8 months
Location: Huntsville, AL

3ds model orientation

Post #20by tec » 05.05.2006, 17:52

What is the correct coordinate of a Delta 3ds model? I have a model of a body that I am placing in orbit. My x axis runs along the launcher's tip to the thrusters. Where x at the tip is 0. Is this correct? I am not too concerned with the y and z axis because the the model is symetrical. When I place the model in the scene it is sideways. Is there a standard for Celestia?

Thanks
Tim


Return to “Development”