Skip to content

Instantly share code, notes, and snippets.

View nevalsar's full-sized avatar
🎯
Focusing

Nevin Valsaraj nevalsar

🎯
Focusing
View GitHub Profile

ROS - Common Issues

Problem

roscd \ rosls \ rosrun commands not found

Solution:

Install rosbash package.

sudo apt install ros-noetic-rosbash

"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"--shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"standard",
"plugin:react/recommended"
],
@nevalsar
nevalsar / blobdetectrecursion.cpp
Last active December 30, 2015 00:29
Blob detection using recursion
#include <stdio.h>
#include "opencv2/opencv.hpp"
#define PIX(img,i,j,k) (((uchar*)img->imageData)[i*img->widthStep+j*img->nChannels+k])
void dfsrecursion(IplImage* img, int x, int y, int **status, int blobcount)
{
int i,j;
//traverse all connected pixels and start dfs if encounter a black unvisited pixel
@nevalsar
nevalsar / stack-and-queue-using-structure.cpp
Last active December 29, 2015 20:39
Linked list implementation of Stack and Queue.
#include <iostream>
#include <stdlib.h>
using namespace std;
struct NODE{
int val;
struct NODE *next;
};
@nevalsar
nevalsar / adaptivethresholding.cpp
Last active December 29, 2015 18:19
Adaptive thresholding for binary video from live camera feed
#include "opencv2/opencv.hpp"
#define PIX(img,i,j,k) (((uchar*)img->imageData)[i*img->widthStep+j*img->nChannels+k])
int findmedian(IplImage* img)
{
int intensities[256];
int i,j,temp=0;
for(i=0;i<256;i++)
intensities[i]=0;
@nevalsar
nevalsar / trackbar_mono.cpp
Last active December 29, 2015 18:19
Thresholding of a binary image using trackbar
#include "opencv2/opencv.hpp"
#define PIX(img,i,j,k) (((uchar*)img->imageData)[i*img->widthStep+j*img->nChannels+k])
IplImage* createbinary(IplImage *img, int thresh)
{
int i,j,ht,wd;
ht=img->height;
wd=img->width;
#include <ros/ros.h>
#include <ros/console.h>
#include <std_msgs/String.h>
#include <cv_bridge/cv_bridge.h>
#include <image_transport/image_transport.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/opencv.hpp>
#include <topicheaders/topicheaders.h>
#define CAMERA_ID 0 // 0: front camera, 1: bottom camera
@nevalsar
nevalsar / mux-debug-auv-core.log
Created February 19, 2015 13:12
Output of `tmux debug auv-core`
#!/bin/zsh
# Clear rbenv variables before starting tmux
unset RBENV_VERSION
unset RBENV_DIR
tmux start-server\; has-session -t auv-core 2>/dev/null
if [ "$?" -eq 1 ]; then
cd /home/routeaccess
@nevalsar
nevalsar / github_contribution.py
Created February 17, 2015 16:17
Get contribution count of user on GitHub
#!/usr/bin/env python
# Python script to get the day's contribution count from user's GitHub account
# Use flag -h for parameter information
import urllib2
from bs4 import BeautifulSoup
import argparse
# parse args and set parameter details
parser = argparse.ArgumentParser(description='Get GitHub contribution data')