How do I install Basilisk?
How do I install Basilisk?
The quickest way to install Basilisk is via pip:This installs a pre-compiled wheel for your platform and Python version. Supported Python versions are 3.9 through 3.13.If you need to build from source (for example, to enable the
The pip-installed package does not include the
supportData folder. Data files are managed by pooch and downloaded to a system cache directory on first use. See the question below on how to access data file paths.opNav module or use external C++ modules), follow the build-from-source instructions using python conanfile.py.How do I get the tutorial example scripts?
How do I get the tutorial example scripts?
Run the This downloads a copy of the tutorial example scripts to your current directory. The examples are the recommended starting point for learning how to use Basilisk — run them from the
bskExamples command after installing Basilisk:basilisk/examples/ folder to see working simulations.Can I use external C++ modules?
Can I use external C++ modules?
Yes, but you must build Basilisk from source. Pre-compiled pip wheels do not support external C++ module integration.To add an external module:
- Place your module source files in the
src/externalModules/directory. - Rebuild Basilisk using
python conanfile.py. - Import your module in Python using
from Basilisk.externalModules import myModule.
*.i file must include the necessary Basilisk SWIG helpers. See the coding guidelines for required includes.How do I run unit tests?
How do I run unit tests?
Navigate to the To run tests faster using multiple parallel processes:To run the complete test suite including C/C++ To generate an HTML validation report:
basilisk/src/ directory and run pytest:gtest unit tests:Where do I ask questions or report issues?
Where do I ask questions or report issues?
- Questions and general discussion: GitHub Discussions
- Bug reports: GitHub Issues
- Contributing code: see CONTRIBUTING.md and the Coding Guidelines
import Basilisk; print(Basilisk.__version__)), OS, Python version, and a minimal reproducing example.What is the Basilisk message passing interface?
What is the Basilisk message passing interface?
Basilisk uses a publish-subscribe message passing system to connect modules. Each module declares typed input messages (which it reads) and output messages (which it writes). Modules are connected by subscribing an input message to an output message:Messages are strongly typed. The C++ types for input and output messages are All message connections must be established before calling
ReadFunctor<SomeMsgPayload> and Message<SomeMsgPayload> respectively. C-based modules use SomeMsg_C structs.You can also create standalone messages in Python to inject data directly:InitializeSimulation().How do I access support data files (ephemeris, atmosphere, etc.)?
How do I access support data files (ephemeris, atmosphere, etc.)?
Starting in version 2.9.0, This works for both pip-installed and source-built versions. On first use,
supportData files are no longer bundled in the pip package. Basilisk uses pooch to download and cache data files.Use the data path utility to get a portable, platform-independent path:pooch downloads the file to a system cache directory.Do not hard-code paths like
supportData/EphemerisData/de430.bsp in your scripts — these paths will fail on pip-installed versions.How do I perform a clean build?
How do I perform a clean build?
For most cases, delete the If you still see stale dependency issues, also delete the Note that deleting
dist3 folder and rebuild:.conan2 cache in your home directory:.conan2 forces all dependencies to be re-downloaded on the next build.How do I configure PyCharm for Basilisk auto-complete?
How do I configure PyCharm for Basilisk auto-complete?
PyCharm can auto-complete Basilisk module variables and commands if you add the Basilisk package to the project structure.
- Open Settings → Project → Project Structure.
- Add the directory containing the Basilisk package as a source root.
- PyCharm will index the package and provide auto-complete for module attributes.
How do I visualize a simulation with Vizard?
How do I visualize a simulation with Vizard?
Basilisk integrates with the Vizard visualization application. To enable it in a simulation script:Check whether Vizard 2.3.1 and newer is supported by the current release.
vizInterface was built before running Vizard-specific code:How do I use MuJoCo dynamics in Basilisk?
How do I use MuJoCo dynamics in Basilisk?
Basilisk supports MuJoCo as an alternate dynamics engine alongside the native spacecraft dynamics. To use it:
- Build Basilisk from source with MuJoCo support enabled.
- Create an
MJSceneobject and addMJBody,MJJoint, and actuator objects to it. - Add the
MJSceneto your simulation task.
scenarioAttitudeFeedbackRWMuJoCo and scenarioFormationFlyingWithDrag. Run bskExamples to download them.MuJoCo integration is actively developed. Additional capabilities including landing dynamics and expanded actuator support are in progress.
What Python versions does Basilisk support?
What Python versions does Basilisk support?
Basilisk supports Python 3.9 through 3.13. Pre-compiled pip wheels are available for all supported versions on macOS, Linux, and Windows.Python 3.8 support was deprecated in version 2.8.0 and will be removed in a future release.The current release adds cp313 wheel builds for Python 3.13 with updated SWIG ABI support.
How do I contribute a new Basilisk module?
How do I contribute a new Basilisk module?
All new modules must:
- Include a unit test file (filename beginning with
test_). - Include a
.rstdocumentation file (follow the template insrc/moduleTemplates/). - Have unit test methods with documentation strings.
- Include a copyright statement with the current year.
- Follow the Coding Guidelines.
- Include a release-note snippet in
docs/source/Support/bskReleaseNotesSnippets/.
examples/ folder, add a unit test in src/tests/ that imports and runs the example file, and link the example in examples/_default.rst.See CONTRIBUTING.md for the full PR workflow.