Skip to content

Commit a5edc43

Browse files
xuanhien070594Meow404
authored andcommitted
fix: error that the function isnan is undefined when compiling on linux
1 parent 6d35319 commit a5edc43

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

systems/controllers/osc/operational_space_control.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "systems/controllers/osc/operational_space_control.h"
22

3+
#include <cmath>
34
#include <iostream>
45

56
#include <drake/multibody/plant/multibody_plant.h>
@@ -474,7 +475,7 @@ void OperationalSpaceControl::Build() {
474475
.get();
475476
}
476477
// 3. external force cost
477-
for (auto& force_tracking_data : *force_tracking_data_vec_) {
478+
for ([[maybe_unused]] auto& force_tracking_data : *force_tracking_data_vec_) {
478479
lambda_ext_cost_ =
479480
prog_
480481
->AddQuadraticCost(MatrixXd::Zero(n_lambda_ext_, n_lambda_ext_),
@@ -1220,7 +1221,8 @@ void OperationalSpaceControl::CheckTracking(
12201221
if (soft_constraint_cost_ != nullptr) {
12211222
soft_constraint_cost_->Eval(*epsilon_sol_, &y_soft_constraint_cost);
12221223
}
1223-
if (y_soft_constraint_cost[0] > 1e5 || isnan(y_soft_constraint_cost[0])) {
1224+
if (y_soft_constraint_cost[0] > 1e5 ||
1225+
std::isnan(y_soft_constraint_cost[0])) {
12241226
output->get_mutable_value()(0) = 1.0;
12251227
}
12261228
}

0 commit comments

Comments
 (0)