Page 1 of 1

Can Celestia/Lua handle bitwise operations?

Posted: 03.06.2009, 12:36
by Stuffer
Hi,

Is the Lua interface in Celestia able to handle bitwise operations for data transmission? I'm thinking of data encapsulation like in the PUS standard.
If I remember correctly separate libraries have to be included into the standard version of Lua to do so.

Is this possible within Celestia?
I think most of the communication between a ground station and a spacecraft is based on PUS to create data packets.

Has anybody used this in any kind of way?
I would use it for communication between a simulator and Celestia.

Thanks in advance
Stuffer

Re: Can Celestia/Lua handle bitwise operations?

Posted: 03.06.2009, 13:20
by Chuft-Captain
Stuffer,

I don't know about the interface with Celestia but I think you're correct. From what I read in the following links, the bitwise operators are not available in std LUA, but only via a separate library:
http://lua-users.org/lists/lua-l/2007-10/msg00764.html
http://www.wowwiki.com/Lua_functions (near the bottom)
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4907


I did find this statement intriguing at the bottom of the 3rd reference above:
The bitwise operations are now conducted after converting the internal "double" (floating point) Lua numbers into 64-bit integers. Internally doubles are stored as 64 bits: 1 for sign, 11 for the exponent, and 52 for the mantissa. Their range is +/–1.7E308 with at least 15 digits of precision.


I don't know anything about the "PUS standard", but this statement seems to suggest that a workaround might be possible by passing "doubles" and then converting in Celestia, in order to perform bitwise operations.
I suspect this is not quite what you need, but may help.

CC

Re: Can Celestia/Lua handle bitwise operations?

Posted: 08.06.2009, 05:49
by LordFerret
Was curious about PUS myself, especially since it was stated it involved satellite telemetry.
PUS = Packet Utilization Standard

Found a few links on the subject:
THE ECSS PACKET UTILIZATION STANDARD AND ITS SUPPORT TOOL
PUS Upgrade of the Columbus Ground System (CGS) for Satellite Check-out
Package Declaration of PUS Data Types
A Powerpoint presentation: ECSS E-70-41: Telemetry & Telecommand Packet Utilisation

Additional more recent sources can be found with Google searches of things such as "ECSS packet", "CCSDS packet", and "uplink packet" or "downlink packet". Interesting :!:

Re: Can Celestia/Lua handle bitwise operations?

Posted: 23.06.2009, 18:16
by Stuffer
Hi

Does anyone of you guys know, how to integrate a external library into Celestia?
I'm not familiar with Celestia's source.

I also use sockets for the connection and the integration of the socket library was quite simple. Is it the same with any library?

Thanks
Stuffer