Skip to content

Instantly share code, notes, and snippets.

View argahsuknesib's full-sized avatar

Kush Bisen argahsuknesib

View GitHub Profile
<template>
<div class="heater">
<table class="heater">
<thead>
<tr>
<th v-for="key in columns" v-bind:key="key">
{{ key }}
</th>
</tr>
</thead>
body {
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 18px;
color: #444;
}
table {
border: 10px solid #4276b9;
border-radius: 3px;
background-color: #fff;
@argahsuknesib
argahsuknesib / un-demo.service
Created June 21, 2022 22:43
A service to restart the react website when it stops.
[Unit]
Description=Disability Wikibase Demo Website.
After=network.target
StartLimitIntervalSec=0[Service]
Type=simple
Restart=always // check the exit status if it is 0 or not, and use on-failure if restart code is not 0
RestartSec=1
User=root
ExecStart=npm start
@argahsuknesib
argahsuknesib / CSVLabel2Wikibase.py
Created March 14, 2022 20:13
CSVLabel2Wikibase
from cgitb import text
import csv
import configparser
import ntpath
from pydoc import doc
from urllib import request
from xml.dom.minidom import Document
import pywikibot
from SPARQLWrapper import SPARQLWrapper, JSON
from configWikibaseID import ProductionConfig
#! /usr/bin/env python
import math
import rospy
from nav_msgs.msg import Odometry
from move_base_msgs.msg import MoveBaseActionGoal
from emse_eri_robot_obstacle_14x14 import obstacles
class LocationGrid(object):
def __init__(self):
rospy.init_node('location_grid')
@argahsuknesib
argahsuknesib / manhattan_distance.py
Created August 3, 2021 05:15
Manhattan Distance Calculator
#!/usr/bin/env python
import rospy
from std_msgs import String
from nav_msgs import Odometry
from move_base_msgs.msg import MoveBaseGoal
class ManhattanDistance(object):
def __init__(self,publisher):
self._publisher = publisher
max_obstacle_height: 0.60 # assume something like an arm is mounted on top of the robot
# (http://wiki.ros.org/costmap_2d/hydro/inflation)
robot_radius: 0.17 # distance a circular robot should be clear of the obstacle (kobuki: 0.18)
# footprint: [[x0, y0], [x1, y1], ... [xn, yn]] # if the robot is not circular
obstacle_layer:
enabled: true
max_obstacle_height: 0.6
origin_z: 0.0
rosbagTimestamp,header,seq,stamp,secs,nsecs,frame_id,info,map_load_time,secs,nsecs,resolution,width,height,origin,position,x,y,z,orientation,x,y,z,w,data
520654000000,,0,,520,653000000,"""odom""",,,0,0,0.10000000149011612,40,40,,,-4.3000000000000025,-7.899999999999986,0.0,,0.0,0.0,0.0,1.0,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@argahsuknesib
argahsuknesib / print-log.py
Created July 15, 2021 22:15
Log Generation in CSV
#! /usr/bin/env python
import rospy
from nav_msgs.msg import Odometry, OccupancyGrid, Path, GridCells
from move_base_msgs.msg import MoveBaseActionGoal
from rosgraph_msgs.msg import Clock
from geometry_msgs.msg import Twist
def cmd_vel_callback(msg):
linear_velocity_x = msg.linear.x
linear_velocity_y = msg.linear.y
@argahsuknesib
argahsuknesib / post-hoc.r
Created July 24, 2022 10:56
PostHoc tests
posthoc.tgh <- function(y, x, method=c("games-howell", "tukey"), digits=2) {
### Based on http://www.psych.yorku.ca/cribbie/6130/games_howell.R
method <- tolower(method);
tryCatch(method <- match.arg(method), error=function(err) {
stop("Argument for 'method' not valid!");
});
res <- list(input = list(x=x, y=y, method=method, digits=digits));
res$intermediate <- list(x = factor(x[complete.cases(x,y)]),
y = y[complete.cases(x,y)]);
res$intermediate$n <- tapply(y, x, length);