Skip to content
This is the development version of the documentation. It may change before the next release. See 0.6.x for the latest release.

SetPhaseCorrection

SetPhaseCorrection is a command that sets the phase offset added to each transducer. The offset set here is added to all subsequent output phases.

SetPhaseCorrection { phases: &phases };
Field Type Description
phases &[Vec<Phase>] Phase offset table per device.
use autd3_rs::commands::SetPhaseCorrection;
use autd3_rs::geometry::{Autd3, Geometry};
use autd3_rs::value::Phase;
use autd3_rs::{Client, ClientConfig};
use autd3_rs_link_nop::Nop;
let geometry = Geometry::new(vec![Autd3::default()]);
let client = Client::open(&geometry, Nop, ClientConfig::default()).await?;
let phases: Vec<Vec<Phase>> = geometry
.iter()
.map(|dev| vec![Phase::ZERO; dev.num_transducers()])
.collect();
let mut builder = client.datagram_builder();
builder.push(SetPhaseCorrection { phases: &phases });
let frames = builder.build()?;
for frame in &frames {
client.send_checked(frame).await?;
}
client.close().await?;