Skip to content

Commit 97ab026

Browse files
Merge pull request #247 from thowell/estimator_memory
Only allocate estimator memory when estimator_enabled=true
2 parents 64afbaa + 5b63551 commit 97ab026

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mjpc/agent.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void Agent::Initialize(const mjModel* model) {
105105
state.Initialize(model);
106106

107107
// initialize estimator
108-
if (reset_estimator) {
108+
if (reset_estimator && estimator_enabled) {
109109
for (const auto& estimator : estimators_) {
110110
estimator->Initialize(model_);
111111
estimator->Reset();
@@ -169,7 +169,7 @@ void Agent::Reset(const double* initial_repeated_action) {
169169
state.Reset();
170170

171171
// estimator
172-
if (reset_estimator) {
172+
if (reset_estimator && estimator_enabled) {
173173
for (const auto& estimator : estimators_) {
174174
estimator->Reset();
175175
}

mjpc/estimators/batch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
namespace mjpc {
3333

3434
// max filter history
35-
inline constexpr int kMaxFilterHistory = 128;
35+
inline constexpr int kMaxFilterHistory = 64;
3636

3737
// ----- batch estimator ----- //
3838
// based on: "Physically-Consistent Sensor Fusion in Contact-Rich Behaviors"

0 commit comments

Comments
 (0)