From 4f55f5ba0faef12df3f2d7e0400c5504fa40eb09 Mon Sep 17 00:00:00 2001 From: Ryan Rodriguez Date: Sat, 16 Nov 2024 00:33:46 -0800 Subject: [PATCH] cleanup thrust and torque logging --- Cargo.toml | 2 ++ config/liftoff_quad.yaml | 1 + src/lib.rs | 13 +------------ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e00f8ad3..ed2cd474 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,3 +42,5 @@ tokio = { version = "1.41.0", features = ["full"] } binrw = "0.14.1" cyber_rc = { git = "https://github.com/friend0/CyberRC.git" } serialport = "4.6.0" +tempfile = "3.14.0" +prost = "0.13.3" diff --git a/config/liftoff_quad.yaml b/config/liftoff_quad.yaml index a81bbca4..9ad1bba0 100644 --- a/config/liftoff_quad.yaml +++ b/config/liftoff_quad.yaml @@ -23,6 +23,7 @@ quadrotor: max_thrust_kg: .5 arm_length_m: .065 yaw_torque_constant: .0052 + serial_port: null pid_controller: pos_gains: # PID gains for position control diff --git a/src/lib.rs b/src/lib.rs index 41580631..d4549df6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -722,6 +722,7 @@ impl PIDController { let gravity_compensation = Vector3::new(0.0, 0.0, self.gravity); let total_acceleration = acceleration + gravity_compensation; let total_acc_norm = total_acceleration.norm(); + // TODO thrust limits let thrust = self.mass * total_acc_norm; let desired_orientation = if total_acc_norm > 1e-6 { let z_body = total_acceleration / total_acc_norm; @@ -2451,18 +2452,6 @@ pub fn log_data( .with_radii([0.1]) .with_colors([rerun::Color::from_rgb(255, 255, 255)]), )?; - rec.log( - "world/quad/desired_torque", - &rerun::Points3D::new([(torque.x, torque.y, torque.z)]) - .with_radii([0.1]) - .with_colors([rerun::Color::from_rgb(255, 255, 255)]), - )?; - rec.log( - "world/quad/thrust", - &rerun::Points3D::new([(torque.x, torque.y, torque.z)]) - .with_radii([0.2]) - .with_colors([rerun::Color::from_rgb(255, 255, 255)]), - )?; rec.log( "world/quad/base_link", &rerun::Transform3D::from_translation_rotation(