Skip to content

Instantly share code, notes, and snippets.

View naoki-mizuno's full-sized avatar

Naoki Mizuno naoki-mizuno

  • Kobe, Japan
  • 09:26 (UTC +09:00)
View GitHub Profile
#!/usr/bin/env python2
from __future__ import division
import sys
from numpy import *
import scikits.audiolab as al
import pyaudio
#!/usr/bin/env python2
import rosbag
import sys
import os
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-f', '--file', dest='list_file',
@naoki-mizuno
naoki-mizuno / initialpose_publisher.py
Created December 2, 2017 13:53
Keeps publishing initialpose topic based on base_link
#!/usr/bin/env python2
import rospy
import tf2_ros
from geometry_msgs.msg import PoseWithCovarianceStamped
rospy.init_node('initialpose_publisher')
buf = tf2_ros.Buffer()
@naoki-mizuno
naoki-mizuno / say
Last active December 16, 2017 19:37
#!/bin/bash
DIALOGUE=''
TONE='neutral'
while getopts 'hf:t:' flag; do
case "$flag" in
f)
DIALOGUE=$OPTARG
;;
@naoki-mizuno
naoki-mizuno / trajectory_display.py
Created January 11, 2018 03:58
Trajectory visualizer
#!/usr/bin/env python2
import rospy
import tf
import tf2_ros
import tf.transformations
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import PoseStamped
import copy
@naoki-mizuno
naoki-mizuno / xkcd_colors.urdf.xacro
Last active November 10, 2024 06:51
Gazebo color palette with xckd color names
<?xml version="1.0"?>
<!-- https://www.w3schools.com/colors/colors_xkcd.asp -->
<robot>
<material name="acidgreen" >
<color rgba="0.5607843137254902 0.996078431372549 0.03529411764705882 1.0" />
</material>
<material name="adobe" >
<color rgba="0.7411764705882353 0.4235294117647059 0.2823529411764706 1.0" />
</material>
@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'
;;
@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-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 / 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"