Skip to content

Instantly share code, notes, and snippets.

View Merwanski's full-sized avatar
:electron:
Focusing

Merwanski

:electron:
Focusing
  • Belgium
  • Belgium
View GitHub Profile
@Merwanski
Merwanski / streamlit_ros_python.py
Created September 17, 2022 05:47
streamlit ros python
from streamlit.web import cli as stcli
import streamlit as st
import rospy
from std_msgs.msg import String, Int32
import sys
import time
mynum=0
mydelta=0
@Merwanski
Merwanski / avi2png.py
Last active November 13, 2022 09:48
avi2png.py extract images from video
"""
Created on Mon Nov 13 16:12:42 2017
@author: merwan
"""
import numpy as np
import cv2
import time
import os
import argparse
@Merwanski
Merwanski / aruco_generate.py
Last active November 13, 2022 09:53
aruco marker generator
import cv2
import cv2.aruco as aruco
# Select type of aruco marker (size)
aruco_dict = aruco.Dictionary_get(aruco.DICT_5X5_1000)
# Create an image from the marker
# second param is the ID number
# last param is the image size
img = aruco.drawMarker(aruco_dict, 2, 700)
@Merwanski
Merwanski / rosbag_to_csv.py
Created November 13, 2022 09:57
rosbag_to_csv.py
import rosbag, sys, csv
import time
import string
import os #for file management make directory
import shutil #for file management, copy file
# verify correct input arguments: 1 or 2
if (len(sys.argv) > 2):
print("invalid number of arguments: " + str(len(sys.argv)))
print("should be 2: 'bag2csv.py' and 'bagName'")
"""
Created on Mon Dec 11 14:02:33 2017
@author: merwan
"""
import os
import argparse
import cv2
import rosbag
import sys
@Merwanski
Merwanski / streamlit_ros.py
Last active November 23, 2022 21:18
streamlit_ros.py webgui
#!/usr/bin/env python3
import streamlit as st
import rospy
import time
import threading
from std_msgs.msg import String, Int32
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
@Merwanski
Merwanski / talker_text_image.py
Last active November 23, 2022 21:14
talker text image py ros publisher
#!/usr/bin/env python3
import rospy
import cv2
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
bridge = CvBridge()
@Merwanski
Merwanski / install_docker_nvidia_linuxMint.sh
Created December 2, 2022 15:14
install_docker_nvidia_linuxMint
# !/bin/bash
# Installation instructions from https://docs.docker.com/engine/install/ubuntu/
# Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Use the following command to set up the stable repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# INSTALL DOCKER ENGINE
@Merwanski
Merwanski / install_docker_nvidia.sh
Created December 2, 2022 15:17
install_docker_nvidia ubuntu 20.04
# !/bin/bash
# Installation instructions from https://docs.docker.com/engine/install/ubuntu/
# Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Use the following command to set up the stable repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# INSTALL DOCKER ENGINE
@Merwanski
Merwanski / cv_bridge_ros_python3.txt
Created December 5, 2022 14:02
cv_bridge_ros_python3.txt
# NOTES: ROS Melodic -- Python3.7
# Solution is to build cv_bridge with python3.
sudo apt-get install python-catkin-tools python3-dev python3-catkin-pkg-modules python3-numpy python3-yaml ros-melodic-cv-bridge
# Create catkin workspace
mkdir catkin_workspace
cd catkin_workspace
catkin init
# Instruct catkin to set cmake variables