Skip to content

Commit

Permalink
Improve error message for integrator smaller step size.
Browse files Browse the repository at this point in the history
I've found that even a little nudge to say "your system is probably
unstable" and "no, the discrete-time multibodyplant is not (directly)
to blame, look at the continuous-state parts of your system" can help
them understand/resolve.

Related to RobotLocomotion#18452.
  • Loading branch information
RussTedrake committed May 24, 2023
1 parent d9c740f commit 5b70c6f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions systems/analysis/integrator_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,13 @@ class IntegratorBase {
"size of {}; working minimum is ", new_step_size,
get_working_minimum_step_size());
std::ostringstream str;
str << "Error control wants to select step smaller than minimum" <<
" allowed (" << get_working_minimum_step_size() << ")";
// TODO(russt): Link to the "debugging dynamical systems" tutorial
// (#17249) once it exists.
str << "Error control wants to select step smaller than minimum"
<< " allowed (" << get_working_minimum_step_size()
<< "). This is typically an indication that some part of your system "
"*with continuous state* is going unstable and/or is producing "
"excessively large derivatives.";
throw std::runtime_error(str.str());
}
}
Expand Down

0 comments on commit 5b70c6f

Please sign in to comment.