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

Bipedal Walker - Fix initial body position #782

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gymnasium/envs/box2d/bipedal_walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def reset(
self._generate_clouds()

init_x = TERRAIN_STEP * TERRAIN_STARTPAD / 2
init_y = TERRAIN_HEIGHT + 2 * LEG_H
init_y = TERRAIN_HEIGHT + 2 * LEG_H - LEG_DOWN
self.hull = self.world.CreateDynamicBody(
position=(init_x, init_y), fixtures=HULL_FD
)
Expand All @@ -458,7 +458,7 @@ def reset(
self.joints: List[Box2D.b2RevoluteJoint] = []
for i in [-1, +1]:
leg = self.world.CreateDynamicBody(
position=(init_x, init_y - LEG_H / 2 - LEG_DOWN),
position=(init_x, init_y - LEG_H / 2 + LEG_DOWN),
angle=(i * 0.05),
fixtures=LEG_FD,
)
Expand All @@ -480,7 +480,7 @@ def reset(
self.joints.append(self.world.CreateJoint(rjd))

lower = self.world.CreateDynamicBody(
position=(init_x, init_y - LEG_H * 3 / 2 - LEG_DOWN),
position=(init_x, init_y - LEG_H * 3 / 2 + LEG_DOWN),
angle=(i * 0.05),
fixtures=LOWER_FD,
)
Expand Down
Loading