Skip to content

Commit

Permalink
added m_isValid = 'true' in 'setFeasibleRegion()' + minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-mau committed Jan 17, 2025
1 parent a7a394f commit 325c79a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ class VariableFeasibleRegionTask : public TSIDLinearTask
} // namespace TSID
} // namespace BipedalLocomotion

#endif // BIPEDAL_LOCOMOTION_TSID_VARIABLE_LINEAR_TASK_H
#endif // BIPEDAL_LOCOMOTION_TSID_VARIABLE_LINEAR_TASK_H
3 changes: 2 additions & 1 deletion src/TSID/src/VariableFeasibleRegionTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ bool VariableFeasibleRegionTask::setFeasibleRegion(
Eigen::Ref<const Eigen::VectorXd> l,
Eigen::Ref<const Eigen::VectorXd> u)
{
m_isValid = false;
constexpr auto errorPrefix = "[VariableFeasibleRegionTask::setFeasibleRegion]";

// check if the size of the matrices is correct
if (C.cols() != m_variableSize)
{
Expand Down Expand Up @@ -182,6 +182,7 @@ bool VariableFeasibleRegionTask::setFeasibleRegion(
errorPrefix);
return false;
}
m_isValid = true;

// resize the matrices
m_A.resize(2 * C.rows(), m_NumberOfVariables);
Expand Down
2 changes: 1 addition & 1 deletion src/TSID/tests/VariableFeasibleRegionTaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TEST_CASE("Variable Feasible Region Task")
Eigen::Ref<const Eigen::MatrixXd> A = task2.getA();
Eigen::Ref<const Eigen::VectorXd> B = task2.getB();

// A == expectedT imply S == identity
// A == expectedT implies S == identity
Eigen::MatrixXd expectedT(2*anyDimension, variable2ElementSize);
expectedT << C, -C;
REQUIRE(A.isApprox(expectedT));
Expand Down

0 comments on commit 325c79a

Please sign in to comment.