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

bump to v29.0.0-rc.17 #203

Merged
merged 22 commits into from
Jan 24, 2025
Merged
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
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -51,7 +51,6 @@ jobs:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ubuntu-latest
toolchain: nightly
- run: cargo make doc
- uses: dtolnay/install@cargo-docs-rs
1 change: 0 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ jobs:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ubuntu-latest
components: llvm-tools
- run: cargo install grcov
- run: |
1 change: 0 additions & 1 deletion .github/workflows/miri.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ jobs:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ubuntu-latest
toolchain: ${{ inputs.channel }}
components: miri
- uses: taiki-e/install-action@v2
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@ jobs:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ubuntu-latest
toolchain: nightly
- run: cargo make doc
- uses: dtolnay/install@cargo-docs-rs
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
- `controller::Group::set` and `gain::Group::set` now return `AUTDDriverError::KeyIsAlreadyUsed` if the key is already used
- `controller::Group::send` and `gain::Group::init` now return `AUTDDriverError::UnusedKey` if the key is not used
- Remove `with_xxx` methods to set option value, add option struct instead
- Remove resampler
- Remove `IntoCache`, `IntoFir`, and `IntoRadiationPressure` traits
- Remove `Deref<Target = Link>` and `DerefMut` for `Controller`
- Impl `Deref<Target = Geometry>` and `DerefMut` for `Controller` instead
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ members = [
resolver = "2"

[workspace.package]
version = "29.0.0-rc.16"
version = "29.0.0-rc.17"
authors = ["shun suzuki <suzuki@hapis.k.u-tokyo.ac.jp>"]
edition = "2021"
license = "MIT"
@@ -32,11 +32,11 @@ bitfield-struct = { version = "0.10.0", default-features = false }
bitflags = { version = "2.8.0", default-features = false }
bit-vec = { version = "0.8.0", default-features = false }
bvh = { version = "0.10.0", default-features = false }
cc = { version = "1.2.9", default-features = false }
cc = { version = "1.2.10", default-features = false }
color-print = { version = "0.3.7", default-features = false }
criterion = { version = "0.5.1", default-features = false }
derive-new = { version = "0.7.0", default-features = false }
getset = { version = "0.1.3", default-features = false }
getset = { version = "0.1.4", default-features = false }
glob = { version = "0.3.2", default-features = false }
hound = { version = "3.5.1", default-features = false }
itertools = { version = "0.14.0", default-features = false }
@@ -50,7 +50,7 @@ quote = { version = "1.0.38", default-features = false }
rand = { version = "0.8.5", default-features = false }
rstest = { version = "0.24.0", default-features = false }
serde = { version = "1.0.217", default-features = false }
serde_json = { version = "1.0.135", default-features = false }
serde_json = { version = "1.0.137", default-features = false }
syn = { version = "2.0.96", default-features = false }
tempfile = { version = "3.15.0", default-features = false }
thiserror = { version = "2.0.10", default-features = false }
@@ -70,13 +70,13 @@ csv = { version = "1.3.1", default-features = false }
seq-macro = { version = "0.3.5", default-features = false }
spin_sleep = { version = "1.3.0", default-features = false }
windows = { version = "0.59.0", default-features = false }
autd3 = { path = "./autd3", version = "29.0.0-rc.16", default-features = false }
autd3-core = { path = "./autd3-core", version = "29.0.0-rc.16", default-features = false }
autd3-driver = { path = "./autd3-driver", version = "29.0.0-rc.16", default-features = false }
autd3-derive = { path = "./autd3-derive", version = "29.0.0-rc.16", default-features = false }
autd3-gain-holo = { path = "./autd3-gain-holo", version = "29.0.0-rc.16", default-features = false }
autd3-link-simulator = { path = "./autd3-link-simulator", version = "29.0.0-rc.16", default-features = false }
autd3-link-twincat = { path = "./autd3-link-twincat", version = "29.0.0-rc.16", default-features = false }
autd3-modulation-audio-file = { path = "./autd3-modulation-audio-file", version = "29.0.0-rc.16", default-features = false }
autd3-firmware-emulator = { path = "./autd3-firmware-emulator", version = "29.0.0-rc.16", default-features = false }
autd3-protobuf = { path = "./autd3-protobuf", version = "29.0.0-rc.16", default-features = false }
autd3 = { path = "./autd3", version = "29.0.0-rc.17", default-features = false }
autd3-core = { path = "./autd3-core", version = "29.0.0-rc.17", default-features = false }
autd3-driver = { path = "./autd3-driver", version = "29.0.0-rc.17", default-features = false }
autd3-derive = { path = "./autd3-derive", version = "29.0.0-rc.17", default-features = false }
autd3-gain-holo = { path = "./autd3-gain-holo", version = "29.0.0-rc.17", default-features = false }
autd3-link-simulator = { path = "./autd3-link-simulator", version = "29.0.0-rc.17", default-features = false }
autd3-link-twincat = { path = "./autd3-link-twincat", version = "29.0.0-rc.17", default-features = false }
autd3-modulation-audio-file = { path = "./autd3-modulation-audio-file", version = "29.0.0-rc.17", default-features = false }
autd3-firmware-emulator = { path = "./autd3-firmware-emulator", version = "29.0.0-rc.17", default-features = false }
autd3-protobuf = { path = "./autd3-protobuf", version = "29.0.0-rc.17", default-features = false }
1 change: 0 additions & 1 deletion autd3-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -48,7 +48,6 @@ geometry = ["nalgebra", "bvh", "paste", "getset", "defined", "derive-new", "deri
left_handed = []
link = ["zerocopy", "getset", "ethercat", "datagram", "geometry", "derive_more", "derive_more/display"]
modulation = ["getset", "utils", "defined", "datagram", "derive_more", "derive_more/display"]
resampler = ["modulation", "defined", "tracing", "utils"]
use_meter = []
utils = ["windows"]

1 change: 1 addition & 0 deletions autd3-core/src/acoustics/directivity/sphere.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::*;

/// Sphere directivity model.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct Sphere {}

impl Directivity for Sphere {
1 change: 1 addition & 0 deletions autd3-core/src/acoustics/directivity/t4010a1.rs
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ static DIR_COEF_D: &[f32] = &[
];

/// [T4010A1/B4](https://www.nicera.co.jp/en/products/ultrasonic-sensor/open-aperture-type) directivity model.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct T4010A1 {}

impl Directivity for T4010A1 {
14 changes: 7 additions & 7 deletions autd3-core/src/datagram/mod.rs
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ pub trait DatagramL: std::fmt::Debug {
fn operation_generator_with_loop_behavior(
self,
geometry: &Geometry,
option: &DatagramOption,
parallel: bool,
segment: Segment,
transition_mode: Option<TransitionMode>,
loop_behavior: LoopBehavior,
@@ -66,7 +66,7 @@ pub trait DatagramS: std::fmt::Debug {
fn operation_generator_with_segment(
self,
geometry: &Geometry,
option: &DatagramOption,
parallel: bool,
segment: Segment,
transition_mode: Option<TransitionMode>,
) -> Result<Self::G, Self::Error>;
@@ -82,13 +82,13 @@ impl<D: DatagramL> DatagramS for D {
fn operation_generator_with_segment(
self,
geometry: &Geometry,
option: &DatagramOption,
parallel: bool,
segment: Segment,
transition_mode: Option<TransitionMode>,
) -> Result<Self::G, Self::Error> {
self.operation_generator_with_loop_behavior(
geometry,
option,
parallel,
segment,
transition_mode,
LoopBehavior::Infinite,
@@ -111,7 +111,7 @@ pub trait Datagram: std::fmt::Debug {
fn operation_generator(
self,
geometry: &Geometry,
option: &DatagramOption,
parallel: bool,
) -> Result<Self::G, Self::Error>;

/// Returns the option of the datagram.
@@ -127,11 +127,11 @@ impl<D: DatagramS> Datagram for D {
fn operation_generator(
self,
geometry: &Geometry,
option: &DatagramOption,
parallel: bool,
) -> Result<Self::G, Self::Error> {
self.operation_generator_with_segment(
geometry,
option,
parallel,
Segment::S0,
Some(TransitionMode::Immediate),
)
17 changes: 5 additions & 12 deletions autd3-core/src/datagram/tuple.rs
Original file line number Diff line number Diff line change
@@ -31,11 +31,11 @@ where
fn operation_generator(
self,
geometry: &Geometry,
option: &DatagramOption,
parallel: bool,
) -> Result<Self::G, Self::Error> {
match (
self.0.operation_generator(geometry, option),
self.1.operation_generator(geometry, option),
self.0.operation_generator(geometry, parallel),
self.1.operation_generator(geometry, parallel),
) {
(Ok(g1), Ok(g2)) => Ok(CombinedOperationGenerator { o1: g1, o2: g2 }),
(Err(e1), _) => Err(Self::Error::E1(e1)),
@@ -71,11 +71,7 @@ mod tests {
type G = ();
type Error = ();

fn operation_generator(
self,
_: &Geometry,
_: &DatagramOption,
) -> Result<Self::G, Self::Error> {
fn operation_generator(self, _: &Geometry, _: bool) -> Result<Self::G, Self::Error> {
self.result
}

@@ -106,10 +102,7 @@ mod tests {
result: result2,
}
)
.operation_generator(
&Geometry::new(Default::default()),
&DatagramOption::default()
)
.operation_generator(&Geometry::new(Default::default()), false)
);
}

28 changes: 10 additions & 18 deletions autd3-core/src/defined/angle.rs
Original file line number Diff line number Diff line change
@@ -9,47 +9,40 @@ pub struct rad;
use derive_more::Debug;

/// Angle
#[repr(C)]
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum Angle {
#[doc(hidden)]
#[debug("{}°", _0)]
Deg(f32),
#[doc(hidden)]
#[debug("{}rad", _0)]
Rad(f32),
#[debug("{}rad", radian)]
pub struct Angle {
radian: f32,
}

impl Angle {
/// Returns the angle in radian
pub fn radian(self) -> f32 {
match self {
Self::Deg(a) => a.to_radians(),
Self::Rad(a) => a,
}
self.radian
}

/// Returns the angle in degree
pub fn degree(self) -> f32 {
match self {
Self::Deg(a) => a,
Self::Rad(a) => a.to_degrees(),
}
self.radian.to_degrees()
}
}

impl std::ops::Mul<deg> for f32 {
type Output = Angle;

fn mul(self, _rhs: deg) -> Self::Output {
Self::Output::Deg(self)
Self::Output {
radian: self.to_radians(),
}
}
}

impl std::ops::Mul<rad> for f32 {
type Output = Angle;

fn mul(self, _rhs: rad) -> Self::Output {
Self::Output::Rad(self)
Self::Output { radian: self }
}
}

@@ -59,7 +52,6 @@ mod tests {

#[test]
fn dbg() {
assert_eq!(format!("{:?}", 90.0 * deg), "90°");
assert_eq!(format!("{:?}", 1.0 * rad), "1rad");
}
}
6 changes: 0 additions & 6 deletions autd3-core/src/gain/emit_intensity.rs
Original file line number Diff line number Diff line change
@@ -14,12 +14,6 @@ impl EmitIntensity {
pub const MIN: EmitIntensity = EmitIntensity(0x00);
}

impl From<u8> for EmitIntensity {
fn from(v: u8) -> Self {
Self(v)
}
}

impl std::ops::Div<u8> for EmitIntensity {
type Output = Self;

9 changes: 4 additions & 5 deletions autd3-core/src/gain/mod.rs
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ pub use phase::Phase;

use crate::{
datagram::{Segment, TransitionMode},
derive::DatagramOption,
geometry::{Device, Geometry, Transducer},
};

@@ -60,9 +59,9 @@ pub trait Gain: std::fmt::Debug + Sized {
/// If `filter` is `None`, all transducers are enabled.
fn init_full(
self,
_geometry: &Geometry,
_: &Geometry,
_filter: Option<&HashMap<usize, BitVec>>,
_option: &DatagramOption,
_parallel: bool,
) -> Result<Self::G, GainError> {
self.init()
}
@@ -81,10 +80,10 @@ impl<G: GainContextGenerator> GainOperationGenerator<G> {
geometry: &Geometry,
segment: Segment,
transition: Option<TransitionMode>,
option: &DatagramOption,
parallel: bool,
) -> Result<Self, GainError> {
Ok(Self {
generator: gain.init_full(geometry, None, option)?,
generator: gain.init_full(geometry, None, parallel)?,
segment,
transition,
})
4 changes: 0 additions & 4 deletions autd3-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -37,10 +37,6 @@ pub mod link;
#[cfg(feature = "modulation")]
/// Core traits for Modulation.
pub mod modulation;
#[cfg_attr(docsrs, doc(cfg(feature = "resampler")))]
#[cfg(feature = "resampler")]
/// Resampler module.
pub mod resampler;
#[cfg_attr(docsrs, doc(cfg(feature = "utils")))]
#[cfg(feature = "utils")]
#[doc(hidden)]
15 changes: 2 additions & 13 deletions autd3-core/src/link/async.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
datagram::DatagramOption,
geometry::Geometry,
link::{LinkError, RxMessage, TxMessage},
};
@@ -18,7 +17,7 @@ mod internal {
async fn close(&mut self) -> Result<(), LinkError>;

#[doc(hidden)]
async fn update(&mut self, _geometry: &Geometry) -> Result<(), LinkError> {
async fn update(&mut self, _: &Geometry) -> Result<(), LinkError> {
Ok(())
}

@@ -31,9 +30,6 @@ mod internal {
/// Checks if the link is open.
#[must_use]
fn is_open(&self) -> bool;

#[doc(hidden)]
fn trace(&mut self, _: &DatagramOption) {}
}

/// A trait to build a link.
@@ -67,10 +63,6 @@ mod internal {
fn is_open(&self) -> bool {
self.as_ref().is_open()
}

fn trace(&mut self, option: &DatagramOption) {
self.as_mut().trace(option)
}
}
}

@@ -86,7 +78,7 @@ mod internal {
#[doc(hidden)]
fn update(
&mut self,
_geometry: &Geometry,
_: &Geometry,
) -> impl std::future::Future<Output = Result<(), LinkError>> {
async { Ok(()) }
}
@@ -106,9 +98,6 @@ mod internal {
/// Checks if the link is open.
#[must_use]
fn is_open(&self) -> bool;

#[doc(hidden)]
fn trace(&mut self, _: &DatagramOption) {}
}

/// A trait to build a link.
Loading