Configuration helpers to control Simulator and IntegratorBase settings.
◆ ApplySimulatorConfig()
Modifies the simulator
based on the given config
.
(Always replaces the Integrator with a new one; be careful not to keep old references around.)
- Parameters
-
[in] | config | Configuration to be used. Contains values for both the integrator and the simulator. |
[in,out] | simulator | On input, a valid pointer to a Simulator. On output the integrator for simulator is reset according to the given config . |
- Template Parameters
-
◆ CreateIntegratorFromConfig()
Create an integrator according to the given configuration.
- Parameters
-
system | A pointer to the System to be integrated; the integrator will maintain a reference to the system in perpetuity, so the integrator must not outlive the system. |
integrator_config | Configuration to be used. Only values relevant to the integrator (integration_scheme, max_step_size, use_error_control, accuracy) are applied. |
- Precondition
system != nullptr
.
- Exceptions
-
std::exception | if the integration scheme does not match any of GetIntegrationSchemes(), or if the integration scheme does not support the scalar type T. |
- Template Parameters
-
◆ ExtractSimulatorConfig()
Reports the simulator's current configuration, including the configuration of the integrator.
- Parameters
-
[in] | simulator | The Simulator to extract the configuration from. |
- Template Parameters
-
- Note
- For non-double T (T=AutoDiffXd), doing ExtractSimulatorConfig will discard the integrator's scalar type's extra information such as gradients.
◆ GetIntegrationSchemes()
const std::vector<std::string>& drake::systems::GetIntegrationSchemes |
( |
| ) |
|
◆ IsScalarTypeSupportedByIntegrator()
bool drake::systems::IsScalarTypeSupportedByIntegrator |
( |
std::string_view |
integration_scheme | ) |
|
Reports if an integration scheme supports the scalar type T.
- Parameters
-
integration_scheme | Integration scheme to be checked. |
- Exceptions
-
- Template Parameters
-
◆ ResetIntegratorFromFlags()
IntegratorBase<T>& drake::systems::ResetIntegratorFromFlags |
( |
Simulator< T > * |
simulator, |
|
|
const std::string & |
scheme, |
|
|
const T & |
max_step_size |
|
) |
| |
Resets the integrator used to advanced the continuous time dynamics of the system associated with simulator
according to the given arguments.
- Parameters
-
- Returns
- A reference to the newly created integrator owned by
simulator
.
- Template Parameters
-