Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrhm committed Nov 7, 2024
1 parent c221849 commit ad8d064
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/image_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from rclpy.executors import ExternalShutdownException


class ImageCapture(Node):
def __init__(self) -> None:
super().__init__("image_capture")
Expand All @@ -29,17 +30,18 @@ def save_image(self, msg: Image):
if not os.path.exists(path):
os.mkdir(path)

path = os.path.join(path, f'image_{unique_id}.jpg')
path = os.path.join(path, f"image_{unique_id}.jpg")

cv2.imwrite(path, img)

self.get_logger().info(f'Saved image_{unique_id}.jpg')
self.get_logger().info(f"Saved image_{unique_id}.jpg")
pass


def main() -> None:
try:
rclpy.init(args=sys.argv)
while(True):
while True:
input()
rclpy.spin_once(ImageCapture())
rclpy.shutdown()
Expand All @@ -48,5 +50,6 @@ def main() -> None:
except ExternalShutdownException:
sys.exit(1)

if __name__ == '__main__':

if __name__ == "__main__":
main()

0 comments on commit ad8d064

Please sign in to comment.