Skip to content

Commit

Permalink
only allocate estimator memory when estimator_enabled=true
Browse files Browse the repository at this point in the history
  • Loading branch information
thowell committed Jan 15, 2024
1 parent 64afbaa commit 5b63551
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mjpc/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Agent::Initialize(const mjModel* model) {
state.Initialize(model);

// initialize estimator
if (reset_estimator) {
if (reset_estimator && estimator_enabled) {
for (const auto& estimator : estimators_) {
estimator->Initialize(model_);
estimator->Reset();
Expand Down Expand Up @@ -169,7 +169,7 @@ void Agent::Reset(const double* initial_repeated_action) {
state.Reset();

// estimator
if (reset_estimator) {
if (reset_estimator && estimator_enabled) {
for (const auto& estimator : estimators_) {
estimator->Reset();
}
Expand Down
2 changes: 1 addition & 1 deletion mjpc/estimators/batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace mjpc {

// max filter history
inline constexpr int kMaxFilterHistory = 128;
inline constexpr int kMaxFilterHistory = 64;

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

0 comments on commit 5b63551

Please sign in to comment.