scenarioFormationBasic¶
Overview¶
Demonstrates a basic method to simulate 3 satellites with 6-DOF motion and how to visualize the simlation data in Vizard. One satellite is a 3-axis attitude controlled satellite, while the second satellite is a tumbling space debris object. The controlled satellite simulation components are taken from scenarioAttitudeFeedbackRW. The purpose of this script is to show an explicit method to setup multiple satellites, and also show how to store the Basilisk simulation data to be able to visualize both satellite’s motions within the Vizard application.
The script is found in the folder src/examples
and executed by using:
python3 scenarioFormationBasic.py
The simulation layout is shown in the following illustration. A single simulation process is created which contains both the servicer spacecraft and associated the Flight Software (FSW) algorithm modules, as well as the first debris object that has 2 free-spinning RWs, and another debris object that is an inert rigid body.
When the simulation completes several plots are shown for the servicer MRP attitude history, the rate tracking errors, the RW motor torque components, as well as the RW wheel speeds.
The simulation setups the spacecraft with 3 RW devices similar to scenarioAttitudeFeedbackRW. One difference is that here hillPointing is used to align the spacecraft with the Hill frame. The two debris objects are in a lead-follower configuration with the servicer and are 20m and 40m ahead respectively.
This simulation scripts illustrates how to use the vizSupport methods to record the simulation data such
that it can be viewed in the Vizard visualization. Two methods of setting up the vizInterface module are shown.
If useMsgNameDefaults
is set to true, then a default naming scheme is used to label the spacecraft state messages.
The first spacecraft, i.e. the servicer in this script, uses the default spacecraft state output message.
The following spacecraft have a number 2, 3, etc. attached to the default names. The script also illustrates
how to specify that each space object has a different number of RW devices.
If useMsgNameDefaults
is set to false, then the simulation script illustrates how to manually configure
the spacecraft Data list of vizInterface. This method is more verbose, but also allows to alternate
spacecraft state message naming schemes.
Illustration of Simulation Results¶
show_plots = True, useMsgNameDefaults = True
Note that in the RW motor torque plot both the required control torque \(\hat u_B\) and the true motor torque \(u_B\) are shown. This illustrates that with this maneuver the RW devices are being saturated, and the attitude still eventually stabilizes.
-
scenarioFormationBasic.
plot_attitude_error
(timeData, dataSigmaBR)[source]¶ Plot the attitude errors.
-
scenarioFormationBasic.
plot_rate_error
(timeData, dataOmegaBR)[source]¶ Plot the body angular velocity rate tracking errors.
-
scenarioFormationBasic.
plot_rw_cmd_torque
(timeData, dataUsReq, numRW)[source]¶ Plot the RW command torques.
-
scenarioFormationBasic.
plot_rw_motor_torque
(timeData, dataUsReq, dataRW, numRW)[source]¶ Plot the RW actual motor torques.
-
scenarioFormationBasic.
plot_rw_speeds
(timeData, dataOmegaRW, numRW)[source]¶ Plot the RW spin rates.
-
scenarioFormationBasic.
run
(show_plots, useMsgNameDefaults)[source]¶ The scenarios can be run with the followings setups parameters:
- Parameters
show_plots (bool) – Determines if the script should display plots
useMsgNameDefaults (bool) – Specify if default message naming is used for the additional space objects