A simple ROS-based 2D orbital mechanics simulator
- numerical simulation of spacecraft 2d motion around fixed central body
- rviz visualization and display of states and orbital elements
- user-defined initial conditions and kick-burn thrust
- execution of hohman transfers
- ROS Melodic
- Moba XTerm
- Ubuntu 18.4
The differential equation describing the spacecraft motion in a radial frame is derived from Newton's gravitational force
A kick-burn is modeled as an instantaneous thrust given by a delta velocity at a time instant
A single spacecraft (SC) state vector consists of its cartesian position and velocity - which are in fact numerically integrated. It is also of substancial importance to know the orbital elements, what is possible through a state transformation.
where
In this implementation, a global reference frame is fixed in the central body, while a NTW in-track frame is fixed in the moving small body. The initial states must be given wrt. the global coordinate system, but the thrust action must be determined in the local base.
After launching the nodes with roslaunch launch/orbit_sim.launch
, we can perform the following actions:
1. Adding and removing a spacecraft: by inputting a SC's identifier and its initial state
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Spawn -- 1 -15150 0 0 6.2
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Spawn -- 2 0 -11000 6.5 -1
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Delete 2
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Delete 1
The green-dashed trajectory is the ellipsis resulted from the orbital elements. However, one can obtain a hyperbolic motion when the initial velocities are too high.
2. Applying thrust: given the tuple
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Spawn -- 1 -15150 0 0 6.2
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call Environment/ApplyThrust -- 1 0 0.25
Here the Oberth Effect becomes visible. The same velocity change
3. Performing transfers: given the target orbital elements, a Hohmann Transfer is calculated and if possible executed at the maneuver points.
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Spawn -- 1 14000 0 0 -5.9
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call spawncontrol/Spawn -- 2 14000 0 0 -5.9
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call navigation/SetNewOrbit -- 1 11500 0.10 0
user@mynotebook:~/ws_catkin/src/orbit_sim$ rosservice call navigation/SetNewOrbit -- 2 20500 0.15 0
Hohmann transfers are energetically the most efficient solution for the general Lambert's Transfer, although it has some known restrictions: current and target orbits are elliptical, coplanar and don't intersect each other, and their angular momentum have the same direction. Additional restriction: any desired changes in
In the video above, two SCs start at the same orbit - SC #1 executes a hohmann transfer to an inner orbit, while SC #2 goes to an outer orbit. At the end, the current (green-dashed) and target (pink-dashed) orbits coincide, which indicates a successful maneuver (: