srobo / competition-simulator

A simulator for Student Robotics Virtual Competitions
https://studentrobotics.org/docs/simulator/
MIT License
8 stars 2 forks source link

Add `R.camera.save()` #368

Open WillB97 opened 1 year ago

WillB97 commented 1 year ago

And make it work with run_comp_match.

    def save(self, path: Path | str) -> None:
        """
        Save an unannotated image to a path.

        NOTE This differs from the kit version as the image is not annotated.
        TODO check this is within the folder.
        TODO update run_comp_match to include these in teams archives.
        """
        path = Path(path)
        if not path.suffix:
            LOGGER.warning("No file extension given, defaulting to jpg")
            path = path.with_suffix(".jpg")

        with self._capture():
            self._camera.saveImage(str(path), 100)