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

Real-Time Celestia Version 2 now available

Post #21by tec » 12.05.2006, 16:47

Hello Everyone,

I have a new version of the Real-Time Celestia code. It is available for download at http://www.knology.net/~tec. I fixed several issues. Here are a few new capabilities.

1. Celestia now broadcasts information using the UDP port 3001. Now anyone can get data from Celestia. The playback tool will read incoming UDP messages from Celestia and print them out to the screen.

2. I fixed some of the quaternion issues related to orienting UDP models.

3. I fixed a bug with the new *.xyzq input trajectory files. The user can now use the *.xyzq file format to input locations and quaternions.

4. The playback tool has been overhauled. More capabilities have been added such as removing Celestia bodies that have been broadcast by the playback tool.

I am still working on more real-time capabilites so let me know what you think.

Tim

maxim
Posts: 1036
Joined: 13.11.2003
With us: 21 years
Location: N?rnberg, Germany

Post #22by maxim » 12.05.2006, 21:32

What exactly can your realtime celestia do. Is it possible to synchronise two celestia applications, running on different computers, over the net.

Sorry if this is a dumb question.

maxim
Get my stuff from celestia.ziegelstein.net

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

Celestia to Celestia

Post #23by tec » 13.05.2006, 01:55

Hmmmm. I never though of communicating two Celestias together. Do you have an example why you would want to do this? I can make modifications for this scenario if you can explain it to me.

The protocol uses UDP over the ethernet. You question is not a dumb one.

My real time code allows a client (like my playback tool) to send Celestia some body information. It doesn't have to be my playback tool. I just wrote the playback tool to be used as an example.

Tim

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

3 Celestias as simulator windows

Post #24by tec » 13.05.2006, 13:06

Maxim,
I just thought of something that would use "Celestia to Celestia" communications. Someone could use Celestia for a space ship simulator. You could have 3 Celestia computers running left, forward and right window. The forward Celestia would be the master and drive the other two (left/right) windows ( or channels as I call them). The left and right Celestia would be slaves and pointed about 46 degrees offset from the forward. A small message from the forward Celestia would be sent to command the other two Celestia to move its rotation viewing angle.

This would be very simple to write. I will add this to my todo list.

Tim

maxim
Posts: 1036
Joined: 13.11.2003
With us: 21 years
Location: N?rnberg, Germany

Post #25by maxim » 13.05.2006, 17:03

My question was only for curiosity. I don't have plans. But there are certainly several possible scenarios for a usefull app-to-app communication:

- A spaceflight simulation is definitely not the main purpose of Celestia, but a similar scenario can make use of a 3-wall, 4-wall or 6-wall cave (which could show surely impressive views of planet systems).

- A teacher-to-pupils scenario can duplicate teachers live acting on each pupils computer instead of a single beamer view.

- Similar a pupils-to-teacher scenario lets the teacher watch a pupils efforts.

- An event could be watched from different view positions simultaneaously - similar to the splitview function, but without tiling precious viewarea on a single monitor.

- On a monitor-wall (3x3, 4x4, 10x10, ...) you could create an ultra-hires view of the universe - surely an eyecatcher, even for bigger events.
64k Mars VT showing the highest level on a full disk view - that I'd really like to see!

- Invite your friends for cruising the universe together over the net...

You may think of more...

maxim
Get my stuff from celestia.ziegelstein.net

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #26by Joe » 15.05.2006, 11:35

Tim

RealTime is a wonderful feature. I managed to build an executable version out of your source code, but I am not a networking user. According to your instruction "... You can execute Celestia and the playback tool on the same computer.....", I tried and nothing happened. Do I have to configure my computer with Ethernet and UDP support if I want to run the realtime modified Celestia1.4.1 and the Playback tool on the same computer?
Joe
8O

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

RealTime on the same computer

Post #27by tec » 15.05.2006, 20:42

I think I know what is wrong. The twqo bodies that are transmitted from the playback tool are valid at certain times. I think it is May 10 at 10:38am. You must set your Celestia time to that time to see these bodies. If that does not fix the problem, look at the prints at the bottom of the screen to see what is happening. The dis.log file will also give you insight on the problems.

By the way, using Maxim's ideas from this weekend I was able to code up Celestia to slave another Celestia app to rotate and translate the perspective view in realtime. This is such as cool feature. I can also slave another Celstia app and offet the perspective view's quaternions. This is nice if you want to use Celestia as a space craft simulator left or right window. I have a few more improvements to the realtime and I wll release another version soon.

Tim

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #28by Joe » 16.05.2006, 10:00

Well, Tim, my problem is that the realtime modified Celestia1.4.1 does not initialise itself at all on my XP Window PC, I checked the source with debugging and found out that the programme terminates itself at:
void RealTime::broadcast_information(Simulation &sim)
{
...
...
for (int s=0; s < numSats; s++)
{
...
...
udp->out->putDatagram(buffer, size);
}
...
}


I realised it is termonated by the exit(1) call inside putDatagram(buffer, size) function.

I wonder if I need to configure my PC with DIS networking support, or not? Or do I need to install any other networking programmes in order to run the RealTime feature?
Joe

8O

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

RealTime on the same computer

Post #29by tec » 16.05.2006, 11:45

Sorry Joe for all of your troubles. Here are a few things to try. I am guessing that you need an Ethernet card but I am not sure. Do you have one in your XP computer?

The method that you having problems with is where Celestia is broadcasting information about itself for others to receive. You don't need this method if you don't want to know Celestia's output. This activity is broadast on port 3001. Simply place a return at the top of broadcast_information() so the method is bypassed.

The area you showed me is not initialization. If it terminates in broadcast_information then it passed the port initialization functions. If you have an ethernet card you should not have to add any software or tune your card.

Try this and let me know.
Tim

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #30by Joe » 17.05.2006, 07:39

Tim

Thanks for the help. After spending a coulpe of hours playing with the RealTime code, I can now confirm that it needs an Ethernet card to run. It is such a great feature so I have to get the card and install it in my PC.
Joe

8O

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

New Real-Time version posted on web site

Post #31by tec » 19.05.2006, 14:18

All,
There is a new Real-Time version 2.0 posted on the Real-Time web site:

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

There are many new bug fixes and additions to the Real-Time software as well as a new web site format.

Tim

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #32by Joe » 22.05.2006, 12:30

Hi, Guys

Anyone has tried Tim's RealTime version of Celestia? Please share your successful experience with me. The programme does not work on my Window XP machine with Ethernet card and always exit unexpectedly due to the WSAEHOSTUNREACH (10065) No route to host error. Any help on how to set up and configure the system is much appreciated.
Joe

8O

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

Network Error

Post #33by tec » 22.05.2006, 22:49

Hey Joe,

Sorry for your frustrations. I don't know off hand what the issue is but I will help you through this. Have you tried to recompile all of the code? If you have different network drivers, you will probably need to re-build the entire project. Did you try to start the playback application last?

Which program is giving you the error? Will you step through the debugger and tell me which line in UdpSocket.cpp it is exiting. Is it the playback tool or Celestia? Make sure you are using the latest software on my web site. Version 2.0 is the latest.

Tim

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #34by Joe » 23.05.2006, 09:18

Hi, Tim

Thanks for the quick response, I am sure it is the networking set-up caused my problem. Yep, I am using your latest code from your website and have re-built both the Celestia and the udpOrbit without any change on the code. I was runing both programmes on a single machine under Window XP. The problem:

I tried to start Celestia first and it always exits before the window shows up.
Then I tested with runing udpOrbit alone, it starts OK, then any button press makes it exit.

What I found with debugging was this following code causes the exit:

int UdpSocket::putDatagram( const char *data, int size )
{
int retval = sendto(fd, data, size, 0, (struct sockaddr *)
&outAddr, sizeof(outAddr));

if (retval < 0)
{
int error = WSAGetLastError();
if (error == WSAEWOULDBLOCK)
return 0;
else
{
TRACE("sendto failed, winsock error %d", WSAGetLastError());
exit(1);
}
}

return retval;
}


The value of error variable is WSAEHOSTUNREACH (10065) No route to host

Well, it seems there has not been more posts on this useful feature in this forum though I would hope it deserves more discussion.
Joe

8O

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

Post #35by t00fri » 23.05.2006, 11:56

Joe wrote:...
Well, it seems there has not been more posts on this useful feature in this forum though I would hope it deserves more discussion.


Why?


I am still waiting to see some concrete applications (not words) that are of major interest to a larger sub-community of people. Personally I think the real time code is a too specific application to be part of Celestia's core code. If there was an implementation via scripting (lua) this would look much more appropriate to me.

Bye Fridger
Image

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

Network Error

Post #36by tec » 23.05.2006, 13:29

Joe,

I tried a test. I assumed you have no router, switch or network hub so I disconnected my laptop from my network hub and tried to execute the playback tool. The UdpSocket::putDatagram failed with the error, 10065. For some reason a network card is not activated when there is no router, switch or network hub.

Do you have one of the devices that you can use? Do you use one to get your email and surf the web? I think you should just have to connect it to the router, switch or network hub even if your computer is the only one on the net.

Tim

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #37by Joe » 23.05.2006, 13:44

...to be part of Celestia's core code


Hey, Fridger, I agree with you, but please don't get me wrong. I was hoping there had been more interests in this feature (just a personal wish), but I didn't say it would be a part of Celestia's core code. However if Tim would continue his effort along the line, scripting implementation might be possible--it is worthy of trying anyway.
Joe

8O

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

network

Post #38by tec » 23.05.2006, 14:05

Joe,
I talked to a buddy at work about your network issues. He suggested to just get a loopback cable instead of buying a more expensive hub or switch.


You said:

However if Tim would continue his effort along the line, scripting implementation might be possible--it is worthy of trying anyway.

What do you mean about "scripting implementation". Are you suggesting that I could implement the UDP message sets for scripting?

Tim

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 9 months
Location: United Kingdom

Post #39by Joe » 23.05.2006, 14:17

Tim

Thanks for the help and I shall try on what you have suggested. About the scripting implementation, it was just a thought . I would think it may make the real time feature easier to use (I might be wrong).
Joe

8O

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

Re: network

Post #40by t00fri » 23.05.2006, 14:57

tec wrote:
What do you mean about "scripting implementation". Are you suggesting that I could implement the UDP message sets for scripting?

Tim


Well, Celestia uses the very powerful scripting language called Lua that might well be able to handle also udp networking tasks (PERL can too, so why not Lua). We are thinking anyway about a network updating facility for satellite and asteroid ephemeris. So one might contemplate about are more general networking module to be implemented perhaps using Lua.

If we integrate new features into Celestia, it is always a good idea to do these as elegantly and /as general/ as possible, rather than just for a single "narrowband" application.

Bye Fridger
Image


Return to “Development”