Skip to content

Commit

Permalink
Fix PR comment in isri-aist#12
Browse files Browse the repository at this point in the history
  • Loading branch information
orikuma committed Apr 12, 2024
1 parent 97b00df commit da202a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
13 changes: 11 additions & 2 deletions include/MultiContactController/MultiContactController.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions include/MultiContactController/states/ConfigMotionState.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions src/states/ConfigMotionState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ void ConfigMotionState::start(mc_control::fsm::Controller & _ctl)
{
exitWhenPostureManagerFinished_ = static_cast<bool>(config_("configs")("exitWhenPostureManagerFinished"));
}
if(config_.has("configs") && config_("configs").has("saveLastBasePose"))
{
saveLastBasePose_ = static_cast<bool>(config_("configs")("saveLastBasePose"));
}

output("OK");
}
Expand Down

0 comments on commit da202a4

Please sign in to comment.