Skip to content

Instantly share code, notes, and snippets.

@miquelmassot
miquelmassot / test_fovis.launch
Created June 14, 2014 11:10
Fovis test with Sequence 'freiburg1_xyz'
<launch>
<!-- This should be the same as used with openni_launch -->
<arg name="camera" default="camera" />
<arg name="image" default="image_color" />
<arg name="depth_image" default="image" />
<param name="use_sim_time" value="true"/>
<!-- not needed, images are already rectified and converted -->
<!--include file="$(find openni_launch)/launch/openni.launch">
@miquelmassot
miquelmassot / catkin_create_sublime_project.py
Created September 8, 2014 13:09
Create a Sublime Text 2/3 project with all your workspace packages in it!
#!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import os
import sys
from catkin_pkg.packages import find_packages
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Add ros key
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu jessie main" > /etc/apt/sources.list.d/ros-latest.list'
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <iomanip> // setw
std::string f2s(float p) {
unsigned char* pc = reinterpret_cast<unsigned char*>(&p);
return std::string(pc, pc + sizeof(float));
}
@miquelmassot
miquelmassot / move_repo.sh
Created August 4, 2016 06:24
Migrate git repository
#!/bin/bash
if [ $# -ne 2 ];
then echo "USAGE: move_repo.sh OLD_REMOTE_URL NEW_REMOTE_URL"
exit
fi
CURR_DIR=`pwd`
OLD_REMOTE="$1"
NEW_REMOTE="$2"
@miquelmassot
miquelmassot / .screenrc
Created August 12, 2019 05:53
Simple screenrc
# Save this in ~/.screenrc
# Use bash
shell /bin/bash
autodetach on
# Big scrollback
defscrollback 5000
mean_xyz_m: [1.5000313520431519, -0.08760256320238113, 8.258567810058594]
mean_plane: [1.0, -5.104500695516541e-06, -2.2570870615480905e-05, -1.499910442280434]
plane_angle_std_deg: 0.027107068317437855
plane_angle_mean_deg: 0.012027655943119862
plane_angle_median_deg: 0.004789200110805726
pitch_angle_std_deg: 0.024811587400379545
pitch_angle_mean_deg: -0.0019246573604165722
yaw_angle_std_deg: 0.016095586665442262
yaw_angle_mean_deg: 0.0010355123576031083
num_iterations: 100
@miquelmassot
miquelmassot / compile_MeshLab-2020.05.sh
Last active May 18, 2020 16:53 — forked from LogWell/compile_20190129_beta.sh
Compile MeshLab 2020.05 on Ubuntu 18.04
# install dependencies
sudo apt-get install qt5-default qtcreator libqt5xmlpatterns5-dev qtscript5-dev libeigen3-dev
git clone --recursive --branch MeshLab-2020.05 https://github.com/cnr-isti-vclab/meshlab.git
cd meshlab
# set build flags
QMAKE_FLAGS=('-spec' 'linux-g++' 'CONFIG+=release' 'CONFIG+=qml_release' 'CONFIG+=c++11' 'QMAKE_CXXFLAGS+=-fPIC' 'QMAKE_CXXFLAGS+=-fopenmp' 'QMAKE_CXXFLAGS+=-std=c++11' 'QMAKE_CXXFLAGS+=-fpermissive' 'INCLUDEPATH+=/usr/include/eigen3' "LIBS+=-L`pwd`/lib/linux-g++")
MAKE_FLAGS=('-j12')
@miquelmassot
miquelmassot / numpy_indexing_fail_example.py
Last active February 22, 2022 20:35
numpy indexing in torch fails
import torch
import numpy as np
powers_of_two = list(2**p for p in range(1, 9))
print(powers_of_two)
print('-------- Using torch')
for M in powers_of_two:
for N in powers_of_two:
a = torch.rand(M, N)
@miquelmassot
miquelmassot / compare_directories.py
Last active December 8, 2022 17:23
Script to compare two directory trees. Flags different folders / files. Does not check for content or modification date.
import filecmp
directory_cmp = filecmp.dircmp(
a="/media/oplab-source/configuration",
b="/media/remote/biocammap/Data/configuration",
hide=[".@__thumb"])
def print_subdir(directory_cmp, level=0, full_tree=False):
left_only = directory_cmp.left_only