diff --git a/include/MultiContactController/MultiContactController.h b/include/MultiContactController/MultiContactController.h index b6fd6ed..e4281ad 100644 --- a/include/MultiContactController/MultiContactController.h +++ b/include/MultiContactController/MultiContactController.h @@ -26,12 +26,18 @@ class PostureManager; struct MultiContactController : public mc_control::fsm::Controller { public: - /** \brief Constructor. */ + /** \brief Constructor. + + basePose in configuration allows users to set the initial pose of the robot. + It will be registered on datastore in this function and reflected in the reset function. + */ MultiContactController(mc_rbdyn::RobotModulePtr rm, double dt, const mc_rtc::Configuration & _config); /** \brief Reset a controller. This method is called when starting the controller. + When MCC::ResetBasePose is in datastore, the posW of both control and real robots + are overwritten by it in this function. */ void reset(const mc_control::ControllerResetData & resetData) override; @@ -44,6 +50,9 @@ struct MultiContactController : public mc_control::fsm::Controller /** \brief Stop a controller. This method is called when stopping the controller. + When saveLastBasePose is enabled in the configuration, + the poseW of control robot will be saved in datastore at the end of this function + to use it for initialization of the following controller. */ void stop() override; @@ -93,7 +102,7 @@ struct MultiContactController : public mc_control::fsm::Controller //! Whether to enable manager update bool enableManagerUpdate_ = false; - //! Whether to save last base pose when stopping this controller + //! Whether to save last base pose when stopping this controller. bool saveLastBasePose_ = false; protected: diff --git a/include/MultiContactController/states/ConfigMotionState.h b/include/MultiContactController/states/ConfigMotionState.h index 74c36f0..9c76c06 100644 --- a/include/MultiContactController/states/ConfigMotionState.h +++ b/include/MultiContactController/states/ConfigMotionState.h @@ -34,8 +34,5 @@ struct ConfigMotionState : State //! Option to select whether this state should wait for finishing reference postures or not bool exitWhenPostureManagerFinished_ = false; - - //! Option to save the last pose in datastore for the other motion - bool saveLastBasePose_ = false; }; } // namespace MCC diff --git a/src/states/ConfigMotionState.cpp b/src/states/ConfigMotionState.cpp index d7dfd96..321ee35 100644 --- a/src/states/ConfigMotionState.cpp +++ b/src/states/ConfigMotionState.cpp @@ -118,10 +118,6 @@ void ConfigMotionState::start(mc_control::fsm::Controller & _ctl) { exitWhenPostureManagerFinished_ = static_cast(config_("configs")("exitWhenPostureManagerFinished")); } - if(config_.has("configs") && config_("configs").has("saveLastBasePose")) - { - saveLastBasePose_ = static_cast(config_("configs")("saveLastBasePose")); - } output("OK"); }