Skip to content

Instantly share code, notes, and snippets.

View pantonante's full-sized avatar

Pasquale Antonante pantonante

  • Relari AI
  • Cambridge, MA
View GitHub Profile
clear vars
close all
% Generate example data
[X,Y,Z] = peaks(30);
Z = Z - max(Z(:));
[XX,YY,ZZ] = paraboloid();
cmap_n = 64;
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
<script>
window.WebFontConfig = {
custom: {
# ******************************************************************
# reboot directly to windows
# Inspired by http://askubuntu.com/questions/18170/how-to-reboot-into-windows-from-ubuntu
# ******************************************************************
win-reboot(){
WINDOWS_TITLE=`grep -i 'windows' /boot/grub/grub.cfg|cut -d"'" -f2`
sudo grub-reboot "$WINDOWS_TITLE"
sudo reboot
}
To set llvm you can use
```sh
cmake .. -DCMAKE_CXX_COMPILER=llvm-g++ -DCMAKE_CC_COMPILER=llvm-gcc
```
or
```sh
CC=llvm-gcc CXX=llvm-g++ cmake ..
rows = 5;
columns = 3;
struct_elem = struct('a',1,'b',2);
M = repmat(struct_elem, rows, columns);
git checkout `git rev-list -1 --before="Sep 19 2019 00:00:00" master`

To apply the command to every subfolders (maxdepth 1)

find . -maxdepth 1 -type d -exec sh -c 'cd "{}" && git checkout `git rev-list -1 --before="Sep 19 2019 00:00:00" master`' \;
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#define SIZE 10
#define LOOPS 100
#define PROD_MS 1
# Set wi-fi connection priorities
To list current priorities
```bash
$ nmcli -f autoconnect-priority,name c
AUTOCONNECT-PRIORITY NAME
0 Blake5Net
0 Caffe Ubuntu
0 Caffe Ubuntu Guest
@pantonante
pantonante / ros
Last active October 4, 2019 13:28
```
mkdir -p catkin_ws/src
cd catkin_ws
catkin init
catkin config --extend /opt/ros/melodic
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin config --merge-devel
cs src
wstool ini
```

MATLAB

To run the ROS core via MATLAB it is enough to run

rosinit

Setup Docker container

We want to have a container that can access the ROS core process