Skip to content

Commit

Permalink
Fix wrong scan simulator resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadAmine998 committed Aug 9, 2024
1 parent e476f6d commit 35c3125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/waypoint_follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def render_lookahead_point(self, e):
Callback to render the lookahead point.
"""
if self.lookahead_point is not None:
points = self.lookahead_point[:2][None] # shape (1, 2)~
if self.lookahead_point_render is None:
points = self.lookahead_point[:2][None] # shape (1, 2)
self.lookahead_point_render = e.render_points(points, color=(0, 0, 128), size=2)
else:
self.lookahead_point_render.setData(points)
Expand All @@ -216,8 +216,8 @@ def render_local_plan(self, e):
update waypoints being drawn by EnvRenderer
"""
if self.current_index is not None:
points = self.waypoints[self.current_index : self.current_index + 10, :2]
if self.local_plan_render is None:
points = self.waypoints[self.current_index : self.current_index + 10, :2]
self.local_plan_render = e.render_lines(points, color=(0, 128, 0), size=1)
else:
self.local_plan_render.updateItems(points)
Expand Down
2 changes: 1 addition & 1 deletion f1tenth_gym/envs/laser_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def set_map(self, map: str | Track, map_scale: float = 1.0) -> bool:
self.map_width = self.map_img.shape[1]

# load map specification
self.map_resolution = self.track.spec.resolution * map_scale
self.map_resolution = self.track.spec.resolution
self.origin = self.track.spec.origin

self.orig_x = self.origin[0]
Expand Down

0 comments on commit 35c3125

Please sign in to comment.