ref: create vision_chunk

This commit is contained in:
2025-12-21 20:13:51 +03:00
parent 92b6b0b0fe
commit 9d4839aa2a
6 changed files with 221 additions and 152 deletions

View File

@@ -9,6 +9,7 @@ from selenium.webdriver.common.action_chains import ActionChains
from autopilot import Pilot
from geolocation import Geolocation
from vision_chunk import VisionChunk
from visualization import VisualizationManager, SimMode
from yandex_map import YandexMap
@@ -103,10 +104,10 @@ class Simulator:
else:
self.geo.z *= 2
def get_photo(self) -> Image.Image:
def get_chunk(self) -> VisionChunk:
png = self.yandexMap.driver.get_screenshot_as_png()
im = Image.open(BytesIO(png))
# Применяем поворот как будто съемка с дрона
rotated_im = self.rotate_image_like_drone(im, -self.geo.angle)
return rotated_im
return VisionChunk(rotated_im)