File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ namespace simple_mpc
9090 postureTask_ = std::make_shared<tsid::tasks::TaskJointPosture>(" task-posture" , robot_);
9191 postureTask_->Kp (settings_.kp_posture * Eigen::VectorXd::Ones (nu));
9292 postureTask_->Kd (2.0 * postureTask_->Kp ().cwiseSqrt ());
93- formulation_.addMotionTask (*postureTask_, settings_.w_posture , 1 );
93+ if (settings_.w_posture > 0 .)
94+ formulation_.addMotionTask (*postureTask_, settings_.w_posture , 1 );
9495
9596 samplePosture_ = tsid::trajectories::TrajectorySample (robot_.nq_actuated (), robot_.na ());
9697
@@ -99,7 +100,8 @@ namespace simple_mpc
99100 std::make_shared<tsid::tasks::TaskSE3Equality>(" task-base" , robot_, model_handler_.getBaseFrameName ());
100101 baseTask_->Kp (settings_.kp_base * Eigen::VectorXd::Ones (6 ));
101102 baseTask_->Kd (2.0 * baseTask_->Kp ().cwiseSqrt ());
102- formulation_.addMotionTask (*baseTask_, settings_.w_base , 1 );
103+ if (settings_.w_base > 0 .)
104+ formulation_.addMotionTask (*baseTask_, settings_.w_base , 1 );
103105
104106 sampleBase_ = tsid::trajectories::TrajectorySample (12 , 6 );
105107
You can’t perform that action at this time.
0 commit comments