Skip to content

Commit

Permalink
set velocities to zero in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iris2 committed Feb 12, 2024
1 parent 3967a78 commit 0fdf88b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ controller_interface::return_type CartesianAdmittanceController::update(
joint_command_
);
if (ret_admittance != controller_interface::return_type::OK) {
std::fill(
joint_command_.accelerations.begin(), joint_command_.accelerations.end(), 0.0);
std::fill(
joint_command_.velocities.begin(), joint_command_.velocities.end(), 0.0);
write_state_to_hardware(joint_command_);
return controller_interface::return_type::ERROR;
}
}
Expand Down

0 comments on commit 0fdf88b

Please sign in to comment.