-
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
Check limb swing motion has been finished at the end of ConfigMotion if exitWhenLimbSwingFinished is true #10
Conversation
…if exitWhenLimbSwingFinished is true
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.
Other than keeping the existing behavior is there any real use to not waiting on the execution to finish? (afaik most use of this controller only have a single motion configured
src/states/ConfigMotionState.cpp
Outdated
bool limbCofingsFinshed = !ctl().limbManagerSet_->contactCommandStacked(); | ||
if(exitWhenLimbSwingFinished_) | ||
{ | ||
limbCofingsFinshed = limbCofingsFinshed && !ctl().limbManagerSet_->isExecutingLimbSwing(); | ||
} | ||
|
||
return limbCofingsFinshed && taskConfigList_.empty() && collisionConfigList_.empty(); |
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.
bool limbCofingsFinshed = !ctl().limbManagerSet_->contactCommandStacked(); | |
if(exitWhenLimbSwingFinished_) | |
{ | |
limbCofingsFinshed = limbCofingsFinshed && !ctl().limbManagerSet_->isExecutingLimbSwing(); | |
} | |
return limbCofingsFinshed && taskConfigList_.empty() && collisionConfigList_.empty(); | |
return !ctl().limbManagerSet_->contactCommandStacked() && taskConfigList_.empty() && collisionConfigList_.empty() && (!exitWhenLimbSwingFinished_ || !ctl().limbManagerSet_->isExecutingLimbSwing()); |
(should look nicer after formatting)
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 review. I refactored it.
I put |
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! Some small comments.
{ | ||
for(const auto & limbManagerKV : *this) | ||
{ | ||
const auto & contactCommandList = limbManagerKV.second->contactCommandList(); |
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.
This line seems unnecessary.
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 97b00df
@@ -89,6 +89,12 @@ void ConfigMotionState::start(mc_control::fsm::Controller & _ctl) | |||
} | |||
} | |||
|
|||
// Set option to wait for finishing swing motion | |||
if(config_.has("configs") && config_("configs").has("exitWhenLimbSwingFinished")) |
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, you don't need to change it as I wrote in the following comment.
Same as https://github.com/isri-aist/MultiContactController/pull/7/files#r1560534133
Problem:
ConfigMotionState::run()
returns true when the commands stacked in managers become empty, but it does not consider the motion is executing or not. Therefore, the state can exit before the last swing motion has finished.Solution:
I added
exitWhenLimbSwingFinished
option in configs for ConfigMotionState. If it is true,ConfigMotionState::run()
returns false until all swing motions in LimbMangerSet have finished.