From 50e8a019a2269814d2e8527a987b22bf2416b17d Mon Sep 17 00:00:00 2001 From: Francesco Morsillo <fmorsill@laas.fr> Date: Thu, 11 Jul 2013 13:15:16 +0200 Subject: [PATCH] Modified function name and command to set second order kinematics in order to uniform it to Device::setSecondOrderIntegration --- src/solver-kine.cpp | 18 ++++++++---------- src/solver-kine.h | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/solver-kine.cpp b/src/solver-kine.cpp index 58c50ba..16bc368 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 bdf6c5f..29bf2fa 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 ); -- GitLab