Skip to content

Make human_low_level_control approach work across all pybullet envs#32

Merged
yichao-liang merged 2 commits into
masterfrom
worktree-debug-human-control
May 9, 2026
Merged

Make human_low_level_control approach work across all pybullet envs#32
yichao-liang merged 2 commits into
masterfrom
worktree-debug-human-control

Conversation

@yichao-liang
Copy link
Copy Markdown
Collaborator

@yichao-liang yichao-liang commented May 8, 2026

Summary

  • The approach previously assumed (a) simulator_state is always the dict that PyBulletEnv builds, (b) the robot type exposes x/y/z (+ optionally tilt/wrist), and (c) only fan/blocks/coffee/circuit exist. Result: it crashed on pybullet_blocks (list-shaped simulator_state, pose_x/pose_y/pose_z features) and silently ran IK against fan's base pose for every other env.
  • Tolerate raw-list simulator_state; defer the physics_client_id / robot_id lookup into the mobile-base branch where they're the only consumer.
  • Read the current EE pose via shadow_robot.forward_kinematics(joint_positions) so the policy is independent of env-specific state feature names. Tilt/wrist deltas now apply on top of the FK orientation, preserving roll. (Fixes blocks and cover — the latter being a 2D env with no y feature at all.)
  • Look up the active PyBulletEnv subclass via the BaseEnv registry and build the shadow robot from a fresh connect(DIRECT) + plane + the env's own _create_pybullet_robot. Skips each subclass's initialize_pybullet override (no need to load tables/blocks/fans/etc. for IK), and avoids the previous fan-only fallback that gave wrong base poses.

The approach previously assumed (a) simulator_state is always the dict
PyBulletEnv builds, (b) the robot type exposes x/y/z + tilt/wrist
features, and (c) only fan/blocks/coffee/circuit exist. This crashed on
pybullet_blocks (list-shaped simulator_state, pose_x/pose_y/pose_z
features) and silently fell back to fan's robot for any other env, so
IK ran against the wrong base pose.

- Tolerate raw-list simulator_state; defer physics_client_id/robot_id
  lookup into the mobile-base branch where they are actually used.
- Read the current EE pose via shadow_robot.forward_kinematics() so the
  policy is independent of env state-feature names (fixes blocks and
  cover, the latter being a 2D env with no y feature). Tilt/wrist
  deltas now apply on top of the FK orientation, preserving roll.
- Look up the active PyBulletEnv subclass via the registry and build
  the shadow robot from a fresh DIRECT client + plane + the env's own
  _create_pybullet_robot, skipping each subclass's body-loading
  override (tables/blocks/fans/etc. are not needed for IK).

Smoke-tested across all 14 pybullet envs (ants, balance, barrier,
blocks, boil, circuit, coffee, cover, fan, float, grow, laser,
magic_bin, switch).
@yichao-liang yichao-liang merged commit 8039dca into master May 9, 2026
14 checks passed
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.

1 participant