6-DOF orbital and attitude propagator for SAMWISE ADCS hardware-in-the-loop (HITL) testing.
See PLAN.md for design planning notes.
- 6-DOF Dynamics: Orbital mechanics and attitude kinematics with environmental models (gravity, magnetic field, drag)
- Sensor Models: Gyroscope, magnetometer, sun sensor, GPS
- Actuator Models: Reaction wheels, magnetorquers, thrusters
- Serial Interface: Real-time communication with flight computers
- Flexible Integrators: RK4, RK45, and more via DifferentialEquations.jl
Install dependencies:
julia --project=. -e 'import Pkg; Pkg.instantiate()'This will install all dependencies from Project.toml into a Manifest.toml file.
For uninstalled dependencies (code that runs in production):
julia --project=. -e 'import Pkg; Pkg.add("PackageName")'For test-only dependencies (packages only used in tests):
julia --project=. -e 'import Pkg; Pkg.add("PackageName"; target="test")'This will automatically:
- Add the package to
Project.toml(in[deps]or[extras]depending on target) - Update
Manifest.tomlwith all transitive dependencies - Download and precompile the package
Important: Any package you import with using or import must be listed in Project.toml as a direct dependency, even if it's already present as a transitive dependency in Manifest.toml.
using Simwise
# Initialize satellite state
state = SatelliteState(
position = [500.0, 0.0, 0.0], # km (ECI)
velocity = [0.0, 7.5, 0.0], # km/s
quaternion = [0.0, 0.0, 0.0, 1.0], # body to ECI
angular_velocity = [0.0, 0.0, 0.0] # rad/s
)
# TODO: check spacex-provided parameters
# Propagate 60 seconds
new_state = propagate!(state, 60.0, config)
# Hardware-in-the-loop
serial = SerialConnection("/dev/ttyUSB0")
run_hil_simulation(duration=3600.0, dt=0.01)To run tests with the test script run
chmod +x runtests.sh # Enables you to execute this file as a bash scriptTo run the tests in the simwise directory:
./runtests.shTest GitHub Actions workflows locally before pushing using act:
# Install act (macOS)
brew install act
# Run workflows locally
act push --container-architecture linux/amd64
# Reuse container for faster subsequent runs
act push --container-architecture linux/amd64 --reusesrc/
├── dynamics/ # Orbital & attitude dynamics
├── propagators/ # Numerical integrators
├── sensors/ # Sensor models
├── actuators/ # Actuator models
├── hardware/ # Serial communication & protocols
└── utils/ # Frames, quaternions, constants
- SatelliteToolbox.jl for core math and modeling
- SatelliteToolboxGeomagneticField.jl for IGRF 14 modeling
- SatelliteToolboxAtmosphericModels.jl for atmospheric models
- etc.
- SatelliteDynamics.jl for attitude and orbital dynamics, integrators, and propagators
- Made by postdoc Duncan Eddy @ Stanford