Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
79fc2f4
Initial commit
Sean-Leishman Oct 15, 2024
8299f39
Fixup types in use of entry preprocess function
Sean-Leishman Oct 15, 2024
213fce5
Update preprocessor main entry functions
Sean-Leishman Oct 23, 2024
d5be831
Clone getQuartiles implementation
Sean-Leishman Oct 23, 2024
e53f612
Ensure all reliable accelerometers are kept in range
Sean-Leishman Oct 24, 2024
a09ae8f
Add additional tests for quartile calculation
Sean-Leishman Oct 28, 2024
9fee8f8
Add handle_outlier tests
Sean-Leishman Oct 31, 2024
36b2976
Use localisation/src/types.rs for constants
Sean-Leishman Nov 1, 2024
62a36b9
Run clippy
Sean-Leishman Nov 1, 2024
d1177d0
Clean-up linter errors
Sean-Leishman Nov 1, 2024
b753953
Fix testing linter warnings
Sean-Leishman Nov 1, 2024
aa4b41c
QoL changes
Sean-Leishman Nov 11, 2024
58bcf9e
Remove extra impl
Sean-Leishman Nov 11, 2024
3cf7fd3
Default impl for clippy
Sean-Leishman Nov 11, 2024
34c7207
Merge remote-tracking branch 'origin/main' into hype-43-loc-accelerom…
Sean-Leishman Nov 11, 2024
6e6a502
initial commit
misha7b Nov 11, 2024
3a9585e
getters & setters
misha7b Nov 11, 2024
b352a14
new name!
misha7b Nov 11, 2024
847c2d9
Add comments and tests
Sean-Leishman Nov 14, 2024
5bc0704
clippy
misha7b Nov 16, 2024
894169c
small fixes to types
misha7b Nov 16, 2024
0ad0161
fmt!
misha7b Nov 16, 2024
98624df
Merge branch 'main' into hype-43-loc-accelerometer-preprocessor
misha7b Nov 16, 2024
266877a
Merge branch 'main' into transfer_navigator
misha7b Nov 16, 2024
c6ad181
Merge branch 'hype-43-loc-accelerometer-preprocessor' into transfer_n…
misha7b Nov 16, 2024
429ec17
small bug fixex
misha7b Nov 16, 2024
70bf0a9
Merge branch 'main' into transfer_navigator
misha7b Nov 16, 2024
61e6cfb
deleted redundant file
misha7b Nov 16, 2024
222c2a1
smallfix
misha7b Nov 16, 2024
24a43c2
initialised kalman filter
misha7b Nov 16, 2024
2392c54
structure changes
misha7b Nov 16, 2024
9199d1f
File name changes
misha7b Nov 16, 2024
8a97f96
working
misha7b Nov 16, 2024
666ca56
spelling
misha7b Nov 16, 2024
c635a37
preprocessor
misha7b Nov 16, 2024
cecf033
format|
misha7b Nov 16, 2024
eeda22a
Fixed preprocess_keyence: changed input vector from bool to int
misha7b Nov 18, 2024
d815e2a
small fixes
misha7b Nov 18, 2024
34105ec
Finished... I think?
misha7b Nov 21, 2024
55c0c26
CLIPPYgit add .! and also half-assed acceleration calculation:
misha7b Nov 21, 2024
39fc6a5
this commit will fail
misha7b Nov 21, 2024
545b4dc
i command you to build
misha7b Nov 21, 2024
6f8d85e
CLIPPY!
misha7b Nov 21, 2024
eaa32c3
simple silly test
misha7b Nov 21, 2024
7bfab5d
removed comment
misha7b Jan 13, 2025
73227cf
fmt
misha7b Jan 13, 2025
3aa1a45
comment
misha7b Jan 13, 2025
6427166
Merge branch 'main' into transfer_navigator
misha7b Jan 13, 2025
f38152e
comment
misha7b Jan 13, 2025
2eb9bd7
Changed from 2 to 1 Optical Flow Sensor
misha7b Jan 20, 2025
dee30e1
small name change
misha7b Jan 27, 2025
20da9e3
Merge remote-tracking branch 'origin/main' into transfer_navigator
misha7b Jan 27, 2025
5adbe56
optical flow scales with num of sensors
misha7b Feb 9, 2025
dc072ad
Merge remote-tracking branch 'refs/remotes/origin/main' into transfer…
misha7b Feb 9, 2025
7796505
small fix
misha7b Feb 9, 2025
50133f1
something abour passing on errors
misha7b Feb 9, 2025
6c17de8
minor test fixes
misha7b Feb 9, 2025
604a43e
RUST FORMAT
misha7b Feb 9, 2025
1057441
test commit
misha7b Feb 9, 2025
f08d8a7
todo:read the sensors
misha7b Feb 9, 2025
4ac1d79
now reading stripe counter
misha7b Feb 9, 2025
7fe19d4
fixex?
misha7b Feb 9, 2025
3309d7c
fixed some more errors
misha7b Feb 9, 2025
0117d02
PLEASE WORK I BEG YOU
misha7b Feb 9, 2025
63482d7
fixed nostd errors
misha7b Feb 9, 2025
719e0be
fmt....
misha7b Feb 9, 2025
ecf9526
WORKWORKWORK
misha7b Feb 9, 2025
ea6d098
changed path
misha7b Feb 9, 2025
fa74759
small fixes to imports and such
misha7b Feb 9, 2025
490337e
fixed some issues checking
misha7b Feb 9, 2025
693adb0
added getters
misha7b Feb 9, 2025
8b3ac47
PLEASE WORK PLEASE: added demfr lib
misha7b Feb 9, 2025
f687d3e
wrong version of defmt
misha7b Feb 9, 2025
59d3957
fmt
misha7b Feb 9, 2025
0a67808
addded second stripe counter
misha7b Feb 9, 2025
4dd888a
Merge remote-tracking branch 'refs/remotes/origin/main' into localize…
misha7b Feb 9, 2025
4ef8799
small fix, only continues when both keyence recieved
misha7b Feb 13, 2025
b397c84
small fix
misha7b Feb 13, 2025
4151184
fmt
misha7b Feb 13, 2025
51e1ea2
changed to 2 pins
misha7b Feb 13, 2025
f404986
pin change
misha7b Feb 13, 2025
2b4c57f
Merge remote-tracking branch 'refs/remotes/origin/main' into localize…
misha7b Feb 13, 2025
05a9d60
Merge remote-tracking branch 'refs/remotes/origin/main' into localize…
misha7b Feb 24, 2025
136281b
what?
misha7b Feb 24, 2025
1ed26b1
unsure
misha7b Feb 24, 2025
8d6791c
libm functions
misha7b Feb 24, 2025
0d53f17
libm fixes
misha7b Feb 24, 2025
d9bb13e
fixed libm and sort in accelerometre
misha7b Feb 24, 2025
bfcfc7d
PLEAE
misha7b Feb 24, 2025
a9aee1f
heapless fix
misha7b Feb 24, 2025
820ae49
fixed sort
misha7b Feb 24, 2025
d3b6c67
shoddy temprary sorting fix
misha7b Feb 24, 2025
404a800
fmt
misha7b Feb 24, 2025
1431e2c
fmt
misha7b Feb 24, 2025
c4f8ba9
fmt
misha7b Mar 6, 2025
fb4bd93
fmt and heapless fix
misha7b Mar 6, 2025
1250a31
Merge remote-tracking branch 'refs/remotes/origin/main' into localize…
misha7b Mar 6, 2025
6673a15
board fmt
misha7b Mar 6, 2025
7e10dbb
clippy will dislike this
misha7b Mar 6, 2025
d185e8d
fixed sorting issue!
misha7b Mar 6, 2025
ee48f4c
reverse.
misha7b Mar 6, 2025
5c96dec
removed getters
misha7b Mar 10, 2025
9e26cca
added optical flow sensor
misha7b Mar 10, 2025
e87d26d
Merge remote-tracking branch 'refs/remotes/origin/main' into localize…
misha7b Mar 20, 2025
303216f
test
misha7b Mar 20, 2025
bed00d6
brackets removed, code improved
misha7b Mar 20, 2025
291cad6
forgot to make acceleration public lol
misha7b Mar 20, 2025
835c482
hmm fail?
misha7b Mar 20, 2025
e7ae587
test.
misha7b Mar 24, 2025
b6b1c11
Merge branch 'main' into localizer_board_code
davidbeechey Jun 21, 2025
ce9532c
start working on finishing localisation
davidbeechey Jun 21, 2025
2fba78b
in theory localisation including accelerometers
davidbeechey Jun 21, 2025
7adf896
fix test
davidbeechey Jun 21, 2025
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
88 changes: 88 additions & 0 deletions boards/stm32f767zi/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 43 additions & 9 deletions boards/stm32f767zi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,45 @@ version = "0.1.0"
edition = "2021"

[dependencies]
embassy-stm32 = { version = "0.1.0", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] , git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-sync = { version = "0.6", features = ["defmt"], git = "https://github.com/embassy-rs/embassy", rev = "92326f10b5be1d6fdc6bd414eb0656e3890bd825"}
embassy-executor = { version = "0.6.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-time = { version = "0.3.1", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-net = { version = "0.4.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-futures = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-stm32 = { version = "0.1.0", features = [
"defmt",
"stm32f767zi",
"memory-x",
"unstable-pac",
"time-driver-any",
"exti",
], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7" }
embassy-sync = { version = "0.6", features = [
"defmt",
], git = "https://github.com/embassy-rs/embassy", rev = "92326f10b5be1d6fdc6bd414eb0656e3890bd825" }
embassy-executor = { version = "0.6.0", features = [
"task-arena-size-32768",
"arch-cortex-m",
"executor-thread",
"defmt",
"integrated-timers",
], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7" }
embassy-time = { version = "0.3.1", features = [
"defmt",
"defmt-timestamp-uptime",
"tick-hz-32_768",
], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7" }
embassy-net = { version = "0.4.0", features = [
"defmt",
"tcp",
"dhcpv4",
"medium-ethernet",
], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7" }
embassy-futures = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7" }

defmt = "0.3"
defmt-rtt = "0.4"
heapless = "0.8.0"

cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
cortex-m = { version = "0.7.6", features = [
"inline-asm",
"critical-section-single-core",
] }
cortex-m-rt = "0.7.0"
embedded-hal = "0.2.6"
panic-probe = { version = "0.3", features = ["print-defmt"] }
Expand All @@ -23,14 +51,16 @@ critical-section = "1.1"
embedded-storage = "0.3.1"
static_cell = "2"

heapless = { version = "0.8", default-features = false, features = ["serde"]}
rust-mqtt = { version = "0.3.0", default-features = false, features = ["defmt"] }
rust-mqtt = { version = "0.3.0", default-features = false, features = [
"defmt",
] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde-json-core = "0.1.0"
typenum = "1.17.0"

hyped_core = { path = "../../lib/core" }
hyped_sensors = { path = "../../lib/sensors" }
hyped_localisation = { path = "../../lib/localisation" }
hyped_state_machine = { path = "../../lib/state_machine" }
hyped_communications = { path = "../../lib/communications" }

Expand All @@ -49,6 +79,10 @@ hyped_spi_derive = { path = "../../lib/io/hyped_spi/hyped_spi_derive" }
name = "telemetry"
path = "src/bin/boards/telemetry.rs"

[[bin]]
name = "localisation"
path = "src/bin/boards/localisation.rs"

[[bin]]
name = "i2cdetect"
path = "src/bin/tools/i2cdetect.rs"
55 changes: 16 additions & 39 deletions boards/stm32f767zi/src/bin/accelerometer_mux_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ use embassy_sync::{
},
watch::Watch,
};
use hyped_boards_stm32f767zi::tasks::sensors::read_accelerometers_from_mux::{
read_accelerometers_from_mux, AccelerometerMuxReadings,
use hyped_boards_stm32f767zi::tasks::sensors::read_accelerometers_from_mux::read_accelerometers_from_mux;
use hyped_localisation::{
config::{NUM_ACCELEROMETERS, NUM_AXIS},
types::RawAccelerometerData,
};
use hyped_sensors::SensorValueRange::*;
use panic_probe as _;
use static_cell::StaticCell;

type I2c1Bus = Mutex<NoopRawMutex, RefCell<I2c<'static, Blocking>>>;

static ACCELERATION_MUX_READINGS: Watch<CriticalSectionRawMutex, AccelerometerMuxReadings, 1> =
Watch::new();
static ACCELERATION_MUX_READINGS: Watch<
CriticalSectionRawMutex,
RawAccelerometerData<NUM_ACCELEROMETERS, NUM_AXIS>,
1,
> = Watch::new();

#[embassy_executor::main]
async fn main(spawner: Spawner) -> ! {
Expand All @@ -49,40 +53,13 @@ async fn main(spawner: Spawner) -> ! {
loop {
let readings = accelerometer_mux_reading_receiver.changed().await;
for (i, reading) in readings.iter().enumerate() {
match reading {
Some(reading) => match reading {
Safe(accelerometer_values) => {
defmt::info!(
"Accelerometer {} reading: x={:?}mg, y={:?}mg, z={:?}mg (safe)",
i,
accelerometer_values.x,
accelerometer_values.y,
accelerometer_values.z
);
}
Warning(accelerometer_values) => {
defmt::info!(
"Accelerometer {} reading: x={:?}mg, y={:?}mg, z={:?}mg (unsafe)",
i,
accelerometer_values.x,
accelerometer_values.y,
accelerometer_values.z
);
}
Critical(accelerometer_values) => {
defmt::info!(
"Accelerometer {} reading: x={:?}mg, y={:?}mg, z={:?}mg (critical)",
i,
accelerometer_values.x,
accelerometer_values.y,
accelerometer_values.z
);
}
},
None => {
defmt::info!("Accelerometer {} reading: None", i);
}
}
defmt::info!(
"Accelerometer {} reading: x: {}, y: {}, z: {}",
i + 1,
reading[0],
reading[1],
reading[2]
);
}
}
}
45 changes: 10 additions & 35 deletions boards/stm32f767zi/src/bin/accelerometer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,15 @@ use embassy_sync::{
},
watch::Watch,
};
use heapless::Vec;
use hyped_boards_stm32f767zi::tasks::sensors::read_accelerometer::read_accelerometer;
use hyped_sensors::{
accelerometer::AccelerationValues,
SensorValueRange::{self, *},
};
use panic_probe as _;
use static_cell::StaticCell;

type I2c1Bus = Mutex<NoopRawMutex, RefCell<I2c<'static, Blocking>>>;

/// Used to keep the latest acceleration values.
static ACCELEROMETER_READING: Watch<
CriticalSectionRawMutex,
Option<SensorValueRange<AccelerationValues>>,
1,
> = Watch::new();
static ACCELEROMETER_READING: Watch<CriticalSectionRawMutex, Option<Vec<f32, 3>>, 1> = Watch::new();

#[embassy_executor::main]
async fn main(spawner: Spawner) -> ! {
Expand All @@ -49,32 +42,14 @@ async fn main(spawner: Spawner) -> ! {
loop {
let reading = accelerometer_reading_receiver.changed().await;
match reading {
Some(accelerometer_values) => match accelerometer_values {
Safe(accelerometer_values) => {
defmt::info!(
"Acceleration: x={:?}mg, y={:?}mg, z={:?}mg (safe)",
accelerometer_values.x,
accelerometer_values.y,
accelerometer_values.z
);
}
Warning(accelerometer_values) => {
defmt::info!(
"Acceleration: x={:?}mg, y={:?}mg, z={:?}mg (unsafe)",
accelerometer_values.x,
accelerometer_values.y,
accelerometer_values.z
);
}
Critical(accelerometer_values) => {
defmt::info!(
"Acceleration: x={:?}mg, y={:?}mg, z={:?}mg (critical)",
accelerometer_values.x,
accelerometer_values.y,
accelerometer_values.z
);
}
},
Some(accelerometer_values) => {
defmt::info!(
"Accelerometer reading: x: {}, y: {}, z: {}",
accelerometer_values[0],
accelerometer_values[1],
accelerometer_values[2]
)
}
None => {
defmt::info!("Failed to read acceleration values.")
}
Expand Down
Loading