Skip to content

Instantly share code, notes, and snippets.

View naoki-mizuno's full-sized avatar

Naoki Mizuno naoki-mizuno

  • Kobe, Japan
  • 13:30 (UTC +09:00)
View GitHub Profile
#!/usr/bin/env python
# Plot in real time the data rate of the IMU sensor messages.
# This script was written in order to debug the IMU not outputting messages at
# the configurade rate of 200Hz.
import rospy
from sensor_msgs.msg import Imu
import numpy as np
#!/usr/bin/env python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='darkgrid')
import os.path
import sys
@naoki-mizuno
naoki-mizuno / cddis.py
Last active December 6, 2018 19:57
Script to output download link for MGEX data
#!/usr/bin/env python
import argparse
import datetime
import dateutil.parser
def parse_opts():
parser = argparse.ArgumentParser(add_help=False)
group = parser.add_mutually_exclusive_group(required=True)
#!/bin/bash
XAUTH=/tmp/.docker.xauth
if [ ! -f $XAUTH ]; then
xauth_list=$( xauth nlist :0 | sed -e 's/^..../ffff/' )
if [ ! -z "$xauth_list" ]; then
echo $xauth_list | xauth -f $XAUTH nmerge -
else
touch $XAUTH
fi
#!/bin/bash
while (( $# > 0 )); do
case "$1" in
-*)
if [[ $1 == -- ]]; then
IGNORE_REST=true
shift
continue
elif [[ -n $IGNORE_REST ]]; then
@naoki-mizuno
naoki-mizuno / sands-start
Created May 15, 2018 11:50
SandS startup script
#!/bin/bash
if [[ -n $REMOTEHOST ]] || [[ -n $SSH_CONNECTION ]]; then
exit
fi
if [ -n "$( ps aux | grep -v grep | grep xcape )" ]; then
# xmodmap -e 'keycode 49=Escape asciitilde'
# xmodmap -e 'keycode 9=grave Escape'
killall xcape
@naoki-mizuno
naoki-mizuno / ros_source_util.bash
Last active May 14, 2018 15:53
Utility for sourcing ROS workspaces
export BASH_PRE_CD_HOOK=(
)
export BASH_POST_CD_HOOK=(
'__auto_source_ros_ws'
'__update_last_ros_ws'
)
# Automatically source ROS workspace you were last in
# Empty to disable
export ROS_UTIL_LAST_WS_FILE="$HOME/.cache/ros/last_ws.txt"
export ROS_UTIL_AUTO_ROS_WS="true"
@naoki-mizuno
naoki-mizuno / update-pycharm
Last active July 3, 2024 11:34
Update PyCharm to the latest version
#!/bin/bash
KEEP_TAR='false'
TAR_FILE=''
VERSION='latest'
while getopts 'hkt:v:' flag; do
case "$flag" in
k)
KEEP_TAR='true'
@naoki-mizuno
naoki-mizuno / default_arg_ctor.cpp
Created March 27, 2018 11:24
Default argument ctor is bad
#include <iostream>
/*
* This program illustrates why using default arguments in a constructor is
* bad. Without explicitly defining an operator+(const float k), a Vector2D
* with y being 0 is created.
*/
struct Vector2D {
/// default constructor
@naoki-mizuno
naoki-mizuno / update-clion
Last active August 24, 2019 18:47
CLion Updater
#!/bin/bash
KEEP_TAR='false'
TAR_FILE=''
while getopts 'hkt:' flag; do
case "$flag" in
k)
KEEP_TAR='true'
;;