Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Nov 24, 2023
1 parent 9d25aba commit ad845f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/example_cameras_images.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
from nicegui import ui

from rosys.vision import ImageSize, SimulatedCamera
from rosys.vision import SimulatedCamera

camera = SimulatedCamera(id='test_cam', resolution=ImageSize(width=800, height=600))
camera = SimulatedCamera(id='test_cam', width=800, height=600)

image = ui.interactive_image()
ui.timer(0.3, lambda: image.set_source(camera.get_latest_image_url()))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/example_cameras_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
robot = rosys.hardware.RobotSimulation([wheels])
rosys.vision.SimulatedCameraProvider.USE_PERSISTENCE = False
camera_provider = rosys.vision.SimulatedCameraProvider()
camera = rosys.vision.SimulatedCamera(id='test_cam', resolution=rosys.vision.ImageSize(width=800, height=600))
camera = rosys.vision.SimulatedCamera(id='test_cam', width=800, height=600)
rosys.on_startup(lambda: camera_provider.add_camera(camera))
steerer = rosys.driving.Steerer(wheels)
odometer = rosys.driving.Odometer(wheels)
Expand Down
3 changes: 1 addition & 2 deletions rosys/vision/simulated_camera/simulated_camera_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from ... import persistence, rosys
from ..camera_provider import CameraProvider
from ..image import ImageSize
from .simulated_camera import SimulatedCamera


Expand Down Expand Up @@ -50,4 +49,4 @@ def add_cameras(self, num_cameras: int) -> None:
for _ in range(num_cameras):
new_id = f'cam{len(self._cameras)}'
print(f'adding simulated camera: {new_id}')
self.add_camera(SimulatedCamera(id=new_id, resolution=ImageSize(width=640, height=480)))
self.add_camera(SimulatedCamera(id=new_id, width=640, height=480))

0 comments on commit ad845f1

Please sign in to comment.