scenario_BasicOrbit_LivePlot

Overview

This script duplicates the bskSim basic orbit simulation in the scenario scenario_BasicOrbit. The difference is that instead of plotting the results after the simulation has stopped in this script a separate thread is created to update the plots live during the simulation run itself. For more information on doing live plotting see help file Live Plotting.

The script is found in the folder src/examples/BskSim/scenarios and executed by using:

python3 scenario_BasicOrbit_LivePlot.py

To enable live plotting with a bskSim Basilisk simulation additional python packages Pipe, Process, Lock must be imported.

Next, the bskSim plotting routines must be called with a unique ID number. This is done in this example with:

plotID = min([num for num in range(1,10) if not plt.fignum_exists(num)])
BSK_plt.plot_orbit(r_BN_N, plotID)
plotID = min([num for num in range(1,10) if not plt.fignum_exists(num)])
BSK_plt.plot_orientation(timeLineSet, r_BN_N, v_BN_N, sigma_BN, plotID)

The next step is to setup the live_outputs() method which details what to plot in a live manner.

The setup_live_outputs() method returns the required dataRequests structure as discussed in the Live Plotting documentation page.

scenario_BasicOrbit_LivePlot.run(showPlots, livePlots=False)[source]

The scenarios can be run with the followings setups parameters:

Parameters

showPlots (bool) – Determines if the script should display plots

class scenario_BasicOrbit_LivePlot.scenario_BasicOrbitLive[source]

Bases: BSK_masters.BSKSim, BSK_masters.BSKScenario

configure_initial_conditions()[source]

Developer must override this method in their BSK_Scenario derived subclass.

log_outputs()[source]

Developer must override this method in their BSK_Scenario derived subclass.

pull_outputs(showPlots)[source]

Developer must override this method in their BSK_Scenario derived subclass.