Skip to main content
Basilisk ships two families of modules. Simulation modules (Basilisk.simulation) model physical spacecraft components and environments. FSW algorithm modules (Basilisk.fswAlgorithms) implement the onboard flight software that processes sensor data and commands actuators. Every module — regardless of category — connects to the rest of the simulation through typed input and output messages. You mix and match modules from both families in the same simulation.

Simulation modules

Dynamics

Rigid body spacecraft, reaction wheels, thrusters, fuel tanks, hinged panels, flexible appendages, constraint effectors, and gravity gradient.

Environment

Gravity (SPICE ephemeris), atmosphere models (exponential, MSIS), magnetic field (centered dipole, WMM), eclipse, albedo, solar flux, and ground locations.

Sensors

IMU, coarse sun sensors (CSS), star trackers, magnetometers, GPS receivers, and optical sensors. All sensor modules support configurable noise.

Power

Solar panels, battery storage, power consumption tracking, and power node network modeling.

Communication

Ground station contacts, access windows, transmitters and receivers, and inter-satellite link modeling.

Thermal

Nodal thermal network modeling for spacecraft thermal management analysis.

Dynamics modules in depth

The simulation/dynamics package contains the core mechanical simulation:
The spacecraft module (Basilisk.simulation.spacecraft) is the central dynamics object for most simulations. It integrates the translational and rotational equations of motion and accepts effectors (forces and torques) from attached modules.Related modules include spacecraftSystem for multi-body configurations, prescribedMotion for kinematically-driven appendages, and spinningBodies for rotating components.
reactionWheels models reaction wheel arrays. It accepts motor torque command messages and outputs angular velocity and friction state messages. The module handles both simple wheel models and detailed jitter models including imbalance effects.
The Thrusters module accepts on/off pulse commands and computes impulsive and continuous thrust force and torque contributions to the spacecraft dynamics.
HingedRigidBodies, NHingedRigidBodies, and dualHingedRigidBodies model solar panel flexing and other hinged appendages. LinearSpringMassDamper and sphericalPendulum model fuel slosh.
gravityEffector integrates SPICE-based point-mass gravity from multiple bodies. RadiationPressure and facetSRPDynamicEffector model solar radiation pressure with configurable spacecraft geometry.

Environment modules in depth

spiceInterface wraps NASA NAIF SPICE to provide high-fidelity planet state data. ephemerisConverter converts between SPICE output and Basilisk’s internal message types. planetEphemeris provides simple analytic planet positions.
ExponentialAtmosphere gives a simple density-altitude model. MsisAtmosphere implements the NRLMSISE-00 empirical atmospheric model for drag calculations at low Earth orbit altitudes.
magneticFieldCenteredDipole models Earth’s field as an offset dipole. magneticFieldWMM uses the World Magnetic Model for higher-fidelity calculations.
groundLocation computes access windows and range/azimuth/elevation between a spacecraft and a fixed ground site. spacecraftLocation does the same between two spacecraft.

FSW algorithm modules

Attitude determination

Sunline filters, coarse sun sensor (CSS) estimation, Kalman filters (MEKF, UKF), and sensor fusion for attitude estimation.

Attitude guidance

Reference attitude generation for sun-safe pointing, nadir pointing, velocity-frame pointing, target tracking, and orbital maneuver sequences.

Attitude control

MRP feedback control, rate damping, momentum dumping, thruster null-motion management, and variable-speed CMG steering laws.

Orbit control

Delta-V targeting, station-keeping maneuver planning, formation flying control, and small-body proximity operations.

FSW modules in depth

Modules in this package estimate the spacecraft’s attitude from sensor measurements. Key modules include:
  • sunlineEKF / sunlineUKF — extended and unscented Kalman filters for sunline estimation from CSS data
  • okeefeEKF — O’Keefe filter for sun-heading estimation
  • headingSuKF — sigma-point filter for general heading estimation
  • inertialUKF — full inertial attitude UKF using star tracker and rate gyro data
Guidance modules generate AttRefMsgPayload messages that specify the desired reference attitude, reference angular rate, and reference angular acceleration. Key modules include:
  • sunSafePoint — points a body axis toward the sun using CSS measurements
  • locationPointing — points a body axis toward a ground or celestial target
  • velocityPoint — aligns a body axis with the velocity vector (nadir-pointing variant: naivePlanetPoint)
  • mrpRotation — generates smooth MRP attitude reference maneuvers
  • attTrackingError — computes the tracking error between current and reference attitude
Attitude control modules read tracking error messages and produce torque command messages for actuators. Key modules include:
  • mrpFeedback — nonlinear MRP-based feedback control law; optionally incorporates reaction wheel gyroscopic terms
  • mrpSteering — steering law using MRP kinematics directly
  • rateServoFullNonlinear — full nonlinear rate servo for reaction wheel speed management
  • thrForceMapping — maps a desired torque to thruster on-time pulses
Orbit control and targeting modules (located in fswAlgorithms/dvGuidance):
  • lambertPlanner — propagates current state to maneuver time and packages the Lambert problem
  • lambertSolver — Lambert problem solver for two-impulse orbit transfer design
  • lambertValidator — validates the Lambert solution and outputs the first delta-V command
  • lambertSecondDV — computes the second delta-V at the end of the Lambert arc
  • orbElemOffset — computes a reference position offset from a chief by orbital element differences
  • smallBodyWaypointFeedback — proximity operations waypoint guidance for small body missions
Modules that translate high-level commands into actuator-specific commands (located in fswAlgorithms/effectorInterfaces):
  • rwMotorTorque — distributes a desired control torque across the reaction wheel array
  • rwMotorVoltage — maps wheel torque commands to motor voltage
  • thrForceMapping — maps a desired force/torque vector to thruster on-time fractions
  • thrFiringSchmitt — Schmitt trigger logic for thruster pulse-width modulation
  • thrFiringRemainder — remainder thruster firing to minimize accumulated error
  • dipoleMapping — maps a desired magnetic dipole to magnetorquer commands

Selecting modules for your simulation

Start with the integrated example scenarios in src/examples/. Each scenario imports a specific set of modules and wires them together — reading an example that matches your application is the fastest way to identify which modules you need.
For a basic attitude control simulation you typically need:
  1. Dynamics: spacecraft, reactionWheels, gravityEffector, spiceInterface
  2. Navigation: simpleNav (passes through truth state with optional noise; located in simulation/navigation)
  3. Guidance: one attGuidance module matching your pointing mode
  4. Control: attTrackingError + mrpFeedback + rwMotorTorque
For an orbit-and-attitude simulation with power and communication tracking, add:
  1. Environment: eclipse, groundLocation
  2. Power: simpleSolarPanel, simpleBattery, simplePowerSink
  3. Communication: spaceToGroundTransmitter, groundStation

Build docs developers (and LLMs) love