Skip to content

stanford-ssi/simwise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simwise.jl

6-DOF orbital and attitude propagator for SAMWISE ADCS hardware-in-the-loop (HITL) testing.

See PLAN.md for design planning notes.

Features

  • 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

Setup

Install dependencies:

julia --project=. -e 'import Pkg; Pkg.instantiate()'

This will install all dependencies from Project.toml into a Manifest.toml file.

Adding New Dependencies

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:

  1. Add the package to Project.toml (in [deps] or [extras] depending on target)
  2. Update Manifest.toml with all transitive dependencies
  3. 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.

Quick Start

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)

Running Tests

To run tests with the test script run

chmod +x runtests.sh # Enables you to execute this file as a bash script

To run the tests in the simwise directory:

./runtests.sh

Testing GitHub Actions Locally

Test 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 --reuse

Structure (outdated)

src/
├── dynamics/      # Orbital & attitude dynamics
├── propagators/   # Numerical integrators
├── sensors/       # Sensor models
├── actuators/     # Actuator models
├── hardware/      # Serial communication & protocols
└── utils/         # Frames, quaternions, constants

Key Resources

About

6DOF dual orbit + attitude propagator designed for SAMWISE adcs hitl testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages