Skip to content
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

Init base pose from datastore #12

Closed

Conversation

orikuma
Copy link
Contributor

@orikuma orikuma commented Nov 7, 2023

When I start MCC after finishing another controller, the initial pose of the robot can be different from the one assumed in pre-defined motion in MCC. In addition, when I change a controller from MCC to other controllers and go back to MCC, the pose of the base can be modified by other controllers though the actual robot is in the same position.
To solve this initialization problem, I add option to save last pose of the base in datastore and overwrite pose of the base link in reset function. It also can be defined from yaml file as basePose, which is loaded when instantiating MCC.

@orikuma orikuma force-pushed the init-base-pose-from-datastore branch from fb72c16 to fbba0ee Compare November 7, 2023 03:17
@mmurooka mmurooka self-requested a review November 7, 2023 09:46
Copy link
Member

@mmurooka mmurooka left a 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.

I believe this feature should be included in the mc_rtc controller definition itself, as it will be needed not only for MCC, but you can merge it for quick development for now.

bool exitWhenLimbSwingFinished_ = false;

//! Option to save the last pose in datastore for the other motion
bool saveLastBasePose_ = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable defined in ConfigMotionState seems to be unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in da202a4

{
exitWhenLimbSwingFinished_ = static_cast<bool>(config_("configs")("exitWhenLimbSwingFinished"));
}
if(config_.has("configs") && config_("configs").has("saveLastBasePose"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable defined in ConfigMotionState seems to be unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in da202a4

@@ -89,6 +89,9 @@ 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment here that the basePose configuration allows you to set the initial value and the saveLastBasePose configuration allows you to save the base pose (if you have a better place to do it, that's fine too).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the comment for constructor, reset, and stop functions in da202a4

orikuma added a commit to orikuma/MultiContactController that referenced this pull request Apr 12, 2024
@mmurooka mmurooka closed this in #16 Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants