Skip to content

Instantly share code, notes, and snippets.

View Luca-Pozzi's full-sized avatar

Luca Luca-Pozzi

  • Politecnico di Milano
  • Lecco, Italy
View GitHub Profile
@Luca-Pozzi
Luca-Pozzi / img_saver_node.py
Last active September 18, 2025 10:46
ROS node to save images from CompressedImage topic to file
#!/usr/bin/env python3
import rospy
import os
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import Image, CompressedImage
class ImageAcquisitionNode:
def __init__(self, topic, out_dir, n_images, interval):
@Luca-Pozzi
Luca-Pozzi / bag2video.py
Last active April 29, 2025 07:39
ROS .bag with (Compressed)Image and Audio(Stamped) messages to .mp4 conversion
import os
import argparse
import glob
import subprocess
import wave
import cv2
import rosbag
from cv_bridge import CvBridge