Python and spacecraft onboard or ground control scripting

Ken Peek Ken.Peek at SpiritSongDesigns.comNOSPAM
Sat Apr 13 17:23:44 EDT 2002


"M. J. Mix" <marilyn.mix at omitron.com> wrote in message
news:7226483f.0204101216.2c8fcda4 at posting.google.com...
| Is anyone using Python as a spacecraft ground system
scripting
| language, or onboard (embedded) language?
|
| Pros and cons when compared with TCL or JAVAScript.  Just
| some real life, honest opinions.
|
| The usual issues: reliability and maintenance effort in
applications.
| Also, use as a scripting language by non-programmers. (I
saw the post
| on indenting, so I'm concerned about that.)

+++++++++++

With CPU power and memory getting less expensive, using a
scripting language in an embedded system is becoming more
feasible every day.  (Though this may not be true 'today',
as space craft are limited to the smaller "RAD-hard"
component sets.)  Python is quite suitable for embedded
systems work.  When compared to a compiled systems language
(like 'C'), some of the main differences will be:

  1) Slower execution (4..10 times slower than 'C' code)
  2) Larger memory requirements (dynamic objects instead of
statically allocated variables)
  3) Python uses 'late binding', so some errors will not be
found until run time (that could have been found at compile
time with a strongly typed language.)
  4) Objects are dynamically created at run time, so you
could have an "out of memory" surprise

If these limitations are not bothersome to your application,
then by all means-- set some engineers to work embedding
Python into your space craft!

The way Python uses indentation for delineation of code
blocks was "kind of weird" for me (at first anyway)-- but
after coding in Python for just an hour or so, I got used to
the idea very quickly, and now I find it to be a real
pleasure.  (I hate the colon at the end of a block header
though- I forget to type that a LOT!  I think it should be
optional, unless you have a statement on the same line as
the header.)

TCL and JAVAScript are very large (when compared to Python),
and would be too difficult to build an embedded version
for-- at least Python can be cut down to fit without too
much work.  (Of course, that depends on what services your
"embedded system" will provide to the Python byte-code
interpreter.)

I would be very careful what you allow with this system--
perhaps it would control only the non-mission critical
(application level) things on the spacecraft, (like pointing
the spy camera, zoom level, etc.)

One of the big advantages of using a scripting language is
that you can get instant feedback while using the system in
the 'interactive mode' (on the console.)  I would have to
ask you if this is what you intend to do with your
spacecraft-- and I assume you have solved the communication
delay problems...  If you do not intend to operate the
spacecraft in 'interactive mode', then why use a scripting
language at all?






More information about the Python-list mailing list