Skip to content

Instantly share code, notes, and snippets.

@miquelmassot
miquelmassot / rosbag2csv.py
Created December 18, 2022 22:24
Extract messages from bagfiles into CSV files
import rosbag, csv
import string
import argparse
from pathlib import Path
"""
Extract messages from bagfiles into CSV files
Usage:
python rosbag2csv.py bagfiles [bagfiles ...] [--topics TOPICS [TOPICS ...]]
@miquelmassot
miquelmassot / image_exif_folder_to_csv.py
Created February 15, 2023 16:05
This script looks for images within a folder, extract the GPS location (lat, lon, alt) and stores it in a CSV.
import exifread
from pathlib import Path
import argparse
def _get_if_exist(data, key):
if key in data:
return data[key]
return None
def get_exif(filename):
syntax="proto2";
import "dccl/option_extensions.proto";
message SingleImageSummary {
option (dccl.msg) = { codec_version: 4
id: 124
max_bytes: 100 };
required int32 image_id = 1 [(dccl.field) = { min: 0 max: 65535 }];
required double latitude = 2 [(dccl.field) = { units { system: "angle::degree" derived_dimensions: "plane_angle" }
min: -90