Skip to content

Commit d0da85f

Browse files
committed
Verified that images can be captured using the Gazebo Camera Class
1 parent ec0927c commit d0da85f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/modules/imaging/camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def capture(self) -> Image.Image:
2727
# Should be implemented by deriving classes.
2828
raise NotImplementedError()
2929

30-
def caputure_to(self, path: str | pathlib.Path):
30+
def capture_to(self, path: str | pathlib.Path):
3131
"""
3232
Captures a single image and saves it to `path`.
3333
"""
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
from src.modules.imaging.camera import GazeboCamera
2+
import os
3+
24

35
cam = GazeboCamera()
46

5-
cam.show_images()
7+
os.makedirs("tmp/log", exist_ok=True)
8+
dirs = os.listdir("tmp/log")
9+
ft_num = len(dirs)
10+
os.makedirs(f"tmp/log/{ft_num}") # no exist_ok bc. this folder should be new
11+
12+
13+
cam.capture_to(f"tmp/log/{ft_num}/gazebocamera.png")

0 commit comments

Comments
 (0)