This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import rosbag | |
| import cv2 | |
| from cv_bridge import CvBridge | |
| import argparse | |
| import glob | |
| def create_video(bag_file, image_topic, output_video): | |
| bridge = CvBridge() | |
| bag = rosbag.Bag(bag_file, 'r') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DIRECTORY="$1" | |
| # Iterate over files in the directory and avoid ._ files. This is an edgecase from having ext4 files on an HFS system | |
| find "$DIRECTORY" -type f -name "*.bag.active" \! -name "._*" | while IFS= read -r file; do | |
| # Index the file | |
| rosbag reindex "$file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| import glob | |
| import os | |
| path = '2022-07-30/' # path to file containing days images | |
| output_file = 'output_video.mp4' # output file name | |
| width = 3846 # width of the input images | |
| height = 2160 # height ofthe input images |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function recursive_for_loop { | |
| for f in *; do | |
| if [ -d $f -a ! -h $f ]; | |
| then | |
| cd -- "$f"; | |
| echo "Executing in:`pwd`/$f"; | |
| #COMMAND GO HERE | |
| # use recursion to navigate the entire tree | |
| recursive_for_loop; | |
| cd ..; |