-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PostureManager #7
Conversation
…sk according to reference configurations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! Sorry for the detailed (and in some cases personal preference) remarks.
/** \brief Remove entries from the logger. */ | ||
virtual void removeFromLogger(mc_rtc::Logger & logger); | ||
|
||
/** \brief Append a nominal centroidal pose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is not valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
/** \brief Append a nominal centroidal pose | ||
\param t time | ||
\param PostureMap map from joint names to joint angle | ||
\return whether nominalCentroidalPose is appended |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is not valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
|
||
This method should be called once when controller is reset. | ||
*/ | ||
virtual void reset(const PostureManager::PostureMap & initialPosture); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialPosture = {}
とデフォルト値を指定して,引数無しのreset
メソッドは消去することってできるんでしたでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かにデフォルト値の指定ができたので 3e96498 で修正しました
void PostureManager::update() | ||
{ | ||
// Set data | ||
PostureManager::PostureMap ref = getNominalPosture(ctl().t()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is PostureManager::
necessary for PostureMap
here?
ref
-> nominalPosture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
PostureManager::PostureMap PostureManager::getNominalPosture(double t) const | ||
{ | ||
// if nominalPostureList_ is empty or specified past time, return empty map | ||
PostureManager::PostureMap postures; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postures
-> nominalPosture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
return postures; | ||
} | ||
|
||
bool PostureManager::appendNominalPosture(double t, const PostureManager::PostureMap & postures) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postures
-> nominalPosture
(same for header)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
{ | ||
time += baseTime; | ||
} | ||
PostureManager::PostureMap refPosture = nominalPostureConfig("target"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refPosture
-> nominalPosture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
if(config_.has("configs") && config_("configs").has("nominalPosture")) | ||
{ | ||
mc_rtc::Configuration nominalPostureConfig = config_("configs")("nominalPosture"); | ||
PostureManager::PostureMap initPosture = nominalPostureConfig("target"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initPosture
-> initialPosture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
|
||
/** \brief Append a nominal centroidal pose | ||
\param t time | ||
\param PostureMap map from joint names to joint angle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write [rad]
or [deg]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
|
||
PostureManager::PostureMap PostureManager::getNominalPosture(double t) const | ||
{ | ||
// if nominalPostureList_ is empty or specified past time, return empty map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
-> If
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3e96498
*/ | ||
virtual void stop(); | ||
|
||
// TODO: implement GUI functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以下のように現在指定している関節数がGUIで表示できたら良いかと思いますがいかがでしょうか.
Number of specified joints: 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
21e4efa でRvizに現在nominalPostureとして指定されている関節数を表示するようにしました
@@ -89,6 +105,11 @@ void ConfigMotionState::start(mc_control::fsm::Controller & _ctl) | |||
} | |||
} | |||
|
|||
if(config_.has("configs") && config_("configs").has("exitWhenPostureManagerFinished")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but after reading the following page, I thought that the original expression was safer and needless to change, since it allowed us to check corectness of the type.
https://jrl-umi3218.github.io/mc_rtc/tutorials/usage/mc_rtc_configuration.html
Could this be replaced by the following?
if(config_.has("configs"))
{
config_("configs")("exitWhenPostureManagerFinished", exitWhenPostureManagerFinished_);
}
Problem:
When I want to play multi-contact motion planned by a multi-contact motion planner, resulting motion of MultiContactController is different from the planned motion because the reference joint angle is always the same in QP solved in MultiContactController.
Solution:
To specify target postures in multi-contact locomotion, I added PostureManager.
It loads target postures from
nominalPostureList
inMultiContactController.yaml
and set them to PostureTask in QP according to the specified time.The entry in the yaml file should be as follows.