Skip to content

Instantly share code, notes, and snippets.

@JimmyPesto
Created November 25, 2020 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JimmyPesto/2e881259c6d03b28250e8c4c4e25acd7 to your computer and use it in GitHub Desktop.
Save JimmyPesto/2e881259c6d03b28250e8c4c4e25acd7 to your computer and use it in GitHub Desktop.
Bash script to process multiple files in a certain workdirectory the same way in a loop
#!/usr/bin/env sh
echo "started converter with ${1} directory"
workdir=${1};
#recursivly grab all files with pcd file format
for f in $(find ${workdir} -name '*.pcd');
do
echo "processing file: ${f}"
out="${f%.*}.scaled.pcd"
echo "out: ${out}"
pcl_transform_point_cloud ${f} ${out} -scale 0.001,0.001,0.001 # mm -> m
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment