Skip to content

Commit

Permalink
Rename knee_flip to knees_forward (bool) for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Oct 14, 2024
1 parent e990303 commit 4fe355f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/base.gin
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PIBalancerGains.pitch_stiffness = 20.0
PIBalancerGains.position_damping = 5.0
PIBalancerGains.position_stiffness = 2.0

HeightController.knee_flip = False
HeightController.knees_forward = True
HeightController.max_crouch_height = 0.08 # [m]
HeightController.max_crouch_velocity = 0.05 # [m] / [s]
HeightController.max_height_difference = 0.02 # [m]
Expand Down
10 changes: 5 additions & 5 deletions pink_balancer/height_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class HeightController:
"""Compute leg inverse kinematics.
Attributes:
knee_flip: Set to True to bend knees forward rather than backward.
knees_forward: Set to True to bend knees forward rather than backward.
max_crouch_height: Maximum distance along the vertical axis that the
robot goes down while crouching, in [m].
max_init_joint_velocity: Maximum joint velocity during the initial
Expand All @@ -98,7 +98,7 @@ class HeightController:
"""

height_difference: float = 0.0
knee_flip: bool
knees_forward: bool
max_crouch_height: float
max_crouch_velocity: float
max_height_difference: float
Expand All @@ -112,7 +112,7 @@ class HeightController:

def __init__(
self,
knee_flip: bool,
knees_forward: bool,
max_crouch_height: float,
max_crouch_velocity: float,
max_height_difference: float,
Expand Down Expand Up @@ -186,7 +186,7 @@ def __init__(
),
}

sign = -1.0 if knee_flip else +1.0
sign = -1.0 if knees_forward else +1.0
tasks["posture"].set_target(
custom_configuration_vector(
robot,
Expand Down Expand Up @@ -216,7 +216,7 @@ def __init__(
self.__initialized = False
self.ik_configuration = neutral_configuration
self.jump_playback = None
self.knee_side = "forward" if knee_flip else "backward"
self.knee_side = "forward" if knees_forward else "backward"
self.last_velocity = np.zeros(robot.nv)
self.max_crouch_height = max_crouch_height
self.max_crouch_velocity = max_crouch_velocity
Expand Down

0 comments on commit 4fe355f

Please sign in to comment.