Skip to content

Commit bf1da24

Browse files
committed
fix bug in aitsmc
1 parent 7e2f9d9 commit bf1da24

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

velocity_controllers/src/adaptive_integral_terminal_sliding_mode_controller.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ auto AdaptiveIntegralTerminalSlidingModeController::update_reference_from_subscr
219219
auto * current_reference = reference_.readFromNonRT();
220220
const std::vector<double> reference = common::messages::to_vector(*current_reference);
221221
for (auto && [interface, ref] : std::views::zip(reference_interfaces_, reference)) {
222-
interface = ref;
222+
if (!std::isnan(ref)) {
223+
interface = ref;
224+
}
223225
}
224226
common::messages::reset_message(current_reference);
225227
return controller_interface::return_type::OK;

velocity_controllers/src/integral_sliding_mode_controller.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ auto IntegralSlidingModeController::update_reference_from_subscribers(
207207
auto * current_reference = reference_.readFromNonRT();
208208
const std::vector<double> reference = common::messages::to_vector(*current_reference);
209209
for (auto && [interface, ref] : std::views::zip(reference_interfaces_, reference)) {
210-
interface = ref;
210+
if (!std::isnan(ref)) {
211+
interface = ref;
212+
}
211213
}
212214
common::messages::reset_message(current_reference);
213215
return controller_interface::return_type::OK;

0 commit comments

Comments
 (0)