Skip to content

Footstep replanning ignores the real robot pose — feature request / advice? #39

Description

@rohanpsingh

Hello,

I'm using BWC inside a multi-state FSM controller that interleaves walking with manipulation: roughly WalkA → manipulate → WalkB → manipulate → WalkC .... Each walking state computes a target world pose and then calls
footManager_->walkToRelativePose(...) to plan a new gait, when the footstep queue is empty.

In simulation (mc_mujoco), the real robot drifts away from the control robot between walks (sim slipping, contact-model imperfections, manipulation contacts disturbing the stance, etc.). I would like each new walk to be planned starting from where the real robot is actually standing, not from where the previous plan said it should stand.

What BWC currently does (as I understand it)

FootManager::reset() seeds targetFootPoses_ from ctl().robot().surfacePose(...) once, and after that they're only mutated by the swing trajectory. Crucially, walkToRelativePose uses

const sva::PTransformd & initialFootMidpose =      
      projGround(sva::interpolate(targetFootPoses_.at(Foot::Left), 
                                  targetFootPoses_.at(Foot::Right), 0.5));

as the origin of the new plan. So the plan is anchored to the control robot's last commanded foot poses — any drift between control and real accumulates across walks and is never corrected.

I noticed CentroidalManager deliberately exposes hooks for closing the loop on the real robot (useActualStateForMpc, useActualComForWrenchDist, useTargetPoseForControlRobotAnchorFrame, ...) but the FootManager has no analogous switch.

Question

Is there already an idiomatic mc_rtc / BWC way to do this that I'm missing?

Suggested fix (if there isn't already a way)

A small public API on FootManager to re-seed the planning origin from a given robot would solve this cleanly, e.g.:

  /// Re-seed targetFootPoses_ from `robot.surfacePose(...)`.
  /// Only valid when the footstep queue is empty (i.e., not mid-walk).
  void FootManager::resetFootOrigin(const mc_rbdyn::Robot & robot);

Then a user could call footManager_->resetFootOrigin(ctl().realRobot()) just before walkToRelativePose to anchor the new plan to reality. Could also be a config flag along the lines of useActualFootPoseForReplan checked at the top of walkToRelativePose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions