-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
simulator_gflags.h
51 lines (41 loc) · 1.83 KB
/
simulator_gflags.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
/// @file
/// This file defines gflags settings to control Simulator settings.
/// Only include this from translation units that declare a `main` function.
#include <memory>
#include <gflags/gflags.h>
#include "drake/systems/analysis/integrator_base.h"
#include "drake/systems/analysis/simulator.h"
// Declares integrator gflags.
DECLARE_string(simulator_integration_scheme);
DECLARE_double(simulator_max_time_step);
DECLARE_double(simulator_accuracy);
DECLARE_bool(simulator_use_error_control);
// Declares simulator gflags.
DECLARE_double(simulator_target_realtime_rate);
DECLARE_bool(simulator_publish_every_time_step);
namespace drake {
namespace systems {
/// Resets the integrator used to advanced the continuous time dynamics of the
/// system associated with `simulator` according to the gflags declared in this
/// file.
/// @param[in,out] simulator
/// On input, a valid pointer to a Simulator. On output the
/// integrator for `simulator` is reset according to the gflags declared in
/// this file.
/// @returns A reference to the the newly created integrator owned by
/// `simulator`.
IntegratorBase<double>& ResetIntegratorFromGflags(Simulator<double>* simulator);
/// Makes a new simulator according to the gflags declared in this file.
/// @param[in] system
/// The System to be associated with the newly crated Simulator. You must
/// ensure that `system` has a longer lifetime than the new Simulator.
/// @param[in] context
/// The Context that will be used as the initial condition for the simulation;
/// otherwise the Simulator will obtain a default Context from `system`.
/// @returns The newly created Simulator.
std::unique_ptr<Simulator<double>> MakeSimulatorFromGflags(
const System<double>& system,
std::unique_ptr<Context<double>> context = nullptr);
} // namespace systems
} // namespace drake