diff --git a/src/solver-kine.cpp b/src/solver-kine.cpp index 58c50baca0980bc0610fd49a6af24a7597587cba..16bc3689fac40d0fa7136f31b6617e4c71c36550 100644 --- a/src/solver-kine.cpp +++ b/src/solver-kine.cpp @@ -155,11 +155,11 @@ namespace dynamicgraph "\n" " If true, check that the solver is empty, since second order\n" " kinematics requires tasks to be of type TaskDynPD."; - addCommand("setSecondOrderKine", - makeCommandVoid1(*this,&SolverKine::setSecondOrderKine, + addCommand("setSecondOrderKinematics", + makeCommandVoid0(*this,&SolverKine::setSecondOrderKinematics, docstring)); - addCommand("getSecondOrderKine", + addCommand("getSecondOrderKinematics", makeDirectGetter(*this,&secondOrderKinematics_, docDirectGetter("second order kinematic inversion","bool"))); @@ -191,15 +191,13 @@ namespace dynamicgraph } } - void SolverKine::setSecondOrderKine (const bool& secondOrder) + void SolverKine::setSecondOrderKinematics () { - if (secondOrder) { - if (stack.size() != 0) { - throw std::runtime_error - ("The solver should contain no task before switching to second order mode."); - } + if (stack.size() != 0) { + throw std::runtime_error + ("The solver should contain no task before switching to second order mode."); } - secondOrderKinematics_ = secondOrder; + secondOrderKinematics_ = true; } SolverKine::TaskDependancyList_t SolverKine:: diff --git a/src/solver-kine.h b/src/solver-kine.h index bdf6c5f9a9ee0b61d17b6ab49196c2d5f2eb76b2..29bf2fa24f30b8b213aae3236abe15709511eb04 100644 --- a/src/solver-kine.h +++ b/src/solver-kine.h @@ -99,7 +99,7 @@ namespace dynamicgraph { /// Call parent implementation anc check that task is /// of type dynamic if necessary virtual void push( TaskAbstract& task ); - void setSecondOrderKine (const bool& secondOrder); + void setSecondOrderKinematics (); private: /* --- INTERNAL COMPUTATIONS --- */ void refreshTaskTime( int time );