Problem Description
in mpc_utils.py
hip = jnp.tile(p, n_contact) + foot0 @ jax.scipy.linalg.block_diag(*([Ryaw] * n_contact)).T
The variable is named hip but actually computes foot positions in global coordinates, not hip joint positions. This causes:
- Semantic mismatch and confusion
- Poor code readability
- Maintenance difficulties
What the calculation does
p: Robot base position in global frame
foot0: Foot positions in local coordinates
Ryaw: Base yaw rotation matrix
- Result: Foot positions in global frame
Proposed Solution
Rename the variable to accurately reflect its purpose:
# Recommended
foot_global_pos = jnp.tile(p, n_contact) + foot0 @ jax.scipy.linalg.block_diag(*([Ryaw] * n_contact)).T
# Alternative
feet_world_positions = jnp.tile(p, n_contact) + foot0 @ jax.scipy.linalg.block_diag(*([Ryaw] * n_contact)).T
Labels
bug code quality good first issue
Problem Description
in mpc_utils.py
The variable is named
hipbut actually computes foot positions in global coordinates, not hip joint positions. This causes:What the calculation does
p: Robot base position in global framefoot0: Foot positions in local coordinatesRyaw: Base yaw rotation matrixProposed Solution
Rename the variable to accurately reflect its purpose:
Labels
bugcode qualitygood first issue