@@ -65,7 +65,8 @@ namespace legged_robot {
65
65
/* *****************************************************************************************************/
66
66
/* *****************************************************************************************************/
67
67
LeggedRobotInterface::LeggedRobotInterface (const std::string& taskFile, const std::string& urdfFile, const std::string& referenceFile,
68
- bool useHardFrictionConeConstraint) {
68
+ bool useHardFrictionConeConstraint)
69
+ : useHardFrictionConeConstraint_(useHardFrictionConeConstraint) {
69
70
// check that task file exists
70
71
boost::filesystem::path taskFilePath (taskFile);
71
72
if (boost::filesystem::exists (taskFilePath)) {
@@ -93,12 +94,11 @@ LeggedRobotInterface::LeggedRobotInterface(const std::string& taskFile, const st
93
94
94
95
// load setting from loading file
95
96
modelSettings_ = loadModelSettings (taskFile, " model_settings" , verbose);
96
- ddpSettings_ = ddp::loadSettings (taskFile, " ddp" , verbose);
97
97
mpcSettings_ = mpc::loadSettings (taskFile, " mpc" , verbose);
98
- rolloutSettings_ = rollout ::loadSettings (taskFile, " rollout " , verbose);
98
+ ddpSettings_ = ddp ::loadSettings (taskFile, " ddp " , verbose);
99
99
sqpSettings_ = sqp::loadSettings (taskFile, " sqp" , verbose);
100
100
ipmSettings_ = ipm::loadSettings (taskFile, " ipm" , verbose);
101
- useHardFrictionConeConstraint_ = useHardFrictionConeConstraint ;
101
+ rolloutSettings_ = rollout::loadSettings (taskFile, " rollout " , verbose) ;
102
102
103
103
// OptimalConrolProblem
104
104
setupOptimalConrolProblem (taskFile, urdfFile, referenceFile, verbose);
@@ -329,13 +329,8 @@ std::unique_ptr<StateInputConstraint> LeggedRobotInterface::getFrictionConeConst
329
329
/* *****************************************************************************************************/
330
330
std::unique_ptr<StateInputCost> LeggedRobotInterface::getFrictionConeSoftConstraint (
331
331
size_t contactPointIndex, scalar_t frictionCoefficient, const RelaxedBarrierPenalty::Config& barrierPenaltyConfig) {
332
- FrictionConeConstraint::Config frictionConeConConfig (frictionCoefficient);
333
- auto frictionConeConstraintPtr = std::make_unique<FrictionConeConstraint>(*referenceManagerPtr_, std::move (frictionConeConConfig),
334
- contactPointIndex, centroidalModelInfo_);
335
-
336
- auto penalty = std::make_unique<RelaxedBarrierPenalty>(barrierPenaltyConfig);
337
-
338
- return std::make_unique<StateInputSoftConstraint>(std::move (frictionConeConstraintPtr), std::move (penalty));
332
+ return std::make_unique<StateInputSoftConstraint>(getFrictionConeConstraint (contactPointIndex, frictionCoefficient),
333
+ std::make_unique<RelaxedBarrierPenalty>(barrierPenaltyConfig));
339
334
}
340
335
341
336
/* *****************************************************************************************************/
0 commit comments