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

Humanoid-Walk task bug report #359

Open
ppap36 opened this issue Nov 21, 2024 · 1 comment
Open

Humanoid-Walk task bug report #359

ppap36 opened this issue Nov 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ppap36
Copy link

ppap36 commented Nov 21, 2024

Thank you for your contribution.
I found a little bug in mjpc/tasks/humanoid/walk/task.xml and walk.cc
In line 33 and 34 of task.xml

    <user name="Velocity" dim="2" user="7 0.625 0 25.0 0.2 4.0" />
    <user name="Walk" dim="1" user="7 1.0 0.0 25.0 0.5 3.0" />

The definition of "velocity" is before the definition of "walk"
However in "walk.cc".

  // com vel
  double* waist_lower_subcomvel =
      SensorByName(model, data, "waist_lower_subcomvel");
  double* torso_velocity = SensorByName(model, data, "torso_velocity");
  double com_vel[2];
  mju_add(com_vel, waist_lower_subcomvel, torso_velocity, 2);
  mju_scl(com_vel, com_vel, 0.5, 2);

  // walk forward
  residual[counter++] =
      standing * (mju_dot(com_vel, forward, 2) - parameters_[1]);

  // ----- move feet ----- //
  double* foot_right_vel = SensorByName(model, data, "foot_right_velocity");
  double* foot_left_vel = SensorByName(model, data, "foot_left_velocity");
  double move_feet[2];
  mju_copy(move_feet, com_vel, 2);
  mju_addToScl(move_feet, foot_right_vel, -0.5, 2);
  mju_addToScl(move_feet, foot_left_vel, -0.5, 2);

  mju_copy(&residual[counter], move_feet, 2);
  mju_scl(&residual[counter], &residual[counter], standing, 2);
  counter += 2;

It is reversed.

@yuvaltassa
Copy link
Contributor

Thanks for this!

@yuvaltassa yuvaltassa added the bug Something isn't working label Nov 23, 2024
copybara-service bot pushed a commit that referenced this issue Nov 26, 2024
…ml. Fixes #359.

PiperOrigin-RevId: 700304229
Change-Id: I1ab15337743a4c419aaee2f0863ed2fc82bd65e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants