CMake
target_link_library(something private LIB)
The thing above is only applicable for shared libraries
#include <Eigen/Dense> | |
template <class MatT> | |
Eigen::Matrix<typename MatT::Scalar, MatT::ColsAtCompileTime, MatT::RowsAtCompileTime> | |
pseudoinverse(const MatT &mat, typename MatT::Scalar tolerance = typename MatT::Scalar{1e-4}) // choose appropriately | |
{ | |
typedef typename MatT::Scalar Scalar; | |
auto svd = mat.jacobiSvd(Eigen::ComputeFullU | Eigen::ComputeFullV); | |
const auto &singularValues = svd.singularValues(); | |
Eigen::Matrix<Scalar, MatT::ColsAtCompileTime, MatT::RowsAtCompileTime> singularValuesInv(mat.cols(), mat.rows()); |
ffmpeg -i 1.mov -i 2.mov -i 3.mov -filter_complex "hstack=3" output.mp4 |
import numpy as NP | |
import casadi as C | |
def qpsolve(H,g,lbx,ubx,A=NP.zeros((0,0)),lba=NP.zeros(0),uba=NP.zeros(0)): | |
# Convert to CasADi types | |
H = C.DMatrix(H) | |
g = C.DMatrix(g) | |
lbx = C.DMatrix(lbx) | |
ubx = C.DMatrix(ubx) | |
A = C.DMatrix(A) | |
A = A.reshape((A.size1(),H.size1())) # Make sure matching dimensions |
CMake
target_link_library(something private LIB)
The thing above is only applicable for shared libraries
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100 | |
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100 |
#ifndef TIMER_H | |
#define TIMER_H | |
#include <chrono> | |
#include <thread> | |
using timer = std::chrono::high_resolution_clock::time_point; | |
inline void tic(timer &t){ | |
t = std::chrono::high_resolution_clock::now(); |
If you need increase in computational power from your workstation this might be a right post for you. Power management, in this case CPU Governor, is a software that assures the "best" power consumption by a computer for a particular task. For some reason in Ubuntu 20.04 a default CPU governor (even on stationary PCs) is powersave. This comes in handy, if you are using it for some office applications (text processor, email, client, webbrowsing). However for a real-time control of the electromechanical systems such as robots where we have to be able to use computers performance at full, or for machine learning we desire to minimize time spent on training a model. A small amount of performance boost can be obtain choosing the right CPU governor in our case performance profile. You can enable performance CPU governor on your computer following the instructions below. Open your favorite shell and type following command.
$ sudo systemctl disable ondemand.service
$ echo perfor
The document provides description on calibration of three Kinect for Microsoft sensors connected to one computer with several usb controllers. Three cameras setup is shown below:
Intrinsic, extrinsic, and Kinect2Kinect calibration is performed to know the position of each sensor in the space. Our setup is ROS Indigo with Ubuntu 14.04. freenect_launch and camera_pose ROS packages are used. Camera_pose package provides the pipeline to calibrate the relative 6D poses between multiple camera's. freenect_launch package contains launch files for using OpenNI-compliant devices in ROS. It creates a nodelet graph to transform raw data from the device driver into point clouds, disparity images, and other products suitable for processing and visualization. It is installed with catkin as follows:
# Prepa
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
xhost + ${hostname}
to allow connections to the macOS host *export HOSTNAME=`hostname`
* environment: