Skip to content

Commit

Permalink
fix body initial position
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuShuai26 committed Nov 21, 2023
1 parent 34872e9 commit d0b2271
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit d0b2271

Please sign in to comment.