Skip to content

Instantly share code, notes, and snippets.

View plusangel's full-sized avatar
😁
happy coding!

angelos plastropoulos plusangel

😁
happy coding!
View GitHub Profile
@plusangel
plusangel / invoices_example.cpp
Created August 29, 2019 16:09
invoices example in modern c++
#ifndef INVOICE_H_
#define INVOICE_H_
#include <chrono>
#include <memory>
#include <ostream>
#include <string>
#include <vector>
#include "Customer.h"
@plusangel
plusangel / bashrc_ROSX.txt
Created April 21, 2019 11:27
bashrc for ROS
# ROS1
export ROS_DISTRO=melodic
source /opt/ros/$ROS_DISTRO/setup.bash
source /home/user/catkin_ws/devel/setup.bash
# ROS2
export ROS_DISTRO=crystal
source /opt/ros/$ROS_DISTRO/setup.bash
source /home/user/ros2_ws/install/local_setup.bash
@plusangel
plusangel / rPi3-ad-hoc.txt
Created March 18, 2019 13:52
rPi3-ad-hoc
I have setup Ad-Hoc mode on my Pi3.
This involves modification to network configuration file /etc/network/interfaces so you should first make a backup e.g. sudo cp /etc/network/interfaces /etc/network/interfaces.orig.
Replace the interfaces file with the following:-
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
@plusangel
plusangel / my_ROS_misc.txt
Last active July 15, 2023 13:27
ROS misc
How to install packages from github
git clone -b <branch> <address>
e.g. git clone -b hydro-devel https://github.com/ros/common_msgs.git
What python version I ahve installed?
pkg-config --modversion opencv
How to view a camera topic on ROS?
rosrun image_view image_view image:=/usb_cam/image_rect
@plusangel
plusangel / fashion_mnist_nn.py
Last active July 15, 2023 13:26
fashion mnist neural network approach
# To load the mnist data
from keras.datasets import fashion_mnist
from tensorflow.keras.models import Sequential
# importing various types of hidden layers
from tensorflow.keras.layers import Conv2D, MaxPooling2D,\
Dense, Flatten, Softmax
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.losses import SparseCategoricalCrossentropy
@plusangel
plusangel / pm_ad.md
Last active July 23, 2022 18:23
Predictive maintenance & anomaly detection

LSTM for Predictive Maintenance on Pump Sensor Data - link

Time series analysis to explain the thought process in a predictive maintenance case -- almost done--

Time Series Anomaly Detection with PyFBAD - link

An End-to-End Unsupervised Outlier Detection

Time Series Forecasting With Prophet in Python - link

The Prophet library is an open-source library designed for making forecasts for univariate time series datasets and another example here

@plusangel
plusangel / adding_new_packages.md
Created June 1, 2022 19:07
Add additional packages to ROS noetic in rPi4

Let's say that we are in rPi4 we have installed ROS noetic following this guide and we want to add a couple of new packages. In our case we have selected ros_comm package. Imagine that we want to add teleop_twist_keyboard.

cd ros_catkin_ws/
source devel_isolated/setup.bash
rosinstall_generator ros_comm teleop_twist_keyboard --rosdistro noetic --deps --wet-only --tar > noetic-custom_ros.rosinstall
wstool merge -t src noetic-custom_ros.rosinstall
wstool update -t src
rosdep install -y --from-paths src --ignore-src --rosdistro noetic -r --os=debian:buster
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic
@plusangel
plusangel / CMakeLists.txt
Created January 2, 2022 15:54
RAII example in modern C++ (example b)
cmake_minimum_required(VERSION 3.0.0)
project(raii_examples VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_executable(raii_2 raii_2.cpp)
@plusangel
plusangel / CMakeLists.txt
Created January 2, 2022 15:53
RAII in modern C++ (example a)
cmake_minimum_required(VERSION 3.0.0)
project(raii_examples VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_executable(raii_1 raii_1.cpp)
@plusangel
plusangel / ros_qt_app.py
Created October 31, 2021 19:18
rospylib qt app
import sys
from time import sleep
from PySide2.QtCore import Qt, QObject, QThread, Signal, Slot
from PySide2.QtWidgets import (
QApplication,
QLabel,
QMainWindow,
QPushButton,
QVBoxLayout,