Install Qt5 dependencies
sudo apt-get install qt5-default qttools-dev qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev
sudo apt-get install ros-foxy-test-msgs
| function compress_pdf() | |
| { | |
| input_file=$1 | |
| output_file=$1_compressed.pdf | |
| level=/$2 | |
| #levels: screen > ebook > printer > prepress, | |
| gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=$level -sOutputFile=$output_file $input_file | |
| echo "Saved in the same folder with name $output_file" | |
| } |
import trimesh
from numpy.linalg import inv
import numpy as np
def pretty_print(array):
print(np.round(array, 2))
def change_centroid(mesh_path, save_path, additional_T=None):
mesh = trimesh.load_mesh(mesh_path)
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| x_min = 0.51 | |
| x_max = 0.54 | |
| num_bins = 20 | |
| num_data=7000 | |
| x_mean = 0.53 | |
| plt.style.use("ggplot") |
| from mpl_toolkits.mplot3d import Axes3D | |
| import matplotlib.pyplot as plt | |
| def plot_cuboid(sample_cuboid): | |
| fig = plt.figure(figsize=(12,9)) | |
| ax = fig.add_subplot(111, projection='3d') | |
| for pair in sampling_cuboid['plot_pairs']: | |
| start_point = sampling_cuboid['centre_point'] + sampling_cuboid[pair[0]] | |
| end_point = sampling_cuboid['centre_point'] + sampling_cuboid[pair[1]] |
| #!/usr/bin/bash | |
| input="full path to file" | |
| while IFS= read -r line; do | |
| arrIN=(${line// / }) ## to split with ; arrIN=(${line//;/ }) | |
| ## do something with the words, words can be obtained by ${arrIN[i]} where i is the index | |
| done < "${input}" |
| import numpy as np | |
| def two_d_array_compare(array_a, array_b, thresh): | |
| """ | |
| this function does a pairwise comparision matching between array_b and array_a | |
| it returns all the row numbers in array_a that has a similar entry in array_b | |
| :param array_a: m x k | |
| :param array_b: n x k | |
| :thresh float difference | |
| :return: row numbers of similar rows |
| T* constructOrFindInstance(const std::string& instance_name) | |
| { | |
| auto result = mSegment.find<T>(instance_name.c_str()); | |
| if (result.first != nullptr) { | |
| return result.first; | |
| } else { | |
| return mSegment.construct<T>(instance_name.c_str())(); | |
| } | |
| } |
| from multiprocessing import Pool | |
| import numpy as np | |
| import time | |
| def gen_data(s, e, N): | |
| q = np.linspace(s, e, N) | |
| dq = np.linspace(s, e, N)*2 | |
| ddq = np.linspace(s, e, N)*3 | |
| time.sleep(0.5) |