Skip to content

Commit

Permalink
Fix birdeye view (#601)
Browse files Browse the repository at this point in the history
* fix-API

* time me to utils

* fix main camera
  • Loading branch information
QuanyiLi authored Jan 19, 2024
1 parent e43692c commit eaa3f9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions metadrive/engine/core/main_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,10 @@ def set_bird_view_pos_hpr(self, position, hpr=None):
Returns:
"""
self.set_bird_view_pos_hpr(position)
if self.engine.task_manager.hasTaskNamed(self.TOP_DOWN_TASK_NAME):
# adjust hpr
p_pos = panda_vector(position)
self.camera_x, self.camera_y = p_pos[0], p_pos[1]
p_pos = panda_vector(position, self.engine.global_config["top_down_camera_initial_z"])
self.camera_x, self.camera_y, self.top_down_camera_height = p_pos[0], p_pos[1], p_pos[2]
self.camera_hpr = hpr or [0, 0, 0]
self.engine.task_manager.add(self._top_down_task, self.TOP_DOWN_TASK_NAME, extraArgs=[], appendTask=True)

Expand Down
3 changes: 1 addition & 2 deletions metadrive/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from inspect import getsource
from textwrap import dedent

import pygame
from PIL import Image
from pygments import highlight
Expand All @@ -15,7 +14,7 @@
from metadrive.utils.random_utils import get_np_random, random_string
from metadrive.utils.registry import get_metadrive_class
from metadrive.utils.utils import is_mac, import_pygame, recursive_equal, setup_logger, merge_dicts, \
concat_step_infos, is_win
concat_step_infos, is_win, time_me


def generate_gif(frames, gif_name="demo.gif", is_pygame_surface=False, duration=30):
Expand Down

0 comments on commit eaa3f9d

Please sign in to comment.