Skip to content

Commit 5887a46

Browse files
committed
fix: removed buoy code, cuda kernels, and depracated vision code
1 parent adb263e commit 5887a46

23 files changed

Lines changed: 130 additions & 2167 deletions

File tree

src/comms/auv_control_board/response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ where
105105
}
106106
*/
107107

108-
#[cfg(all(feature = "logging", not(feature = "unblocked_logging")))]
108+
#[cfg(all(feature = "logging"))]
109109
{
110110
write_log(&[buffer.clone()], dump_file).await;
111111
}

src/config/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub mod octagon;
55
pub mod path_align;
66
pub mod slalom;
77
pub mod sonar;
8+
pub mod spin;
89

910
use std::fs::read_to_string;
1011

@@ -78,6 +79,7 @@ pub struct Missions {
7879
pub bin: bin::Config,
7980
pub octagon: octagon::Config,
8081
pub coinflip: coinflip::Config,
82+
pub spin: spin::Config,
8183
}
8284

8385
#[derive(Debug, Serialize, Deserialize)]

src/config/spin.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
use serde::{Deserialize, Serialize};
2+
3+
#[derive(Debug, Serialize, Deserialize)]
4+
pub struct Config {
5+
pub depth: f32,
6+
pub spin_speed: f32,
7+
pub num_spins: i32,
8+
pub hysteresis: f32,
9+
}
10+
11+
impl Default for Config {
12+
fn default() -> Self {
13+
Self {
14+
depth: -1.25,
15+
spin_speed: 1.0,
16+
num_spins: 2,
17+
hysteresis: 10.0,
18+
}
19+
}
20+
}

src/cuda_kernels/process_net.cu

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/missions/action_context.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ use opencv::core::Mat;
33
#[cfg(feature = "annotated_streams")]
44
use opencv::mod_prelude::ToInputArray;
55
use tokio::io::{AsyncWriteExt, WriteHalf};
6-
use tokio::sync::RwLock;
76
use tokio_serial::SerialStream;
87

8+
use crate::comms::{control_board::ControlBoard, meb::MainElectronicsBoard};
99
use crate::video_source::appsink::Camera;
1010
use crate::video_source::MatSource;
11-
use crate::{
12-
comms::{control_board::ControlBoard, meb::MainElectronicsBoard},
13-
vision::buoy::Target,
14-
};
1511
/**
1612
* Inherit this trait if you have a control board
1713
*/
@@ -34,8 +30,6 @@ pub trait FrontCamIO {
3430
fn get_front_camera_mat(&self) -> impl std::future::Future<Output = Mat> + Send;
3531
#[cfg(feature = "annotated_streams")]
3632
async fn annotate_front_camera(&self, image: &impl ToInputArray);
37-
async fn get_desired_buoy_gate(&self) -> Target;
38-
async fn set_desired_buoy_gate(&mut self, value: Target) -> &Self;
3933
}
4034

4135
/**
@@ -60,7 +54,6 @@ pub struct FullActionContext<'a, T: AsyncWriteExt + Unpin + Send> {
6054
main_electronics_board: &'a MainElectronicsBoard<WriteHalf<SerialStream>>,
6155
front_cam: &'a Camera,
6256
bottom_cam: &'a Camera,
63-
desired_buoy_target: &'a RwLock<Target>,
6457
}
6558

6659
impl<'a, T: AsyncWriteExt + Unpin + Send> FullActionContext<'a, T> {
@@ -69,14 +62,12 @@ impl<'a, T: AsyncWriteExt + Unpin + Send> FullActionContext<'a, T> {
6962
main_electronics_board: &'a MainElectronicsBoard<WriteHalf<SerialStream>>,
7063
front_cam: &'a Camera,
7164
bottom_cam: &'a Camera,
72-
desired_buoy_target: &'a RwLock<Target>,
7365
) -> Self {
7466
Self {
7567
control_board,
7668
main_electronics_board,
7769
front_cam,
7870
bottom_cam,
79-
desired_buoy_target,
8071
}
8172
}
8273
}
@@ -101,14 +92,6 @@ impl<T: AsyncWriteExt + Unpin + Send> FrontCamIO for FullActionContext<'_, T> {
10192
async fn annotate_front_camera(&self, image: &impl ToInputArray) {
10293
self.front_cam.push_annotated_frame(image);
10394
}
104-
async fn get_desired_buoy_gate(&self) -> Target {
105-
let res = self.desired_buoy_target.read().await;
106-
(*res).clone()
107-
}
108-
async fn set_desired_buoy_gate(&mut self, value: Target) -> &Self {
109-
*self.desired_buoy_target.write().await = value;
110-
self
111-
}
11295
}
11396

11497
impl<T: AsyncWriteExt + Unpin + Send> BottomCamIO for FullActionContext<'_, T> {
@@ -141,12 +124,6 @@ impl FrontCamIO for EmptyActionContext {
141124
async fn annotate_front_camera(&self, _image: &impl ToInputArray) {
142125
todo!();
143126
}
144-
async fn get_desired_buoy_gate(&self) -> Target {
145-
todo!()
146-
}
147-
async fn set_desired_buoy_gate(&mut self, _value: Target) -> &Self {
148-
todo!()
149-
}
150127
}
151128

152129
impl BottomCamIO for EmptyActionContext {

0 commit comments

Comments
 (0)