Can Celestia/Lua handle bitwise operations?

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 16 years
Location: Stuttgart, Germany

Can Celestia/Lua handle bitwise operations?

Post #1by Stuffer » 03.06.2009, 12:36

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
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Re: Can Celestia/Lua handle bitwise operations?

Post #2by Chuft-Captain » 03.06.2009, 13:20

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
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Avatar
LordFerret M
Posts: 737
Joined: 24.08.2006
Age: 68
With us: 18 years 3 months
Location: NJ USA

Re: Can Celestia/Lua handle bitwise operations?

Post #3by LordFerret » 08.06.2009, 05:49

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 :!:

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 16 years
Location: Stuttgart, Germany

Re: Can Celestia/Lua handle bitwise operations?

Post #4by Stuffer » 23.06.2009, 18:16

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
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB


Return to “Development”