diff --git a/.direnv/flake-profile b/.direnv/flake-profile new file mode 120000 index 0000000..0c05709 --- /dev/null +++ b/.direnv/flake-profile @@ -0,0 +1 @@ +flake-profile-1-link \ No newline at end of file diff --git a/.direnv/flake-profile-1-link b/.direnv/flake-profile-1-link new file mode 120000 index 0000000..0191cdd --- /dev/null +++ b/.direnv/flake-profile-1-link @@ -0,0 +1 @@ +/nix/store/4l8l6f4g622lh0513c8qb7l2pnc4jm64-nix-shell-env \ No newline at end of file diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 81ac21c..919f1e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /target results/ configurations/final +drone_controller/target +simulation/target diff --git a/Cargo.lock b/Cargo.lock index 17e5dbb..1ddc477 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,6 +9,7 @@ dependencies = [ "clap", "clearscreen", "csv", + "drone_controller", "gilrs", "glam 0.27.0", "macroquad", @@ -359,6 +360,20 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" +[[package]] +name = "drone_controller" +version = "0.1.0" +dependencies = [ + "clap", + "macroquad", + "nalgebra", + "rapier3d", + "serde", + "serde_json", + "serde_with", + "toml", +] + [[package]] name = "dyn-clone" version = "1.0.20" diff --git a/Cargo.toml b/Cargo.toml index 237b682..b8f6aac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,39 +1,14 @@ -[package] -name = "RustPhysicsMQ" -version = "0.1.0" -edition = "2024" -default-run = "RustPhysicsMQ" +[workspace] +resolver = "3" +members = ["simulation", "drone_controller"] -[dependencies] -macroquad = "0.4.14" -rapier3d = { version = "0.31", features = ["simd-stable"] } -nalgebra = { version = "0.34", features = ["convert-glam027"] } -glam = "0.27" -rand = "0.9.2" -strum = { version = "0.27", features = ["derive"] } -clearscreen = "4.0.2" -gilrs = "0.11.0" -serde = { version = "1.0.228", features = ["serde_derive"] } -toml = "0.9.8" -csv = "1.4.0" - -serde_with = "3" -serde_json = "1.0.149" - -clap = { version = "4", features = ["derive"] } - - -# [profile.dev.package.rapier3d] -# opt-level = 3 - -[profile.dev.package."*"] +[profile.release] opt-level = 3 -[[bin]] -name = "record" -path = "src/main_record.rs" + +[profile.dev.package.rapier3d] +opt-level = 3 -[[bin]] -name = "test" -path = "src/main_testing.rs" +[profile.dev.package.nalgebra] +opt-level = 3 diff --git a/configurations/mot/mot_tc.toml b/configurations/mot/mot_tc.toml new file mode 100644 index 0000000..0a0cf5d --- /dev/null +++ b/configurations/mot/mot_tc.toml @@ -0,0 +1,14 @@ + +max_thrust = 2.6 +max_torque = 0.5 +mass = 0.350 + +time_constant = 0.03 + +# roll, pitch, yaw +motor_map = [ + [1.0, -1.0, 1.0], # Front Right + [-1.0, -1.0, -1.0], # Front Left + [-1.0, 1.0, 1.0], # Rear Left + [1.0, 1.0, -1.0], # Rear Right +] diff --git a/configurations/mot/mot_tc2.toml b/configurations/mot/mot_tc2.toml new file mode 100644 index 0000000..81253a7 --- /dev/null +++ b/configurations/mot/mot_tc2.toml @@ -0,0 +1,14 @@ + +max_thrust = 2.6 +max_torque = 0.5 +mass = 0.350 + +time_constant = 0.05 + +# roll, pitch, yaw +motor_map = [ + [1.0, -1.0, 1.0], # Front Right + [-1.0, -1.0, -1.0], # Front Left + [-1.0, 1.0, 1.0], # Rear Left + [1.0, 1.0, -1.0], # Rear Right +] diff --git a/configurations/pid_cont/rate_031.toml b/configurations/pid_cont/rate_031.toml new file mode 100644 index 0000000..ebfa70e --- /dev/null +++ b/configurations/pid_cont/rate_031.toml @@ -0,0 +1,26 @@ + +stack = { max_rate = 3.14, rotation_pid = { kp = [ + 10.0, + 10.0, + 10.0, +], ki = [ + 2.0, + 2.0, + 2.0, +], kd = [ + 0.0, + 0.0, + 0.0, +], frequency = 50.0 }, rate_pid = { kp = [ + 0.1, + 0.1, + 1.0, +], ki = [ + 0.0, + 0.0, + 0.0, +], kd = [ + 0.0, + 0.0, + 0.0, +], frequency = 600.0 } } diff --git a/configurations/pid_cont/rate_0312.toml b/configurations/pid_cont/rate_0312.toml new file mode 100644 index 0000000..a7596bc --- /dev/null +++ b/configurations/pid_cont/rate_0312.toml @@ -0,0 +1,26 @@ + +stack = { max_rate = 3.14, rotation_pid = { kp = [ + 10.0, + 10.0, + 10.0, +], ki = [ + 2.0, + 2.0, + 2.0, +], kd = [ + 0.0, + 0.0, + 0.0, +], frequency = 50.0 }, rate_pid = { kp = [ + 0.05, + 0.05, + 0.5, +], ki = [ + 0.0, + 0.0, + 0.0, +], kd = [ + 0.0, + 0.0, + 0.0, +], frequency = 600.0 } } diff --git a/drone_controller/Cargo.lock b/drone_controller/Cargo.lock new file mode 100644 index 0000000..25da3ce --- /dev/null +++ b/drone_controller/Cargo.lock @@ -0,0 +1,1497 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "downcast-rs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" + +[[package]] +name = "drone_controller" +version = "0.1.0" +dependencies = [ + "clap", + "macroquad", + "nalgebra", + "rapier3d", + "serde", + "serde_json", + "serde_with", + "toml", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "ena" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabffdaee24bd1bf95c5ef7cec31260444317e72ea56c4c91750e8b7ee58d5f1" +dependencies = [ + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "fontdue" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e57e16b3fe8ff4364c0661fdaac543fb38b29ea9bc9c2f45612d90adf931d2b" +dependencies = [ + "hashbrown 0.15.5", + "ttf-parser", +] + +[[package]] +name = "glam" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "333928d5eb103c5d4050533cec0384302db6be8ef7d3cebd30ec6a35350353da" + +[[package]] +name = "glam" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3abb554f8ee44336b72d522e0a7fe86a29e09f839a36022fa869a7dfe941a54b" + +[[package]] +name = "glam" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4126c0479ccf7e8664c36a2d719f5f2c140fbb4f9090008098d2c291fa5b3f16" + +[[package]] +name = "glam" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01732b97afd8508eee3333a541b9f7610f454bb818669e66e90f5f57c93a776" + +[[package]] +name = "glam" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525a3e490ba77b8e326fb67d4b44b4bd2f920f44d4cc73ccec50adc68e3bee34" + +[[package]] +name = "glam" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8509e6791516e81c1a630d0bd7fbac36d2fa8712a9da8662e716b52d5051ca" + +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" + +[[package]] +name = "glam" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" + +[[package]] +name = "glam" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f597d56c1bd55a811a1be189459e8fad2bbc272616375602443bdfb37fa774" + +[[package]] +name = "glam" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e4afd9ad95555081e109fe1d21f2a30c691b5f0919c67dfa690a2e1eb6bd51c" + +[[package]] +name = "glam" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" + +[[package]] +name = "glam" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" + +[[package]] +name = "glam" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" + +[[package]] +name = "glam" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" + +[[package]] +name = "glam" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8babf46d4c1c9d92deac9f7be466f76dfc4482b6452fc5024b5e8daf6ffeb3ee" + +[[package]] +name = "glam" +version = "0.30.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fc433e8437a212d1b6f1e68c7824af3aed907da60afa994e7f542d18d12aa9" + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "image" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-traits", + "png", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "macroquad" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2befbae373456143ef55aa93a73594d080adfb111dc32ec96a1123a3e4ff4ae" +dependencies = [ + "fontdue", + "glam 0.27.0", + "image", + "macroquad_macro", + "miniquad", + "quad-rand", +] + +[[package]] +name = "macroquad_macro" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b1d96218903768c1ce078b657c0d5965465c95a60d2682fd97443c9d2483dd" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "miniquad" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fb3e758e46dbc45716a8a49ca9edc54b15bcca826277e80b1f690708f67f9e3" +dependencies = [ + "libc", + "ndk-sys", + "objc-rs", + "winapi", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "nalgebra" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4d5b3eff5cd580f93da45e64715e8c20a3996342f1e466599cf7a267a0c2f5f" +dependencies = [ + "approx", + "glam 0.14.0", + "glam 0.15.2", + "glam 0.16.0", + "glam 0.17.3", + "glam 0.18.0", + "glam 0.19.0", + "glam 0.20.5", + "glam 0.21.3", + "glam 0.22.0", + "glam 0.23.0", + "glam 0.24.2", + "glam 0.25.0", + "glam 0.27.0", + "glam 0.28.0", + "glam 0.29.3", + "glam 0.30.10", + "matrixmultiply", + "nalgebra-macros", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nalgebra-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973e7178a678cfd059ccec50887658d482ce16b0aa9da3888ddeab5cd5eb4889" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "objc-rs" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a1e7069a2525126bf12a9f1f7916835fafade384fb27cabf698e745e2a1eb8" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "ordered-float" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4779c6901a562440c3786d08192c6fbda7c1c2060edd10006b05ee35d10f2d" +dependencies = [ + "num-traits", +] + +[[package]] +name = "parry3d" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99471b7b6870f7fe406d5611dd4b4c9b07aa3e5436b1d27e1515f9832bb0c6b" +dependencies = [ + "approx", + "arrayvec", + "bitflags 2.11.0", + "downcast-rs", + "either", + "ena", + "foldhash 0.2.0", + "glam 0.30.10", + "hashbrown 0.16.1", + "log", + "nalgebra", + "num-derive", + "num-traits", + "ordered-float", + "rstar", + "simba", + "slab", + "smallvec", + "spade", + "static_assertions", + "thiserror", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "quad-rand" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a651516ddc9168ebd67b24afd085a718be02f8858fe406591b013d101ce2f40" + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rapier3d" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68073fdc88f6b709002767ce8deffffb05ac06824bf9f98a23e270bcea64ba9f" +dependencies = [ + "approx", + "arrayvec", + "bit-vec", + "bitflags 2.11.0", + "downcast-rs", + "log", + "nalgebra", + "num-derive", + "num-traits", + "ordered-float", + "parry3d", + "profiling", + "rustc-hash", + "simba", + "static_assertions", + "thiserror", + "vec_map", + "wide", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "robust" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e27ee8bb91ca0adcf0ecb116293afa12d393f9c2b9b9cd54d33e8078fe19839" + +[[package]] +name = "rstar" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "421400d13ccfd26dfa5858199c30a5d76f9c54e0dba7575273025b43c5175dbb" +dependencies = [ + "heapless", + "num-traits", + "smallvec", +] + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_with" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "381b283ce7bc6b476d903296fb59d0d36633652b633b27f64db4fb46dcbfc3b9" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.13.0", + "schemars 0.9.0", + "schemars 1.2.1", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6d4e30573c8cb306ed6ab1dca8423eec9a463ea0e155f45399455e0368b27e0" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simba" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c99284beb21666094ba2b75bbceda012e610f5479dfcc2d6e2426f53197ffd95" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "spade" +version = "2.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb313e1c8afee5b5647e00ee0fe6855e3d529eb863a0fdae1d60006c4d1e9990" +dependencies = [ + "hashbrown 0.15.5", + "num-traits", + "robust", + "smallvec", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap 2.13.0", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_parser" +version = "1.0.9+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + +[[package]] +name = "ttf-parser" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "wasm-bindgen" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/drone_controller/Cargo.toml b/drone_controller/Cargo.toml new file mode 100644 index 0000000..9a800c9 --- /dev/null +++ b/drone_controller/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "drone_controller" +version = "0.1.0" +edition = "2024" + +[dependencies] + +macroquad = "0.4.14" +rapier3d = { version = "0.31", features = ["simd-stable"] } +nalgebra = { version = "0.34" } +serde = { version = "1.0.228", features = ["serde_derive"] } +toml = "0.9.8" + +serde_with = "3" +serde_json = "1.0.149" + +clap = { version = "4", features = ["derive"] } diff --git a/src/config.rs b/drone_controller/src/config.rs similarity index 81% rename from src/config.rs rename to drone_controller/src/config.rs index d5f88d9..31ead2d 100644 --- a/src/config.rs +++ b/drone_controller/src/config.rs @@ -38,22 +38,12 @@ pub struct ControllerStackConfig { pub max_rate: f32, } -#[derive(Debug, Deserialize, Clone)] -pub struct SimulationConfig { - pub tickrate: f32, - pub drone_tick_rate: u64, - - /// Controller stack +pub struct ControllerConfig { pub stack: ControllerStackConfig, - /// Maps [Roll, Yaw, Pitch] to each of the 4 motors pub motor_map: [[f32; 3]; 4], - // Motors & Physics pub max_thrust: f32, pub max_torque: f32, - - #[serde(default)] - pub time_constant: f32, pub mass: f32, } diff --git a/src/drone/input.rs b/drone_controller/src/input.rs similarity index 99% rename from src/drone/input.rs rename to drone_controller/src/input.rs index ba67f5b..d0e4ea6 100644 --- a/src/drone/input.rs +++ b/drone_controller/src/input.rs @@ -1,4 +1,3 @@ -#![allow(unused)] use macroquad::prelude as mq; use serde::{Deserialize, Serialize}; use std::fs::File; diff --git a/src/drone/controller.rs b/drone_controller/src/lib.rs similarity index 67% rename from src/drone/controller.rs rename to drone_controller/src/lib.rs index 51619e6..cce19b3 100644 --- a/src/drone/controller.rs +++ b/drone_controller/src/lib.rs @@ -1,8 +1,48 @@ -#![allow(dead_code)] +use nalgebra as na; +use rapier3d::prelude as rp; use std::any::Any; -use crate::drone::JoystickInput; -use crate::drone::MotorCharacteristics; +pub mod config; +pub mod input; +pub mod stacked; + +use config::*; +use stacked::*; + +use input::JoystickInput; + +pub struct MotorCharacteristics { + pub relative_motor_positions: [na::OPoint>; 4], + pub max_thrust: f32, + pub max_torque: f32, + pub time_constant: f32, +} + +impl Default for MotorCharacteristics { + fn default() -> Self { + Self { + /* + * Motor position indices + * ^ - Front + * | + * | + * 1 --- 0 + * | | + * | | + * 2 --- 3 + */ + relative_motor_positions: [ + rp::point![5.0, 5.0, 0.0], + rp::point![5.0, -5.0, 0.0], + rp::point![-5.0, -5.0, 0.0], + rp::point![-5.0, 5.0, 0.0], + ], + max_thrust: 2.6, + max_torque: 0.5, + time_constant: 0.01, + } + } +} impl JoystickInput { pub fn clamp(&self) -> JoystickInput { diff --git a/src/drone/stacked.rs b/drone_controller/src/stacked.rs similarity index 94% rename from src/drone/stacked.rs rename to drone_controller/src/stacked.rs index 8d2f459..91f35ef 100644 --- a/src/drone/stacked.rs +++ b/drone_controller/src/stacked.rs @@ -3,9 +3,9 @@ use nalgebra as na; use std::{any::Any, f32}; -use crate::drone::input::ModeInput; -use crate::drone::stacked::modules::ModuleRuntime; -use crate::drone::{controller::DroneController, input::Input}; +use crate::input::ModeInput; +use crate::stacked::modules::ModuleRuntime; +use crate::{input::Input, DroneController}; use crate::config::*; @@ -27,7 +27,7 @@ pub struct StackedController { pub linaccel_rt: ModuleRuntime, mixer: MotorMixer, - config: SimulationConfig, + config: ControllerConfig, // State drone_state: DroneState, @@ -37,7 +37,7 @@ pub struct StackedController { } impl StackedController { - pub fn new(config: SimulationConfig) -> Self { + pub fn new(config: ControllerConfig) -> Self { let min_throttle = 0.0; let max_throttle = 1.0; @@ -56,15 +56,17 @@ impl StackedController { max_throttle: 1.0, mixing_mode: mixer::MotorMixingMode::default(), }, - config: config.clone(), - input: Input::default(), + drone_state: DroneState { rotation: na::UnitQuaternion::identity(), angular_velocity: na::Vector3::zeros(), mass: config.mass, }, + input: Input::default(), last_time: 0.0, current_time: 0.0, + + config: config, // Keep config copy for future uses } } diff --git a/src/drone/stacked/mixer.rs b/drone_controller/src/stacked/mixer.rs similarity index 100% rename from src/drone/stacked/mixer.rs rename to drone_controller/src/stacked/mixer.rs diff --git a/src/drone/stacked/modules.rs b/drone_controller/src/stacked/modules.rs similarity index 97% rename from src/drone/stacked/modules.rs rename to drone_controller/src/stacked/modules.rs index 3733c8b..0eb2e84 100644 --- a/src/drone/stacked/modules.rs +++ b/drone_controller/src/stacked/modules.rs @@ -1,5 +1,5 @@ -use crate::config::PidConfig; -use crate::drone::stacked::DroneState; +use crate::DroneState; +use crate::PidConfig; use nalgebra as na; pub mod acceleration; diff --git a/drone_controller/src/stacked/modules/acceleration.rs b/drone_controller/src/stacked/modules/acceleration.rs new file mode 100644 index 0000000..411536b --- /dev/null +++ b/drone_controller/src/stacked/modules/acceleration.rs @@ -0,0 +1,49 @@ +use nalgebra::Unit; + +use crate::stacked::modules::*; + +pub struct AccelerationController { + max_throttle: f32, + min_throttle: f32, + throttle_thrust_multiplier: f32, +} + +impl AccelerationController { + pub fn new(max_throttle: f32, min_throttle: f32, throttle_thrust_multiplier: f32) -> Self { + Self { + max_throttle, + min_throttle, + throttle_thrust_multiplier, + } + } +} + +impl ControllerModule for AccelerationController { + type Input = Acceleration; + type Output = (Rotation, Throttle); + + fn process( + &mut self, + input: Acceleration, + state: &DroneState, + _dt: f32, + ) -> (Rotation, Throttle) { + // Thrust is on the Body Up direction + let body_up = na::Vector3::z(); + + let gravity_compensation = na::vector![0.0, 0.0, 9.8]; + // F=ma + let desired_force_vec = (input.0 + gravity_compensation) * state.mass; + + // 3. Find rotation to align Body-Z with Desired-Thrust-Vector + let rotation = + na::UnitQuaternion::rotation_between(&body_up, &desired_force_vec.normalize()) + .unwrap_or(state.rotation); + + let total_max_thrust = self.throttle_thrust_multiplier * 4.0; + let throttle = (desired_force_vec.norm() / total_max_thrust) + .clamp(self.min_throttle, self.max_throttle); + + (Rotation(rotation.scaled_axis()), Throttle(throttle)) + } +} diff --git a/src/drone/stacked/modules/angular_rate.rs b/drone_controller/src/stacked/modules/angular_rate.rs similarity index 93% rename from src/drone/stacked/modules/angular_rate.rs rename to drone_controller/src/stacked/modules/angular_rate.rs index 4bd52b7..5f00f31 100644 --- a/src/drone/stacked/modules/angular_rate.rs +++ b/drone_controller/src/stacked/modules/angular_rate.rs @@ -1,4 +1,4 @@ -use crate::drone::stacked::modules::*; +use crate::stacked::modules::*; pub struct AngularRateController { pid: PidProcessor, diff --git a/src/drone/stacked/modules/rotation.rs b/drone_controller/src/stacked/modules/rotation.rs similarity index 89% rename from src/drone/stacked/modules/rotation.rs rename to drone_controller/src/stacked/modules/rotation.rs index 5c05872..51c99a1 100644 --- a/src/drone/stacked/modules/rotation.rs +++ b/drone_controller/src/stacked/modules/rotation.rs @@ -1,6 +1,6 @@ -use nalgebra::{Quaternion, UnitQuaternion}; +use nalgebra::UnitQuaternion; -use crate::drone::stacked::modules::*; +use crate::stacked::modules::*; pub struct RotationController { pid: PidProcessor, diff --git a/inputs/accel_all.json b/inputs/accel_all.json new file mode 100644 index 0000000..9a0cefc --- /dev/null +++ b/inputs/accel_all.json @@ -0,0 +1,77 @@ +{ + "records": [ + { + "input": { + "joystick": { + "throttle_input": 0, + "roll_input": 0, + "yaw_input": 0, + "pitch_input": 0 + }, + "position": { + "lat": 0, + "long": 0, + "alt": 0 + }, + "rotation": { + "roll": 0, + "yaw": 0, + "pitch": 0 + }, + "acceleration": { + "x": 0.15, + "y": 0.15, + "z": 0 + }, + "mode": "Acceleration" + }, + "time": 0 + }, + { + "input": { + "joystick": { + "throttle_input": 0, + "roll_input": 0, + "yaw_input": 0, + "pitch_input": 0 + }, + "acceleration": { + "x": 0.3, + "y": -0.3, + "z": 0 + }, + "mode": "Acceleration" + }, + "time": 3 + }, + { + "input": { + "joystick": { + "throttle_input": 0, + "roll_input": 0, + "yaw_input": 0, + "pitch_input": 0 + }, + "acceleration": { + "x": 0.4, + "y": 0, + "z": 1 + }, + "mode": "Acceleration" + }, + "time": 10 + }, + { + "input": { + "joystick": { + "throttle_input": 0, + "roll_input": 0, + "yaw_input": 0, + "pitch_input": 0 + }, + "mode": "Acceleration" + }, + "time": 20 + } + ] +} diff --git a/simulation/Cargo.toml b/simulation/Cargo.toml new file mode 100644 index 0000000..59efd6a --- /dev/null +++ b/simulation/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "RustPhysicsMQ" +version = "0.1.0" +edition = "2024" +default-run = "RustPhysicsMQ" + +[dependencies] +drone_controller = { path = "../drone_controller" } +macroquad = "0.4.14" +rapier3d = { version = "0.31", features = ["simd-stable"] } +nalgebra = { version = "0.34", features = ["convert-glam027"] } +glam = "0.27" +rand = "0.9.2" +strum = { version = "0.27", features = ["derive"] } +clearscreen = "4.0.2" +gilrs = "0.11.0" +serde = { version = "1.0.228", features = ["serde_derive"] } +toml = "0.9.8" +csv = "1.4.0" + +serde_with = "3" +serde_json = "1.0.149" + +clap = { version = "4", features = ["derive"] } + + +[[bin]] +name = "record" +path = "src/main_record.rs" + + +[[bin]] +name = "test" +path = "src/main_testing.rs" diff --git a/src/camera.rs b/simulation/src/camera.rs similarity index 100% rename from src/camera.rs rename to simulation/src/camera.rs diff --git a/src/camera/drone_cam.rs b/simulation/src/camera/drone_cam.rs similarity index 100% rename from src/camera/drone_cam.rs rename to simulation/src/camera/drone_cam.rs diff --git a/simulation/src/config.rs b/simulation/src/config.rs new file mode 100644 index 0000000..9f61ae8 --- /dev/null +++ b/simulation/src/config.rs @@ -0,0 +1,38 @@ +use drone_controller::config::ControllerConfig; +use nalgebra::{vector, Vector3}; +use rapier3d::prelude::*; +use serde::Deserialize; + +use crate::controller::config::ControllerStackConfig; + +#[derive(Debug, Deserialize, Clone)] +pub struct SimulationConfig { + pub tickrate: f32, + pub drone_tick_rate: u64, + + /// Controller stack + pub stack: ControllerStackConfig, + + pub motor_map: [[f32; 3]; 4], + + // Motors & Physics + pub max_thrust: f32, + pub max_torque: f32, + + pub mass: f32, + + #[serde(default)] + pub time_constant: f32, +} + +impl SimulationConfig { + pub fn to_controller_config(&self) -> ControllerConfig { + ControllerConfig { + stack: self.stack.clone(), + motor_map: self.motor_map, + max_thrust: self.max_thrust, + max_torque: self.max_torque, + mass: self.mass, + } + } +} diff --git a/simulation/src/controller.rs b/simulation/src/controller.rs new file mode 100644 index 0000000..6834359 --- /dev/null +++ b/simulation/src/controller.rs @@ -0,0 +1 @@ +pub use drone_controller::*; diff --git a/src/drone.rs b/simulation/src/drone.rs similarity index 87% rename from src/drone.rs rename to simulation/src/drone.rs index 885370f..4a666c6 100644 --- a/src/drone.rs +++ b/simulation/src/drone.rs @@ -3,49 +3,12 @@ use rapier3d::prelude as rp; use crate::engine::{ColliderExtraData, World}; -pub mod controller; -pub mod input; -pub mod stacked; -use controller::*; -pub use input::JoystickInput; +use crate::controller::*; const AIR_DENSITY: f32 = 1.23; const DRAG_CONSTANT: f32 = 1.3; const DRAG_MAGIC_NUM: f32 = 0.00; -pub struct MotorCharacteristics { - pub relative_motor_positions: [na::OPoint>; 4], - pub max_thrust: f32, - pub max_torque: f32, - pub time_constant: f32, -} - -impl Default for MotorCharacteristics { - fn default() -> Self { - Self { - /* - * Motor position indices - * ^ - Front - * | - * | - * 1 --- 0 - * | | - * | | - * 2 --- 3 - */ - relative_motor_positions: [ - rp::point![5.0, 5.0, 0.0], - rp::point![5.0, -5.0, 0.0], - rp::point![-5.0, -5.0, 0.0], - rp::point![-5.0, 5.0, 0.0], - ], - max_thrust: 2.6, - max_torque: 0.5, - time_constant: 0.01, - } - } -} - pub struct Drone { pub rb_handle: rp::RigidBodyHandle, motor_characteristics: MotorCharacteristics, diff --git a/src/engine.rs b/simulation/src/engine.rs similarity index 100% rename from src/engine.rs rename to simulation/src/engine.rs diff --git a/src/graphics_util.rs b/simulation/src/graphics_util.rs similarity index 100% rename from src/graphics_util.rs rename to simulation/src/graphics_util.rs diff --git a/src/helpers.rs b/simulation/src/helpers.rs similarity index 100% rename from src/helpers.rs rename to simulation/src/helpers.rs diff --git a/src/logger.rs b/simulation/src/logger.rs similarity index 100% rename from src/logger.rs rename to simulation/src/logger.rs diff --git a/src/main.rs b/simulation/src/main.rs similarity index 90% rename from src/main.rs rename to simulation/src/main.rs index 87a7564..af50254 100644 --- a/src/main.rs +++ b/simulation/src/main.rs @@ -2,6 +2,7 @@ mod engine; use engine::*; mod camera; mod config; +mod controller; mod drone; mod helpers; mod logger; @@ -10,7 +11,7 @@ mod simulation; mod graphics_util; -use crate::drone::input::*; +use crate::controller::input::*; use crate::simulation::{SimMode, Simulation}; use crate::config::SimulationConfig; @@ -76,8 +77,10 @@ fn run(input_path: &PathBuf, config_path: &PathBuf) { let drone = drone::Drone::new( &mut world, - Box::new(drone::stacked::StackedController::new(config.clone())), - drone::MotorCharacteristics { + Box::new(controller::stacked::StackedController::new( + config.to_controller_config(), + )), + controller::MotorCharacteristics { max_thrust: config.max_thrust, max_torque: config.max_torque, time_constant: config.time_constant, @@ -113,8 +116,10 @@ async fn run_record(output: String, config_path: &PathBuf) { let drone = drone::Drone::new( &mut world, - Box::new(drone::stacked::StackedController::new(config.clone())), - drone::MotorCharacteristics { + Box::new(controller::stacked::StackedController::new( + config.to_controller_config(), + )), + controller::MotorCharacteristics { max_thrust: config.max_thrust, max_torque: config.max_torque, time_constant: config.time_constant, diff --git a/src/main_record.rs b/simulation/src/main_record.rs similarity index 91% rename from src/main_record.rs rename to simulation/src/main_record.rs index a38f08f..49033dc 100644 --- a/src/main_record.rs +++ b/simulation/src/main_record.rs @@ -2,6 +2,7 @@ mod engine; use engine::*; mod camera; mod config; +mod controller; mod drone; mod helpers; mod logger; @@ -10,7 +11,7 @@ mod simulation; mod graphics_util; -use crate::drone::input::*; +use crate::controller::input::*; use crate::simulation::{SimMode, Simulation}; use crate::config::SimulationConfig; @@ -73,8 +74,10 @@ async fn run_record(output: String, config_path: &PathBuf) { let drone = drone::Drone::new( &mut world, - Box::new(drone::stacked::StackedController::new(config.clone())), - drone::MotorCharacteristics { + Box::new(controller::stacked::StackedController::new( + config.to_controller_config(), + )), + controller::MotorCharacteristics { max_thrust: config.max_thrust, max_torque: config.max_torque, time_constant: config.time_constant, diff --git a/src/main_testing.rs b/simulation/src/main_testing.rs similarity index 100% rename from src/main_testing.rs rename to simulation/src/main_testing.rs diff --git a/src/rendering.rs b/simulation/src/rendering.rs similarity index 100% rename from src/rendering.rs rename to simulation/src/rendering.rs diff --git a/src/rendering/ui.rs b/simulation/src/rendering/ui.rs similarity index 100% rename from src/rendering/ui.rs rename to simulation/src/rendering/ui.rs diff --git a/src/shaders/depth.frag b/simulation/src/shaders/depth.frag similarity index 100% rename from src/shaders/depth.frag rename to simulation/src/shaders/depth.frag diff --git a/src/shaders/depth.vert b/simulation/src/shaders/depth.vert similarity index 100% rename from src/shaders/depth.vert rename to simulation/src/shaders/depth.vert diff --git a/src/shaders/shader.frag b/simulation/src/shaders/shader.frag similarity index 100% rename from src/shaders/shader.frag rename to simulation/src/shaders/shader.frag diff --git a/src/shaders/shader.vert b/simulation/src/shaders/shader.vert similarity index 100% rename from src/shaders/shader.vert rename to simulation/src/shaders/shader.vert diff --git a/src/simulation.rs b/simulation/src/simulation.rs similarity index 93% rename from src/simulation.rs rename to simulation/src/simulation.rs index 26c6be2..d169978 100644 --- a/src/simulation.rs +++ b/simulation/src/simulation.rs @@ -1,14 +1,11 @@ use macroquad::prelude as mq; -use nalgebra::{self as na, vector}; +use nalgebra::{self as na}; use rapier3d::prelude as rp; use std::error::Error; use crate::{ - drone::{ - controller::DroneController, - input::{Input, InputRecording, ModeInput}, - Drone, - }, + controller::input::{Input, InputRecording, ModeInput}, + drone::Drone, engine::World, logger::{Logger, SimLogRow}, rendering::Renderer, @@ -24,14 +21,6 @@ enum StepOutcome { Exit, } -pub struct DataResultRecord { - pub time: f32, - pub current_angular_velocity: na::Vector3, - pub target_angular_velocity: na::Vector3, - pub applied_motor_offset: na::Vector3, - pub desired_motor_offset: na::Vector3, -} - pub struct Simulation { pub drone: Drone, pub world: World, @@ -151,7 +140,7 @@ impl Simulation { .drone .controller .as_mut_any() - .downcast_mut::() + .downcast_mut::() { cont.set_input(current_input); } @@ -177,7 +166,7 @@ impl Simulation { .drone .controller .as_mut_any() - .downcast_mut::() + .downcast_mut::() { let target_mot = cont.rate_rt.last_output.unwrap_or_default().0;