This file contains 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
#!/usr/bin/env bash | |
# optionally clear all eps files | |
# rm *.eps | |
for f in *.svg | |
do | |
fname=${f##*/} | |
fprefix=${fname%.*} | |
echo $fprefix |
This file contains 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
# source the workspace of the current working directory automatically | |
home_dir=~/ | |
ws_ptr="(${home_dir}ws/[0-9a-zA-Z ]+)/?" | |
if [[ $PWD =~ $ws_ptr ]]; then | |
ws_dir=${BASH_REMATCH[1]} | |
source $ws_dir/devel/setup.bash | |
fi |
This file contains 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
// method for calculating the pseudo-Inverse as recommended by Eigen developers | |
template<typename _Matrix_Type_> | |
_Matrix_Type_ pseudoInverse(const _Matrix_Type_ &a, double epsilon = std::numeric_limits<double>::epsilon()) | |
{ | |
Eigen::JacobiSVD< _Matrix_Type_ > svd(a ,Eigen::ComputeThinU | Eigen::ComputeThinV); | |
double tolerance = epsilon * std::max(a.cols(), a.rows()) *svd.singularValues().array().abs()(0); | |
return svd.matrixV() * (svd.singularValues().array().abs() > tolerance).select(svd.singularValues().array().inverse(), 0).matrix().asDiagonal() * svd.matrixU().adjoint(); | |
} |
This file contains 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 | |
# Re-index files by changing the index suffix of file names. | |
# Usage: reindex_files <pattern> <offset> | |
# It renames all files in the folder following "pattern + number + extension" naming. | |
# <pattern> can be any regex (care not to match the index number). | |
# <number> is an integer ([0-9]+) | |
# It works for files with no extension as well. | |
# It will ask for confirmation before renaming the files. | |
rename_all(){ |
This file contains 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 | |
# Simple script for compressing all bag files under a folder. | |
# Optionally, deletes the backup files created by rosbag. | |
read -p "Compress every bag file under $PWD ? (y/n)" yn | |
# initial user consent | |
if [ "$yn" == "n" ]; then | |
exit 0 | |
fi | |
# optionally remove backups right away |
This file contains 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
#!/usr/bin/env python3 | |
# This script will renumerate the item indexes in a | |
# YAML dictionary. ROS currently does not support easy | |
# acquisition of list of objects from parameter server, | |
# so I prefer using indexed dictionaries. However, it | |
# is tiring to index them manually. This script does it. | |
# Example yaml file (iter_prefix = 'p'): | |
# https://github.com/gokhansolak/lfd-experiments-iros2019/blob/master/data/grasp/pregrasp.yaml |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#! /usr/bin/env python | |
# This program adds the given license notice at the | |
# beginning of all c, cpp, h, hpp files in a folder | |
# | |
# usage: | |
# change to the directory that contains the code files | |
# python3 add_license_notice.py <license_file> <source_path> | |
# it will apply the changes too all files in that directory | |
import glob |
This file contains 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
#!/usr/bin/env python | |
# This program adds DmpBbo namespace to the class names | |
# in a dmp xml archive to solve boost serialization's | |
# unregistered_class error | |
# usage: | |
# change to the directory that contains dmp xml files | |
# python3 dmp_archive_updater.py | |
# it will apply the changes too all xml files in that directory |
This file contains 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
#!/usr/bin/env bash | |
# This script calls a certain ROS launch file with incremental experiment numbers, | |
# and records user notes in order to a markdown (md) file. | |
# exp_type: name of the launch file | |
# exp_no: last index to start from | |
# | |
# | |
# usage (arguments are optional): | |
# ./iterate_exp.sh exp_type exp_no ros_package[optional] |
NewerOlder