Skip to content

Commit

Permalink
cleanup thrust and torque logging
Browse files Browse the repository at this point in the history
  • Loading branch information
friend0 committed Nov 16, 2024
1 parent 70b19da commit 4f55f5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions config/liftoff_quad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4f55f5b

Please sign in to comment.