# scenarioFormationBasic¶

## Overview¶

Demonstrates a basic method to simulate 3 satellites with 6-DOF motion and how to visualize the simulation 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 basilisk/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 Module: hillPoint is used to align the spacecraft with the Hill frame. The two debris objects are in a 2:1 centered ellipse and a lead-follower configuration with the servicer respectively. The servicer camera has a camera instrument attached that is pointing in the 3rd body axis direction. The servicer has a light attached to illuminate the debris object.

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.

## Illustration of Simulation Results¶

show_plots = 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)[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