diff --git a/daemon/src/main.rs b/daemon/src/main.rs index b34bb22..94877a0 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -211,7 +211,7 @@ async fn main() -> Result<()> { let timestamp = Local::now().format("%Y%m%d_%H%M%S"); let temp_name = format!("kos-daemon_{}.log", timestamp); - let final_name = format!("kos-daemon_{}.log.gz", timestamp); + let final_name = format!("{}.gz", temp_name); let log_path = log_dir.join(&final_name); info!("Writing compressed logs to: {}", log_path.display()); @@ -240,7 +240,7 @@ async fn main() -> Result<()> { }; // Setup signal handler - let (shutdown_tx, mut shutdown_rx) = tokio::sync::oneshot::channel(); + let (shutdown_tx, shutdown_rx) = tokio::sync::oneshot::channel(); tokio::spawn(async move { if let Ok(()) = signal::ctrl_c().await { diff --git a/kos_core/src/lib.rs b/kos_core/src/lib.rs index a5ac1ee..3b36bb2 100644 --- a/kos_core/src/lib.rs +++ b/kos_core/src/lib.rs @@ -12,7 +12,6 @@ pub use grpc_interface::google as google_proto; pub use grpc_interface::kos as kos_proto; use async_trait::async_trait; -use eyre::Result; use hal::actuator_service_server::ActuatorServiceServer; use hal::imu_service_server::ImuServiceServer; use hal::process_manager_service_server::ProcessManagerServiceServer; diff --git a/kos_core/src/services/krec_logger.rs b/kos_core/src/services/krec_logger.rs index a4347e5..46dfc70 100644 --- a/kos_core/src/services/krec_logger.rs +++ b/kos_core/src/services/krec_logger.rs @@ -1,7 +1,4 @@ -use crate::kos_proto::{ - actuator::ActuatorStateResponse, - imu::{ImuValuesResponse, QuaternionResponse}, -}; +use crate::kos_proto::imu::{ImuValuesResponse, QuaternionResponse}; use eyre::Result; use krec::{ ActuatorCommand, ActuatorState, ImuQuaternion, ImuValues, KRec, KRecFrame, KRecHeader, Vec3, @@ -178,7 +175,7 @@ impl TelemetryLogger { tracing::error!("Failed to decode QuaternionResponse {:?}", payload); } } else if topic.contains("/actuator/state") { - match serde_json::from_slice::(&payload) { + match serde_json::from_slice::(payload) { Ok(state_list) => { for state in state_list.data { frame.actuator_states.push(ActuatorState { @@ -198,7 +195,7 @@ impl TelemetryLogger { } } } else if topic.contains("/actuator/command") { - match serde_json::from_slice::(&payload) { + match serde_json::from_slice::(payload) { Ok(command_data) => { frame.inference_step = command_data.inference_step; frame.video_timestamp = command_data.video_timestamp; diff --git a/platforms/stub/src/lib.rs b/platforms/stub/src/lib.rs index 3220fac..371f0b7 100644 --- a/platforms/stub/src/lib.rs +++ b/platforms/stub/src/lib.rs @@ -6,14 +6,7 @@ pub use imu::*; pub use process_manager::*; use async_trait::async_trait; -use eyre::Result; use kos_core::hal::Operation; -use kos_core::kos_proto::{ - actuator::actuator_service_server::ActuatorServiceServer, - imu::imu_service_server::ImuServiceServer, - process_manager::process_manager_service_server::ProcessManagerServiceServer, -}; -use kos_core::services::{ActuatorServiceImpl, IMUServiceImpl, ProcessManagerServiceImpl}; use kos_core::{services::OperationsServiceImpl, Platform, ServiceEnum}; use std::future::Future; use std::pin::Pin; diff --git a/platforms/stub/src/process_manager.rs b/platforms/stub/src/process_manager.rs index 5354966..13959cc 100644 --- a/platforms/stub/src/process_manager.rs +++ b/platforms/stub/src/process_manager.rs @@ -9,6 +9,12 @@ pub struct StubProcessManager { kclip_uuid: Mutex>, } +impl Default for StubProcessManager { + fn default() -> Self { + Self::new() + } +} + impl StubProcessManager { pub fn new() -> Self { StubProcessManager {