-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rm num-integer * add `autd3-core` crate * update autd3-core * update autd3-link-twincat * update autd3-core * update autd3-driver * update autd3-derive * update autd3-firmware-emulator * update autd3-gain-holo * update autd3-link-simulator * update autd3-protobuf * update autd3-modulation-audio-file * update autd3 * update examples * update github workflows * update deps * excl infallible error test from cov * update doc * update autd3-core doc * fix autd3-gain-holo deps
- Loading branch information
Showing
252 changed files
with
2,298 additions
and
1,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[package] | ||
name = "autd3-core" | ||
description = "AUTD3 core traits and types" | ||
readme = "README.md" | ||
keywords = { workspace = true } | ||
version = { workspace = true } | ||
authors = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
repository = { workspace = true } | ||
|
||
[dependencies] | ||
async-trait = { workspace = true, default-features = false, optional = true } | ||
autd3-derive = { workspace = true, default-features = false, optional = true } | ||
bit-vec = { workspace = true, default-features = false, optional = true } | ||
bvh = { workspace = true, default-features = false, optional = true } | ||
derive_more = { workspace = true, default-features = false, optional = true } | ||
derive-new = { workspace = true, default-features = false, optional = true } | ||
nalgebra = { workspace = true, default-features = false, optional = true } | ||
paste = { workspace = true, default-features = false, optional = true } | ||
time = { workspace = true, default-features = false, features = ["macros", "std"], optional = true } | ||
thiserror = { workspace = true, default-features = false, optional = true } | ||
tracing = { workspace = true, default-features = false, optional = true } | ||
zerocopy = { workspace = true, default-features = false, features = ["derive"], optional = true } | ||
|
||
[dev-dependencies] | ||
anyhow = { workspace = true } | ||
approx = { workspace = true } | ||
itertools = { workspace = true } | ||
rand = { workspace = true } | ||
rstest = { workspace = true } | ||
|
||
[features] | ||
acoustics = ["defined", "geometry"] | ||
async = [] | ||
async-trait = ["async", "dep:async-trait"] | ||
datagram = ["defined", "geometry", "ethercat"] | ||
defined = ["derive_more", "derive_more/add", "derive_more/mul", "derive_more/debug"] | ||
derive = ["datagram", "autd3-derive", "tracing"] | ||
dynamic_freq = [] | ||
ethercat = ["time", "thiserror"] | ||
gain = ["defined", "datagram", "geometry", "thiserror", "bit-vec", "zerocopy", "derive_more", "derive_more/display"] | ||
geometry = [ | ||
"nalgebra", | ||
"bvh", | ||
"paste", | ||
"autd3-derive", | ||
"defined", | ||
"derive-new", | ||
"derive_more", | ||
"derive_more/add", | ||
"derive_more/mul", | ||
"derive_more/into_iterator", | ||
"derive_more/deref", | ||
"derive_more/debug", | ||
] | ||
left_handed = [] | ||
link = ["zerocopy", "autd3-derive", "ethercat", "geometry", "derive_more", "derive_more/display"] | ||
modulation = ["autd3-derive", "utils", "defined", "datagram", "derive_more", "derive_more/display"] | ||
resampler = ["modulation", "defined", "tracing", "utils"] | ||
use_meter = [] | ||
utils = [] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# autd3-core | ||
|
||
AUTD3 core traits and types. | ||
|
||
# Author | ||
|
||
Shun Suzuki, 2025 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions
6
autd3-driver/src/acoustics/mod.rs → autd3-core/src/acoustics/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
mod gpio; | ||
mod operation; | ||
mod segment; | ||
mod transition_mode; | ||
mod tuple; | ||
|
||
pub use gpio::{GPIOIn, GPIOOut}; | ||
pub use operation::{NullOp, Operation}; | ||
pub use segment::Segment; | ||
pub use transition_mode::{TransitionMode, TRANSITION_MODE_NONE}; | ||
pub use tuple::{CombinedError, CombinedOperationGenerator}; | ||
|
||
use std::time::Duration; | ||
|
||
use crate::{defined::DEFAULT_TIMEOUT, geometry::Geometry}; | ||
|
||
/// [`Datagram`] represents the data sent to the device. | ||
pub trait Datagram: std::fmt::Debug { | ||
#[doc(hidden)] | ||
type G; | ||
#[doc(hidden)] | ||
type Error: std::error::Error; | ||
|
||
#[doc(hidden)] | ||
fn operation_generator(self, geometry: &Geometry) -> Result<Self::G, Self::Error>; | ||
|
||
/// Returns the timeout duration. | ||
fn timeout(&self) -> Option<Duration> { | ||
Some(DEFAULT_TIMEOUT) | ||
} | ||
|
||
/// Returns the parallel threshold. | ||
fn parallel_threshold(&self) -> Option<usize> { | ||
Some(usize::MAX) | ||
} | ||
} | ||
|
||
/// [`DatagramS`] represents a [`Datagram`] that can specify [`Segment`] to write the data. | ||
pub trait DatagramS: std::fmt::Debug { | ||
#[doc(hidden)] | ||
type G; | ||
#[doc(hidden)] | ||
type Error: std::error::Error; | ||
|
||
#[doc(hidden)] | ||
fn operation_generator_with_segment( | ||
self, | ||
geometry: &Geometry, | ||
segment: Segment, | ||
transition_mode: Option<TransitionMode>, | ||
) -> Result<Self::G, Self::Error>; | ||
|
||
/// Returns the timeout duration. | ||
fn timeout(&self) -> Option<Duration> { | ||
Some(DEFAULT_TIMEOUT) | ||
} | ||
|
||
/// Returns the parallel threshold. | ||
fn parallel_threshold(&self) -> Option<usize> { | ||
Some(usize::MAX) | ||
} | ||
} | ||
|
||
impl<D: DatagramS> Datagram for D { | ||
type G = D::G; | ||
type Error = D::Error; | ||
|
||
fn operation_generator(self, geometry: &Geometry) -> Result<Self::G, D::Error> { | ||
self.operation_generator_with_segment( | ||
geometry, | ||
Segment::S0, | ||
Some(TransitionMode::Immediate), | ||
) | ||
} | ||
|
||
fn timeout(&self) -> Option<Duration> { | ||
<Self as DatagramS>::timeout(self) | ||
} | ||
|
||
fn parallel_threshold(&self) -> Option<usize> { | ||
<Self as DatagramS>::parallel_threshold(self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use crate::geometry::Device; | ||
|
||
#[doc(hidden)] | ||
pub trait Operation: Send + Sync { | ||
type Error: std::error::Error; | ||
|
||
fn required_size(&self, device: &Device) -> usize; | ||
fn pack(&mut self, device: &Device, tx: &mut [u8]) -> Result<usize, Self::Error>; | ||
fn is_done(&self) -> bool; | ||
} | ||
|
||
#[doc(hidden)] | ||
pub struct NullOp; | ||
|
||
impl Operation for NullOp { | ||
type Error = std::convert::Infallible; | ||
|
||
fn required_size(&self, _: &Device) -> usize { | ||
0 | ||
} | ||
|
||
fn pack(&mut self, _: &Device, _: &mut [u8]) -> Result<usize, Self::Error> { | ||
unreachable!() | ||
} | ||
|
||
fn is_done(&self) -> bool { | ||
true | ||
} | ||
} | ||
|
||
impl Default for Box<dyn Operation<Error = std::convert::Infallible>> { | ||
fn default() -> Self { | ||
Box::new(NullOp) | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.