https://github.com/elodin-sys/elodin Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} elodin-sys / elodin Public * Notifications * Fork 1 * Star 31 * Physics simulation software for space + aerospace elodin.systems 31 stars 1 fork Branches Tags Activity Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights elodin-sys/elodin This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 105 Commits LICENSES LICENSES libs libs .gitignore .gitignore Cargo.toml Cargo.toml README.md README.md View all files Repository files navigation * README banner Elodin is a platform for rapid design, testing, and simulation of drones, satellites, and aerospace control systems. Quick Demo: https://app.elodin.systems/sandbox/hn/cube-sat Sandbox Alpha: https://app.elodin.systems Docs (WIP): https://docs.elodin.systems This repository is a collection of core libraries: * libs/nox: Tensor library that compiles to XLA (like JAX, but for Rust). * libs/nox-ecs: Rust ECS framework built to work with JAX and Nox, that allows you to build your own physics engine. * libs/nox-py: Python version of nox-ecs, that works with JAX * libs/nox-ecs-macros: Derive macros to generate implementations of ECS and Nox traits. * libs/conduit: Column-based protocol for transferring ECS data between different systems. * libs/xla-rs: Rust bindings to XLA's C++ API (originally based on https://github.com/LaurentMazare/xla-rs). Join us on Discord: https://discord.gg/agvGJaZXy5! Getting Started 1. Install Rust using https://rustup.rs 2. Setup a new venv with: python3 -m venv .venv . .venv/bin/activate.fish # or activate.sh if you don't use fish 3. Install elodin, and matplotlib with pip install libs/nox-py pip install matplotlib 4. Try running the following code import matplotlib.pyplot as plt import jax.numpy as np from elodin import * @system def gravity(q: Query[WorldPos]) -> Query[Force]: return q.map(Force, lambda _p: Force.from_linear(np.array([0.0, -9.81, 0.0]))) @system def bounce(q: Query[WorldPos, WorldVel]) -> Query[WorldVel]: return q.map(WorldVel, lambda p, v: jax.lax.cond( jax.lax.max(p.linear()[1], v.linear()[1]) < 0.0, lambda _: WorldVel.from_linear(v.linear() * np.array([1.,-1.,1.]) * 0.85), lambda _: v, operand=None )) w = WorldBuilder() w.spawn( Body( world_pos=WorldPos.from_linear(np.array([0.0, 10.0, 0.0])), world_vel=WorldVel.from_linear(np.array([0.0, 0.0, 0.0])), inertia=Inertia.from_mass(1.0), ) ) client = Client.cpu() exec = w.build(bounce.pipe(six_dof(1.0 / 60.0, gravity))) t = range(500) pos = [] for _ in t: exec.run(client) y = exec.column_array(ComponentId("world_pos"))[0, 5] pos.append(y) fig, ax = plt.subplots() ax.plot(t, pos) plt.show() License Licensed under either of * Apache License, Version 2.0 * MIT License at your option. Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. About Physics simulation software for space + aerospace elodin.systems Topics space aerospace ecs physics-simulation Resources Readme Activity Custom properties Stars 31 stars Watchers 1 watching Forks 1 fork Report repository Releases No releases published Packages 0 No packages published Contributors 4 * @sphw sphw Sascha Wise * @akhilles akhilles Akhil Velagapudi * @ch-greams ch-greams Andrei Khvalko * @x46085 x46085 Daniel Driscoll Languages * Rust 96.6% * Python 3.3% * Dockerfile 0.1% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.