Top Banner
AAS 05-030 JAVA ASTRODYNAMICS TOOLKIT (JAT) David E. Gaylor * Emergent Space Technologies, Inc., Greenbelt, MD, 20770 Tobias Berthold University of Texas at Austin, Austin, TX, 78712 Noriko Takada Perry Johnson Registrars, Southfield, MI, 48076 The Java Astrodynamics Toolkit (JAT) is an open source software library of reusable software components for space mission design, trajectory optimization, and simulation of spacecraft navigation, attitude determination and control systems. The current capabilities of JAT include orbit propagation, coordinate and time system transformations, orbit determination using ground tracking or GPS measurements, maneuver planning, spacecraft attitude simulation, and 2-D and 3-D orbit and attitude visualization. JAT is distributed under the GNU General Public License. This paper describes the current features of JAT and presents the rationale for choosing to write it in Java and to make it open source. INTRODUCTION The Java Astrodynamics Toolkit (JAT) is an open source library of reusable software components written in the Java programming language to support rapid development of six degree-of-freedom spacecraft simulations including 2-D and 3-D visualization capabilities. Potential applications of JAT include: Simulations of autonomous spacecraft navigation, guidance and control Space mission design and analysis including trajectory optimization Operational orbit determination and orbital events generation JAT is distributed under the GNU General Public License 1 and is available at http://jat.sourceforge.net . * Director, Guidance, Navigation and Control, Email: [email protected]. Graduate Student, Email: [email protected] Translator, Email: [email protected]. 1
9

Java Astrodynamics Toolkit

Jan 28, 2023

Download

Documents

Jennifer Stern
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Java Astrodynamics Toolkit

AAS 05-030

JAVA ASTRODYNAMICS TOOLKIT (JAT)

David E. Gaylor*

Emergent Space Technologies, Inc., Greenbelt, MD, 20770

Tobias Berthold†

University of Texas at Austin, Austin, TX, 78712

Noriko Takada‡

Perry Johnson Registrars, Southfield, MI, 48076

The Java Astrodynamics Toolkit (JAT) is an open source software library of reusable software components for space mission design, trajectory optimization, and simulation of spacecraft navigation, attitude determination and control systems. The current capabilities of JAT include orbit propagation, coordinate and time system transformations, orbit determination using ground tracking or GPS measurements, maneuver planning, spacecraft attitude simulation, and 2-D and 3-D orbit and attitude visualization. JAT is distributed under the GNU General Public License. This paper describes the current features of JAT and presents the rationale for choosing to write it in Java and to make it open source.

INTRODUCTION

The Java Astrodynamics Toolkit (JAT) is an open source library of reusable software components written in the Java programming language to support rapid development of six degree-of-freedom spacecraft simulations including 2-D and 3-D visualization capabilities. Potential applications of JAT include:

• Simulations of autonomous spacecraft navigation, guidance and control • Space mission design and analysis including trajectory optimization • Operational orbit determination and orbital events generation

JAT is distributed under the GNU General Public License1 and is available at http://jat.sourceforge.net.

* Director, Guidance, Navigation and Control, Email: [email protected]. † Graduate Student, Email: [email protected] ‡ Translator, Email: [email protected].

1

Page 2: Java Astrodynamics Toolkit

CURRENT CAPABILITIES

The current capabilities of JAT include vector and matrix math, orbit propagation, coordinate and time transformations, orbit determination, maneuver planning, spacecraft attitude control simulation, and 2-D and 3-D visualization.

Vector and Matrix Math

JAT provides a full complement of vector and matrix math routines needed for astrodynamics. The JAT VectorN class provides vector addition, subtraction, dot product and cross product, as well as vector-matrix multiplication functions and many others. JAT also includes methods for representing rotations using direction cosine matrices or quaternions.

JAT provides random variables and matrices including beta, Cauchy, Dirac, exponential,

lognormal, normal, uniform, and Weibull distributions, and Gaussian and uniform random vectors.

Orbit Propagation

JAT is capable of high fidelity orbit propagation. JAT employs the Cowell formulation of the equations of motion using fourth and eighth order fixed step-size Runge-Kutta integrators as well as Runge-Kutta-Fehlberg 4/5 and 7/8 variable step-size integrators. The integrators support user-supplied stopping conditions.

For Earth orbit propagation, JAT has two-body and JGM3 Earth gravity models. Other gravity

models can easily be added using the JAT gravity model interface. Exponential and Harris-Priester atmospheric density models are available for modeling the effects of atmospheric drag. JAT also has models for solar radiation pressure and third-body gravity effects. Both impulsive and finite burn maneuvers are supported.

JAT has the capability of propagating interplanetary orbits using the JPL DE405 Ephemeris.

In addition, pre-built equations of motion for Keplerian two-body motion, the restricted three-body problem and the Clohessy-Wiltshire relative motion equations are provided for propagation.

Figure 1 Ground Track Plot of a Propagated Orbit in JAT

2

Page 3: Java Astrodynamics Toolkit

Coordinate and Time Systems

For Earth orbits, most calculations in JAT are done in the Geocentric Celestial Reference Frame. Transformations to and from the International Terrestrial Reference Frame, Topocentric Horizon Coordinate System, Perifocal Coordinate System, and Satellite Coordinate Systems are available in JAT. See Vallado2 for definitions of these coordinate systems.

Calculations in JAT are done in terms of Terrestrial Time. Conversions to and from GPS

Time, UTC and UT1 are provided in JAT. Various time formats are supported including Modified Julian Date.

Orbit Determination

An extended Kalman filter (EKF) is provided in JAT for orbit and parameter estimation problems. The EKF is formulated to process scalar measurements to eliminate the need for matrix inversion. Ground-based range, GPS pseudorange and carrier phase measurement models are included in JAT and other measurement models can easily be added using the JAT measurement model interface. Full descriptions of the EKF and GPS models used in JAT are given by Gaylor3.

GPS Models

JAT has the capability of simulating the GPS constellation using standard RINEX GPS navigation files. Simulated GPS measurements can be generated by JAT that include the following error sources: GPS receiver clock errors, ionospheric delay, multipath, GPS SV clock and ephemeris errors, blockage by the Earth and other objects, and integer ambiguities for carrier phase measurements.

Maneuver Planning

Impulsive delta-v and finite duration maneuvers can be modeled using JAT. A Lambert problem solver and a glideslope rendezvous targeting algorithm4, which can be used to accurately model a Shuttle-ISS rendezvous, have been provided in JAT.

Figure 2 Glideslope Rendezvous Trajectory

3

Page 4: Java Astrodynamics Toolkit

Spacecraft Attitude Control Simulation

JAT includes an applet for simulating spacecraft attitude dynamics. The goal of this applet is to provide visualization of spacecraft attitude dynamics that is normally only available in 2-D plots. By expressing dynamics in 3-D animation, it is much easier for users to grasp how spacecraft is affected by various initial conditions and control systems. A full description of this applet is given in Takada5. Nine attitude control scenarios can be simulated with this applet:

1. Single Axis Bang-Bang Control 2. Three Axis Control Moment Gyro Reorientation 3. Constant Torque 4. Four Reaction Wheel Control 5. Gravity Gradient Torques in a Circular Orbit 6. Gravity Gradient Torques in an Elliptical Orbit 7. Simple 2-D Flexible Spacecraft 8. Simple 3-D Flexible Spacecraft 9. Spacecraft with Spherical Damper

Figure 3 JAT Visualization of Simple 3-D Flexible Spacecraft

4

Page 5: Java Astrodynamics Toolkit

Visualization

JAT provides 2-D plotting capabilities by using Ptplot6 from UC Berkeley. Ptplot is a 2-D data plotter implemented in Java. Ptplot can be used as a standalone applet or application, or it can be embedded in an applet or application. JAT provides classes to simplify interfacing with Ptplot.

Figure 4 Trajectory Plot in JAT using Ptplot

JAT provides 3-D visualization using Java3D and OpenGL. JAT provides a high level

programming interface on top of Java3D for creating 3-D visualizations for space flight simulations. Simple commands are available in the library to create and manipulate 3-D objects such as planets, spacecraft, and trajectories. These commands are made to be especially intuitive, such as commands to place and move objects with one line of code. When animations are needed, each frame can be saved as a JPEG file. Software such as Apple Quicktime can then be used to convert these frames to a movie.

Figure 5 3-D Visualization of the Space Shuttle in JAT

5

Page 6: Java Astrodynamics Toolkit

JAT DESIGN PHILOSOPHIES

The philosophies behind the design of JAT are what make it different from existing astrodynamics software packages. These philosophies are described below:

1. One application program cannot adequately solve all astrodynamics problems,

particularly in research and development. Even with the ability to add modules to obtain new functionality, single application programs inherently limit the user to solving only problems envisioned by the designer and to solving them the way the designer envisioned solving them. Therefore, JAT is a collection of tools that allow users to create their own customized applications to solve their problems the way they want to solve them.

2. Since we are asking users to create their own applications, we must make it easy for

them to do so. One of the ways we attempt to do this is by providing many example applications. Another way we do this is to design classes to be as simple to use and bulletproof as possible. Lastly, we provide API documentation and the source code to users to help them create their applications.

3. We believe in getting something working quickly and then making it more general later. We don’t try to create a design to address all possible cases before we do any coding. Instead, we will code something up and get it working for one representative case and then try to generalize it. Sometimes this means rewriting code. This just proves that we don’t really know how to write a piece of code until the second or third time we write it.

WHY JAVA?

We chose to use the Java programming language because it provides many features that are not available in most other languages. One unique feature of Java is that it is truly portable. By making JAT 100% pure Java, we know that JAT will run on almost any known computer platform without modification. Java is object-oriented, which reduces complexity for the programmer by organizing the code around objects in the real world.

Portability

The goal of Java is: write once, run anywhere. The Java compiler does this by generating intermediate instructions, called bytecodes, which are independent of computer architecture. The bytecodes can be interpreted by the Java virtual machine and translated into native machine code on the fly on any system on which the Java interpreter and run-time system have been implemented.

C and C++ both suffer from the defect of designating many fundamental data types as

"implementation dependent". Java eliminates this issue by defining standard behavior that applies to data types across all platforms. Java specifies the sizes of all its primitive data types and the behavior of arithmetic on them.

Object-Oriented

Java is object-oriented, so a Java program consists of one or more objects telling each other what to do by sending messages. A class provides the description or design of an object. Classes

6

Page 7: Java Astrodynamics Toolkit

can be re-used in various ways such as aggregation or inheritance. The concepts of object-oriented programming make it easier to share and re-use code and build on the work of others, which is a major objective of the JAT project.

Development Tools

Programming languages are useless without development tools such as compilers and debuggers. There are many freely available tools for Java developers. The members of the JAT project use the Eclipse (http://www.eclipse.org), an open source integrated development environment. In addition to excellent development tools, Java itself contains an extensive collection of libraries for string manipulation, container classes, networking, distributed computing, and multithreading.

Perhaps one of the most important, but most overlooked Java development tool is Javadoc.

Javadoc automatically creates API documentation in the form of formatted HTML files from properly commented Java code. Documentation generated by Javadoc gives programmers all the information they need to know to use a piece of Java code, which makes it much easier to reuse code or use code that was written by others.

Easy to Write Robust, Bug-Free Code

Java omits many rarely used, poorly understood, confusing features of C++ that in our experience bring more grief than benefit. These omitted features primarily consist of operator overloading (although the Java language does have method overloading), multiple inheritance, and extensive automatic coercions.

Automatic garbage collection in Java relieves the programmer from the burden of allocating

and freeing memory, therefore dramatically cutting down on bugs. The single biggest difference between Java and C or C++ is that Java's memory model eliminates the possibility of overwriting memory and corrupting data. Instead of pointer arithmetic, Java has true arrays and strings, which means that the Java interpreter can check array and string indexes. In addition, a programmer can't write code that turns an arbitrary integer into an object reference by casting.

One of the advantages of a strongly typed language is that it allows extensive compile-time

checking so bugs can be found early. Unfortunately, C++ inherits a number of loopholes in compile-time checking from C, which is relatively lax. Java requires declarations and does not support C-style implicit declarations.

Java is intended for writing programs that must be reliable in a variety of ways. Java puts a lot

of emphasis on early checking for possible problems, later dynamic (runtime) checking, and eliminating situations that are error prone.

WHY OPEN SOURCE?

There are a number of frustrating aspects to using existing proprietary astrodynamics software packages. By making the JAT open source, we have been able to address many of these frustrations.

Underlying Assumptions and Equations

When engineers are asked to provide calculations regarding multi-million dollar space missions, they need to know that underlying assumptions and equations used in their software are

7

Page 8: Java Astrodynamics Toolkit

correct. Some software vendors provide detailed mathematical description documents with their software, but this is not always adequate because subtle errors, such as a simple sign error in the code, can easily be missed by the developer. Open source software gives engineers the ability to look under the hood, see what is there, and check the math.

Improved Software Development

One reason that open source software development is so successful is that it provides a built-in peer review. Bugs are found faster if many people are looking at and using a piece of code and better solutions are often suggested by other developers or users. Since developers know their code is going to be seen by others, they make the extra effort to write quality code and avoid taking shortcuts.

Enhanced Collaboration

Open source software eliminates barriers to collaboration. Cost and access to a particular piece of software are not issues for users of open source software. A community of people can be formed around a piece of open source software and that community can develop a common language and shared knowledge base.

Better Software Support

With proprietary software, only the developer can provide support to users. With open source software, anyone can provide support to users, thus creating a market for software support suppliers. Competition in the support market can lower cost and make the companies providing software support more responsive to users’ needs. If one company is not responsive to a user, the user can find another company that will be.

One of the problems software users often encounter is losing access or support for a key piece

of software. This can be caused by business decisions by the developer, such as deciding to abandon a product or going into bankruptcy; or inability to continue supporting a piece of software due to layoffs or retirements of key personnel. If the users have access to the source code, they can continue to support the software or contract with another company to support it.

A great benefit that users of open source software receive is enhancements to the software

made by others. Development of a new capability can be paid for just once and all users can benefit. This is especially important for organizations like NASA where budgets are tight, but money is often spent at several NASA centers to solve the same problem. This duplicate spending could be reduced or eliminated by the use of open source software.

CONCLUSIONS

JAT is an open source software library of reusable software components for space mission design, trajectory optimization, and simulation of spacecraft navigation, attitude determination and control systems. In this paper, we have described the current features of JAT and presented the rationale for writing it in Java and to making it open source. Besides being written completely in Java, JAT is different from existing astrodynamics software packages because of three unique design philosophies behind JAT:

1. JAT is not a single application program but a collection of tools to allow users to

create their own customized applications. 2. JAT must make it easy for users to create their own applications.

8

Page 9: Java Astrodynamics Toolkit

3. When developing code, we try to quickly get something that works for one problem and then make it handle the general case.

ACKNOWLEDGMENTS

The authors would like to acknowledge the support they received from the University of Texas at Austin and California Polytechnic State University, San Luis Obispo, while creating JAT. We would also like to express our appreciation to Emergent Space Technologies, Inc. and the NASA Goddard Space Flight Center for helping us continue the project. We would also like to express our appreciation to SourceForge.net for hosting JAT and many other open source projects for free.

REFERENCES 1. GNU Licenses Page: http://www.gnu.org/licenses/licenses.html. 2. Vallado, David, Fundamentals of Astrodynamics and Applications, 2nd Edition, Microcosm, 2001. 3. Gaylor, David, Integrated GPS/INS Navigation System Design for Autonomous Spacecraft

Rendezvous, Ph.D. Dissertation, The University of Texas at Austin, Dec 2003. 4. Hablani, Hari B., Tapper, Myron L., and David J. Dana-Bashian, “Guidance and Relative Navigation

for Autonomous Rendezvous in a Circular Orbit,” Journal of Guidance, Control, and Dynamics, Vol. 25, May – June 2002.

5. Takada, Noriko, Development of an Attitude Dynamics Simulation Applet, M. S. Thesis, California

Polytechnic State University, May 2004. 6. Ptplot Website: http://ptolemy.eecs.berkeley.edu/java/ptplot.

9