System for safe navigation of a stage and retractable devices inside a chamber of a scanning electron microscope.
This project was created as a part of a bachelor's thesis at the Faculty of Informatics, Masaryk University Brno.
The safety system itself is written in Rust.
Bindings for the safe-stage
Rust library. Currently, safe bindings only for C#, but unsafe header files are also generated for C and C++.
Desktop service application written in C#, WPF. Connects to safe-stage
using the safe bindings.
Only Windows and .NET runtime are needed to run a compiled binary of the service application.
- installed Rust with version 1.86 or newer
- As of 18/12/2024, the Nightly version of the Rust toolchain results in a slightly better performance and is therefore recommended
- installed .NET SDK 8 or newer
- installed
cargo-expand
or selected nightly chain (runcargo install cargo-expand
to install) - required for generating bindings- Nightly toolchain can be used as a fallback (running without
cargo-expand
), but might be unstable
- Nightly toolchain can be used as a fallback (running without
- (optionally) setup
miri
with nightly toolchain to test undefined behavior - (optionally) setup
nextest
to run unit tests with reports
1.86.0
- floats inconst
context, trait upcasting coercion
- Enter the
safe-stage
directory - Compile the library with ffi feature and in release mode with
cargo build --release --features ffi
- Generate unsafe bindings with
cargo run -p bindings
- Go back to main directory and enter the
service-app
directory - Usedotnet run --project ServiceApp
to directly run it - Usedotnet publish
to create release build
When lost, try looking at the CI/CD pipeline and how it is done there.
Exported STL files can be found here: safe-stage/models/src/assembly/thesis/models
Or can be viewed online in Onshape: https://cad.onshape.com/documents/694e38e8d979f14ad35f8ff9/w/1727b025a7bb93644c4c09d6/e/62cb081996d848e3b3a7ae06