Skip to content

Commit

Permalink
Remove option to optionally compute extra terms.
Browse files Browse the repository at this point in the history
  • Loading branch information
duburcqa committed Jan 2, 2024
1 parent 0bb9e9b commit 7907959
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
TORCH_VERSION: "2.0.1"
CMAKE_C_COMPILER: "/usr/bin/clang"
CMAKE_CXX_COMPILER: "/usr/bin/clang++"
CMAKE_CXX_FLAGS: |
"-DEIGEN_MPL2_ONLY -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -Wno-deprecated-declarations"
CMAKE_CXX_FLAGS: "-DEIGEN_MPL2_ONLY -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -Wno-deprecated-declarations"
OSX_DEPLOYMENT_TARGET: "11.0"
OSX_ARCHITECTURES: "x86_64;arm64"
WHEEL_ARCH: "universal2"
Expand Down
1 change: 0 additions & 1 deletion core/examples/double_pendulum/double_pendulum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ int main(int /* argc */, char * /* argv */[])
boost::get<double>(stepperOptions.at("sensorsUpdatePeriod")) = 1.0e-3;
boost::get<double>(stepperOptions.at("controllerUpdatePeriod")) = 1.0e-3;
boost::get<bool>(stepperOptions.at("logInternalStepperSteps")) = false;
boost::get<bool>(stepperOptions.at("computeExtraTerms")) = true;
boost::get<uint32_t>(stepperOptions.at("randomSeed")) = 0U; // `time(nullptr)` for random seed
GenericConfig & contactsOptions = boost::get<GenericConfig>(simuOptions.at("contacts"));
boost::get<std::string>(contactsOptions.at("model")) = std::string("spring_damper");
Expand Down
5 changes: 1 addition & 4 deletions core/include/jiminy/core/engine/engine_multi_robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ namespace jiminy
config["sensorsUpdatePeriod"] = 0.0;
config["controllerUpdatePeriod"] = 0.0;
config["logInternalStepperSteps"] = false;
config["computeExtraTerms"] = true;

return config;
};
Expand Down Expand Up @@ -261,7 +260,6 @@ namespace jiminy
const double sensorsUpdatePeriod;
const double controllerUpdatePeriod;
const bool logInternalStepperSteps;
const bool computeExtraTerms;

stepperOptions_t(const GenericConfig & options) :
verbose{boost::get<bool>(options.at("verbose"))},
Expand All @@ -276,8 +274,7 @@ namespace jiminy
timeout{boost::get<double>(options.at("timeout"))},
sensorsUpdatePeriod{boost::get<double>(options.at("sensorsUpdatePeriod"))},
controllerUpdatePeriod{boost::get<double>(options.at("controllerUpdatePeriod"))},
logInternalStepperSteps{boost::get<bool>(options.at("logInternalStepperSteps"))},
computeExtraTerms{boost::get<bool>(options.at("computeExtraTerms"))}
logInternalStepperSteps{boost::get<bool>(options.at("logInternalStepperSteps"))}
{
}
};
Expand Down
15 changes: 3 additions & 12 deletions core/src/engine/engine_multi_robot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1632,10 +1632,7 @@ namespace jiminy
}

// Compute all external terms including joints accelerations and forces if requested
if (engineOptions_->stepper.computeExtraTerms)
{
computeAllExtraTerms(systems_, systemsDataHolder_, fPrev_);
}
computeAllExtraTerms(systems_, systemsDataHolder_, fPrev_);

// Backend the updated joint accelerations and forces
syncAllAccelerationsAndForces(systems_, contactForcesPrev_, fPrev_, aPrev_);
Expand Down Expand Up @@ -2272,10 +2269,7 @@ namespace jiminy
/* Compute all external terms including joints accelerations and forces.
Note that it is possible to call this method because `pinocchio::Data`
is guaranteed to be up-to-date at this point. */
if (engineOptions_->stepper.computeExtraTerms)
{
computeAllExtraTerms(systems_, systemsDataHolder_, fPrev_);
}
computeAllExtraTerms(systems_, systemsDataHolder_, fPrev_);

// Backend the updated joint accelerations and forces
syncAllAccelerationsAndForces(
Expand Down Expand Up @@ -2399,10 +2393,7 @@ namespace jiminy
syncSystemsStateWithStepper();

// Compute all external terms including joints accelerations and forces
if (engineOptions_->stepper.computeExtraTerms)
{
computeAllExtraTerms(systems_, systemsDataHolder_, fPrev_);
}
computeAllExtraTerms(systems_, systemsDataHolder_, fPrev_);

// Backend the updated joint accelerations and forces
syncAllAccelerationsAndForces(
Expand Down
1 change: 0 additions & 1 deletion data/bipedal_robots/atlas/atlas_v4_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ odeSolver = "euler_explicit"
sensorsUpdatePeriod = 0.005
controllerUpdatePeriod = 0.005
logInternalStepperSteps = false
computeExtraTerms = true
randomSeed = 0

# ============== Contact dynamics ===============
Expand Down
1 change: 0 additions & 1 deletion data/bipedal_robots/cassie/cassie_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ odeSolver = "euler_explicit"
sensorsUpdatePeriod = 0.005
controllerUpdatePeriod = 0.005
logInternalStepperSteps = false
computeExtraTerms = true
randomSeed = 0

# ============== Contact dynamics ===============
Expand Down
1 change: 0 additions & 1 deletion data/bipedal_robots/digit/digit_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ odeSolver = "euler_explicit"
sensorsUpdatePeriod = 0.005
controllerUpdatePeriod = 0.005
logInternalStepperSteps = false
computeExtraTerms = true
randomSeed = 0

# ============== Ground dynamics ===============
Expand Down
1 change: 0 additions & 1 deletion data/quadrupedal_robots/anymal/anymal_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ odeSolver = "euler_explicit"
sensorsUpdatePeriod = 0.005
controllerUpdatePeriod = 0.005
logInternalStepperSteps = false
computeExtraTerms = true
randomSeed = 0

# ============== Ground dynamics ===============
Expand Down
1 change: 0 additions & 1 deletion data/toys_models/ant/ant_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ odeSolver = "runge_kutta_4"
sensorsUpdatePeriod = 0.01
controllerUpdatePeriod = 0.01
logInternalStepperSteps = false
computeExtraTerms = true
randomSeed = 0

# ============== Contact dynamics ===============
Expand Down
1 change: 0 additions & 1 deletion python/jiminy_py/examples/double_pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def internalDynamics(t, q, v, sensors_data, u_custom):
engine_options["stepper"]["sensorsUpdatePeriod"] = 1.0e-3
engine_options["stepper"]["controllerUpdatePeriod"] = 1.0e-3
engine_options["stepper"]["logInternalStepperSteps"] = False
engine_options["stepper"]["computeExtraTerms"] = False
engine_options["stepper"]["randomSeed"] = 0
engine_options['contacts']['model'] = "spring_damper"
engine_options['contacts']['stiffness'] = 1.0e6
Expand Down

0 comments on commit 7907959

Please sign in to comment.