Skip to content

Instantly share code, notes, and snippets.

View jlblancoc's full-sized avatar

Jose Luis Blanco-Claraco jlblancoc

View GitHub Profile
@jlblancoc
jlblancoc / Install_gcc7_ubuntu_16.04.md
Last active April 29, 2024 23:21
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@jlblancoc
jlblancoc / gtsam-serialization-example.cpp
Created October 6, 2020 06:50
GTSAM factor graph serialization example
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <fstream>
#include <gtsam/base/serialization.h>
// ... Includes for your values and factors:
#include <gtsam/base/GenericValue.h> // GTSAM_VALUE_EXPORT
#include <gtsam/geometry/Pose2.h>
@jlblancoc
jlblancoc / Instructions.md
Last active December 23, 2023 12:35
Tasmota Rules for LC Technology WiFi Relay

Introduction

These commands are shown in the YouTube tutorial: xxx

Based on the official docs with the addition of the automatic sending of ready\r\n on boot, as required by the firmware of my boards (these ones).

Rules for all boards:

  • Open Module Configuration -> Set module to Generic (18). Click save.
  • Now, depending on the number of relays on your board, do the next 1, 2 or 4 changes:
@jlblancoc
jlblancoc / README.md
Last active August 11, 2023 07:04
Install Azure Kinect DK on Ubuntu 22.04 or newer

Install lib4adev driver library

The Microsoft Kinect for Azure (k4a) is only supported officially for Ubuntu 18.04.

Here are instructions to install its library in a more recent OS:

# Install the key
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
@jlblancoc
jlblancoc / Instructions.md
Last active May 31, 2023 12:23
Install ROS 1 (Noetic) on Ubuntu 22.04 (Jammy)

Install ROS 1 (Noetic) on Ubuntu 22.04 (Jammy)

In general, follow these instructions: http://wiki.ros.org/noetic/Installation/Source

You will find these errors, though:

Problem 1

Problem: hddtemp is not found as a rosdep. Solution:

@jlblancoc
jlblancoc / gist:44be9d4d466f0a973b1f3808a8e56782
Last active February 16, 2023 15:45
GCC sanitizer with CMake

For memory leaks

Build in CMake with these params:

CMAKE_CXX_FLAGS:STRING= -fsanitize=address  -fsanitize=leak -g
CMAKE_C_FLAGS:STRING=-fsanitize=address  -fsanitize=leak -g
CMAKE_EXE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak
CMAKE_MODULE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak

Which can be done with:

@jlblancoc
jlblancoc / delete_build_temps.bat
Created November 28, 2013 21:54
Batch (.BAT) script (Windows) to delete all temporary files after compiling a project with Microsoft Visual Studio (Visual C++) or GCC. It finds and removes (recursively in the given directory trees), all files that match any of: *.obj, *.o, *.pch, *.pdb, *.ilk, *.idb, *.gch
REM =======================================================================
REM Batch (.BAT) script (Windows) to delete all temporary files after
REM compiling a project with Microsoft Visual Studio (Visual C++) or GCC.
REM
REM Warning: It also deletes the debug databases, needed to "step into"
REM from a debugger. These files may be really *large*, but if you think
REM you will need them, remove the file for "*.pdb" below.
REM
REM Usage:
REM - Open a terminal (Windows-key + R , type "cmd", press ENTER)
@jlblancoc
jlblancoc / dibuja_dep.m
Created December 15, 2022 20:09
MATLAB function to draw the power spectral density of a time series
function [] = dibuja_dep(x, Fs)
% Dibuja la densidad espectral de potencia (dep)
% o power spectral density (psd) de una señal "x" muestreada a una
% frecuencia de muestreo "Fs" (Hz)
N = length(x);
X = fft(x);
X = X(1:N/2+1);
psdx = (1/(Fs*N)) * abs(X).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/length(x):Fs/2;
@jlblancoc
jlblancoc / Factor1stOrderOutput.cpp
Created January 20, 2020 09:30
Minimal example: defining new factor and variable types for GTSAM
#include <libfgcontrol/Factor1stOrderOutput.h>
#include <mrpt/core/exceptions.h>
using namespace fgcontrol;
Factor1stOrderOutput::~Factor1stOrderOutput() = default;
gtsam::NonlinearFactor::shared_ptr Factor1stOrderOutput::clone() const
{
return boost::static_pointer_cast<gtsam::NonlinearFactor>(
This file has been truncated, but you can view the full file.
Delivered-To: jlblanco@ual.es
Received: by 2002:a02:8786:0:0:0:0:0 with SMTP id t6csp1186368jai;
Wed, 22 Jul 2020 22:43:39 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJylm/QLhynKq/SZznR1l+Y5sRRDMulWqyIKPUeIickBG5o/ELk3EloepDByZGlB+RSf/LfF
X-Received: by 2002:a92:5f5a:: with SMTP id t87mr1748507ilb.255.1595483019518;
Wed, 22 Jul 2020 22:43:39 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1595483019; cv=none;
d=google.com; s=arc-20160816;
b=N3tZ5eARWjTJbaqKvySN+mHaSOUPVGHZP4DpOQQeS7j0oHIcDMgcEK/G1PAsMInAtw
3OvsVIDWf0Jn7M/zm/HCoJYwhTifyFOyEk+JHaXixlZOIMzLLkRuNwFdOw85IzVEG+d9