This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install opencv-python | |
| import cv2 | |
| numCameraDeviceIndicesToTest = 10 | |
| vidcapList = [] | |
| for i in range(numCameraDeviceIndicesToTest): | |
| vidcap = cv2.VideoCapture(i) | |
| if vidcap.isOpened(): | |
| vidcapList.append(vidcap) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #============================================================================= | |
| # Finds the ROS library and components for integration into CMake projects without using catkin. | |
| # | |
| # Simply add to your project: | |
| # set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/path/to/folder/containing/this/") | |
| # find_package(ROS REQUIRED COMPONENTS roscpp tf2 cv_bridge pcl_ros) | |
| # | |
| # Then, link ros::<component> to your target | |
| # add_executable(myprogram main.cpp) | |
| # target_link_libraries(myprogram ros::roscpp ros::tf2 ros::cv_bridge ros::pcl_ros) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
| # Initialization code that may require console input (password prompts, [y/n] | |
| # confirmations, etc.) must go above this block; everything else may go below. | |
| if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
| source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
| fi | |
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <condition_variable> | |
| #include <mutex> | |
| // For single consumer signalling only! Written to help the listener always retrieve the latest available information | |
| class CVFunctionSignaller | |
| { | |
| private: | |
| enum class SignalState : int8_t | |
| { | |
| Shutdown = -1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install zsh from apt | |
| sudo apt install zsh | |
| # Install OMZ plugin manager | |
| sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
| # https://github.com/athityakumar/colorls | |
| # Zsh-z autojump | |
| git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <pcl/visualization/pcl_visualizer.h> | |
| static auto gviewer = pcl::visualization::PCLVisualizer::Ptr(new pcl::visualization::PCLVisualizer ("3D Viewer")); | |
| static bool gfirstpclreceived{false}; | |
| void func(){ | |
| pcl::PointCloud<pcl::PointXYZ>::Ptr pcloud(new pcl::PointCloud<pcl::PointXYZ>()); | |
| while(true){ | |
| // add this in the loop | |
| if (gfirstpclreceived) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # python3 -m pip install psutil | |
| import psutil | |
| import datetime | |
| import time | |
| import math | |
| import os | |
| logfile = f'HWLOG-{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.csv' | |
| num_cpus = len(psutil.cpu_percent(percpu=True)) # Do an initial call to start tracking cpu usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -eu | |
| set -o pipefail | |
| # Git | |
| sudo add-apt-repository ppa:git-core/ppa -y | |
| sudo apt update | |
| sudo apt install git -y | |
| # install clang/llvm etc? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ctime> // for std::time | |
| #include <sstream> | |
| #include <chrono> | |
| #include <iomanip> | |
| std::string getDateTime() | |
| { | |
| auto t = std::time(nullptr); | |
| auto tm = *std::localtime(&t); // not thread safe? | |
| std::ostringstream oss; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # INSTALLATION | |
| # sudo apt install tmux xsel && git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm | |
| # Install plugins with Ctrl+b + I (capitalised!!) | |
| # select text via mouse by holding shift first - if having issues with selection going to another pane, use prefix + z to zoom/unzoom on the current panel | |
| # Prefix default = Ctrl + b (C-b) | |
| # Copy Pasting using copy mode: | |
| # enter copy mode - C-b [, start copying with C-space, and press y to copy with tmux-yank |