Files
linux_sentry_chassis/Cargo.toml
T

123 lines
4.2 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[workspace]
resolver = "3"
members = [
"crates/contract/can",
"crates/contract/imu",
"crates/protocol/motor",
"crates/protocol/imu",
"crates/transport/can",
"crates/transport/serial",
"crates/device/imu",
"crates/device/motor",
"crates/device/esc",
"crates/control/algorithm",
"crates/control/motor",
"crates/control/chassis",
"crates/protocol/remote",
"crates/device/remote",
"crates/model/motor",
"crates/experiment/trace",
"crates/simulation/motor",
"crates/tooling/tuning",
"crates/config/chassis",
"crates/application/bench",
"crates/application/daemon",
"crates/application/tools",
"crates/application/tuning",
"crates/verification/integration",
]
[workspace.package]
version = "0.1.0"
edition = "2024"
rust-version = "1.89"
license = "MIT"
# 部署二进制去符号表(armv7 3.2MB → ~1MB)
[profile.release]
strip = true
[workspace.dependencies]
# 异步运行时
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time", "signal"] }
# CAN 总线(仅 Linux,由 socketcan 按 target 引入)
socketcan-rs = { package = "socketcan", version = "4", features = ["tokio"] }
# SLCAN 串口适配器(CANable 等,用户态 Lawicel 协议)
slcan-proto = { package = "slcan", version = "0.1.3" }
serial = "0.4"
# 错误定义与结构化日志
thiserror = "2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# 配置与命令行
serde = { version = "1", features = ["derive"] }
toml = "0.9"
clap = { version = "4", features = ["derive"] }
# 测试
proptest = "1"
approx = "0.5"
# 自动整定工具
#
# `rand` 对齐 argmin 依赖的 0.9,避免依赖树里出现两个 rand 大版本;
# `argmin-math` 必须显式开启 `vec`(argmin 自身只启 `primitives`),
# 否则 `Vec<f64>` 参数向量没有 ArgminAdd/Sub/Mul 实现。
argmin = { version = "0.11", default-features = false, features = ["rand"] }
argmin-math = { version = "0.5", features = ["vec"] }
rand = "0.9"
rayon = "1"
csv = "1.4"
serde_json = "1"
indicatif = "0.18"
anyhow = "1"
# 仅在 chassis-tune 的 `plot` feature 下引入:只要 SVG 后端与折线系列,
# 但文字标签需要 `ttf`(字体加载),因此不能用纯 svg_backend 最小集。
plotters = { version = "0.3", default-features = false, features = ["svg_backend", "line_series", "ttf"] }
# ---- 职责型内部 crate ----
can = { path = "crates/contract/can" }
imu = { path = "crates/contract/imu" }
motor-protocol = { path = "crates/protocol/motor" }
delta10-protocol = { path = "crates/protocol/imu" }
socketcan = { path = "crates/transport/can" }
slcan = { path = "crates/transport/serial" }
delta10 = { path = "crates/device/imu" }
motor = { path = "crates/device/motor" }
esc-bus = { path = "crates/device/esc" }
pid = { path = "crates/control/algorithm" }
motor-control = { path = "crates/control/motor" }
mecanum = { path = "crates/control/chassis" }
dr16-protocol = { path = "crates/protocol/remote" }
dr16 = { path = "crates/device/remote" }
motor-model = { path = "crates/model/motor" }
experiment = { path = "crates/experiment/trace" }
sim-harness = { path = "crates/simulation/motor" }
tuning = { path = "crates/tooling/tuning" }
chassis-config = { path = "crates/config/chassis" }
bench = { path = "crates/application/bench" }
chassisd = { path = "crates/application/daemon" }
spin = { path = "crates/application/tools" }
chassis-tune = { path = "crates/application/tuning" }
integration-tests = { path = "crates/verification/integration" }
[workspace.lints.rust]
unsafe_code = "forbid"
[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }
unwrap_used = "deny"
expect_used = "deny"
dbg_macro = "deny"
# 协议编解码与嵌入式数值转换中大量的 as 转换靠测试保证正确性
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
# 字节 ↔ 有符号整数的补码重解释是协议解码的本意
cast_possible_wrap = "allow"
# 中文文档中的品牌 / 型号词(RoboMaster、GM3508 等)不需要反引号
doc_markdown = "allow"
# 以下 pedantic 项对内部库收益低
module_name_repetitions = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
must_use_candidate = "allow"