Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorg cleanup #8

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
ko_fi: philiplinden
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# polar: # Replace with a single Polar username
# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
34 changes: 34 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docs

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
RUST_LOG: info

jobs:
book:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: '0.4.10'
# mdbook-version: 'latest'

- run: mdbook build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
66 changes: 0 additions & 66 deletions .github/workflows/extras.yml

This file was deleted.

73 changes: 12 additions & 61 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,55 +1,20 @@
[package]
[workspace]
resolver = "2" # Important for Bevy
members = [
"crates/yahs",
"crates/yahs-cli",
"crates/yahs-ui"
]

[workspace.package]
name = "yahs"
description = "Yet Another HAB Simulator"
version = "0.4.0"
authors = ["Philip Linden <[email protected]>"]
readme = "README.md"
license = "MIT or Apache-2.0"
edition = "2021"

default-run = "yahs"

# When importing this crate as a dependency, use the simulator library as "yahs"
[lib]
name = "yahs"
path = "src/simulator/src/lib.rs"

# When running this project as a CLI, use the CLI binary as "yahs"
[[bin]]
name = "yahs"
path = "src/cli/src/main.rs"

# These are the dependencies when building the CLI from the project root
[dependencies]
# Simulator dependencies
yahs-simulator = { path = "src/simulator" }
bevy = { workspace = true }
avian3d = { workspace = true }
bevy-trait-query = { workspace = true }

# CLI dependencies
yahs-cli = { path = "src/cli" }
bevy_ratatui = "0.7.0"
ratatui = "0.29"
color-eyre = "0.6.3"
crossterm = "0.28.1"

[features]
default = ["dev"]
dev = ["yahs-cli/dev", "yahs-simulator/dev"]

[workspace.package]
authors = ["Philip Linden <[email protected]>"]
edition = "2021"
license = "MIT or Apache-2.0"

[workspace]
resolver = "2" # Important for Bevy
members = [
"src/simulator",
"src/cli",
"src/ui"
]
license-file = "LICENSE-APACHE"

[workspace.dependencies]
# Shared dependencies with fixed versions
Expand All @@ -59,21 +24,6 @@ bevy = { version = "0.15.0", default-features = false, features = [
avian3d = { git = "https://github.com/Jondolf/avian.git", branch = "main" }
bevy-trait-query = "0.7.0"

# -----------------------------------------------------------------------------
# Some Bevy optimizations
# -----------------------------------------------------------------------------

# Idiomatic Bevy code often triggers these lints, and the CI workflow treats
# them as errors. In some cases they may still signal poor code quality however,
# so consider commenting out these lines.
[lints.clippy]
# Bevy supplies arguments to systems via dependency injection, so it's
# natural for systems to request more than 7 arguments -- which triggers
# this lint.
too_many_arguments = "allow"
# Queries that access many components may trigger this lint.
type_complexity = "allow"

# Compile with Performance Optimizations:
# https://bevyengine.org/learn/quick-start/getting-started/setup/#compile-with-performance-optimizations

Expand All @@ -92,7 +42,8 @@ debug = false
[profile.release]
# Compile the entire crate as one unit. Slows compile times, marginal
# improvements.
codegen-units = 1
# codegen-units = 1

# Optimize with size in mind (also try "z", sometimes it is better).
# Slightly slows compile times, great improvements to file size and runtime
# performance.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

A high altitude balloon flight simulator built in
[Bevy](https://bevyengine.org/) with Rust, inspired by
[tkschuler/EarthSHAB](https://github.com/tkschuler/EarthSHAB).
[tkschuler/EarthSHAB](https://github.com/tkschuler/EarthSHAB) and
[mfc-apps](https://github.com/Brickworks/mfc-apps).

[devlog](docs/devlog.md)

Expand All @@ -28,7 +29,7 @@ fn main() {
```

Then you can use all of the components and systems from the
[`yahs-simulator`](./src/simulator/README.md) crate.
[`yahs`](./crates/yahs/README.md) crate.


### As an application
Expand Down
2 changes: 1 addition & 1 deletion src/cli/Cargo.toml → crates/yahs-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "yahs-cli"
path = "src/main.rs"

[dependencies]
yahs-simulator = { path = "../simulator" }
yahs = { path = "../yahs" }
bevy = { workspace = true, features = [
"bevy_state",
"multi_threaded",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/ui/Cargo.toml → crates/yahs-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "yahs-ui"
path = "src/main.rs"

[dependencies]
yahs-simulator = { path = "../simulator" }
yahs = { path = "../yahs" }
bevy = { workspace = true, default-features = false, features = [
"bevy_asset",
"bevy_core_pipeline",
Expand All @@ -38,6 +38,6 @@ dev = [
"avian3d/debug-plugin",
"bevy/bevy_dev_tools",
"bevy/dynamic_linking",
"yahs-simulator/dev",
"yahs/dev",
]
inspect = ["bevy-inspector-egui"]
1 change: 1 addition & 0 deletions crates/yahs-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# yahs-ui
2 changes: 1 addition & 1 deletion src/ui/src/camera.rs → crates/yahs-ui/src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bevy::{
use std::f32::consts::PI;

use super::controls::{CameraControls, KeyBindingsConfig};
use yahs_simulator::prelude::Balloon;
use yahs::prelude::Balloon;

pub struct CameraPlugin;

Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/controls.rs → crates/yahs-ui/src/controls.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy::prelude::*;

use yahs_simulator::prelude::{SimState, TimeScaleOptions};
use yahs::prelude::{SimState, TimeScaleOptions};

pub struct ControlsPlugin;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ui/src/gizmos.rs → crates/yahs-ui/src/gizmos.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy::{color::palettes::basic::*, prelude::*};

use crate::simulator::forces::Force;
use yahs::forces::Force;

const ARROW_SCALE: f32 = 0.1;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ui/src/main.rs → crates/yahs-ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use bevy::{
asset::AssetMetaCheck,
};

use yahs_simulator::prelude::SimulatorPlugins;
use yahs::prelude::SimulatorPlugins;

fn main() {
App::new()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/scene.rs → crates/yahs-ui/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use avian3d::prelude::*;
use bevy::prelude::*;
use std::f32::consts::PI;

use yahs_simulator::prelude::*;
use yahs::prelude::*;

pub struct ScenePlugin;

Expand Down
2 changes: 1 addition & 1 deletion src/simulator/Cargo.toml → crates/yahs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "yahs-simulator"
name = "yahs"
version = "0.4.0"
description = "High Altitude Balloon simulation plugin for Bevy"
edition = "2021"
Expand Down
1 change: 1 addition & 0 deletions crates/yahs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# yahs
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 9 additions & 3 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Summary

[Introduction](index.md)

---

- [yahs-sim](crates/yahs-sim/README.md)
- [yahs-ui](crates/yahs-ui/README.md)
- [yahs-cli](crates/yahs-cli/README.md)
# Crates

- [yahs](../crates/yahs/README.md)
- [yahs-ui](../crates/yahs-ui/README.md)
- [yahs-cli](../crates/yahs-cli/README.md)

---

# Development

[Devlog](devlog.md)
19 changes: 19 additions & 0 deletions docs/devlog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# development log

## 2024-12-16

I'm leaning into the use case of running this as the "outside world" interface
for a software-in-the-loop simulation. I think there are a few things I need to
figure out before that is possible:

- Host the simulation as a server or otherwise "free running" environment.
- Connect a client application that can send commands and receive telemetry or
data from sensors, where the telemetry is created by the server and supplied
to the client over normal network protocols that it would expect from actual
hardware.
- The server and client applications should be able to run in a headless mode,
or otherwise without a UI.

It would be ideal if this was not required---I'd like to be able to run a
completely virtual vehicle along with a software-in-the-loop simulation. In a
sense this is the same as running a completely passive vehicle in the sim while
also allowing for an active vehicle too.

## 2024-12-15

- Added [mdbook](https://github.com/rust-lang/mdBook) to the project.
Expand Down
Loading
Loading