SimBaseClass setup through data retrieval after the run.
Setup overview
Create a SimBaseClass instance
All simulation components attach to a single
SimBaseClass root object.Create processes
A process (task group) is a named container for related tasks. Create one process per logical subsystem — for example, one for dynamics and one for flight software.Processes execute in the order they are created. To override this, pass an integer priority — higher values execute first:The default priority is
-1, meaning the process executes after all positively-prioritized processes in creation order.Create tasks and set update rates
A task is a list of modules that all run at the same fixed rate. The rate is set in nanoseconds — use To delay a task’s first execution, pass Tasks also support priorities, defaulting to
macros.sec2nano() to convert from seconds.The nanosecond is the smallest time unit in Basilisk. A 64-bit unsigned integer at nanosecond resolution represents up to 584 years of simulation time.
FirstStart in nanoseconds:-1:Create and configure modules
Import modules from Module parameters are set directly as Python attributes before
Basilisk.simulation (C++ simulation modules) or Basilisk.fswAlgorithm (C FSW modules). Set ModelTag to a unique string name.InitializeSimulation() is called.Add modules to tasks
Register each module with the task it should run in. The optional Without an explicit priority, modules execute in the order they were added to the task.
priority argument controls execution order within the task — higher values run first.Connect messages
Wire output messages to input messages using For configuration data that doesn’t come from a running module, create a stand-alone message:
.subscribeTo(). Both messages must be of the same payload type.Set up recorders
Create recorder modules to capture message time histories. Add each recorder to a task so it runs every update cycle.
Initialize and run
Call
InitializeSimulation() to trigger the Reset() method on every module and prepare the time loop. Then set the stop time and execute.ConfigureStopTime() takes an absolute time. To continue a simulation for another 100 seconds after already running 200 seconds, set the stop time to 300 seconds:Retrieve recorded data
After execution, access recorded message fields and time arrays from the recorder objects.
msgRec.times() returns recording timestamps in nanoseconds. msgRec.timesWritten() returns the timestamps at which each payload was written — useful when a message is written less frequently than it is read.To clear accumulated recorder data before a second run: