Skip to content

Commit

Permalink
Improve the robustness of the dyno accel test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpieper committed Apr 7, 2022
1 parent 74b80a9 commit 4fe70ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/dynamometer_drive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2128,8 +2128,8 @@ class Application {
fmt::format("d pos 3.0 -0.5 {} v0.5 a0.2", options_.max_torque_Nm));

double old_vel = 0.0;
const double step_s = 0.2;
const int loops = 14 / 0.2;
const double step_s = 0.25;
const int loops = 14 / step_s;
double done_time = 0.0;

for (int i = 0; i < loops; i++) {
Expand Down Expand Up @@ -2163,9 +2163,9 @@ class Application {
fixture_velocity));
}
const double measured_accel = (fixture_velocity - old_vel) / step_s;
if (std::abs(measured_accel) > 1.7) {
if (std::abs(measured_accel) > 1.8) {
throw mjlib::base::system_error::einval(
fmt::format("Measured acceleration exceed limit |{}| > 1.7",
fmt::format("Measured acceleration exceeds limit |{}| > 1.8",
measured_accel));
}
}
Expand Down

0 comments on commit 4fe70ec

Please sign in to comment.