Skip to content

Instantly share code, notes, and snippets.

View sergeant-wizard's full-sized avatar
😵

Ryo Miyajima sergeant-wizard

😵
  • Preferred Networks
  • Tokyo
View GitHub Profile
cd
git clone [email protected]:sergeant-wizard/rc_files
ln -s rc_files/.vimrc .vimrc
ln -s rc_files/tmux.conf.linux .tmux.conf
git clone https://github.com/robbyrussell/oh-my-zsh.git
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge --enable-multibyte --enable-pythoninterp=yes --enable-cscope --with-x --prefix=/home/ryo/vim/
import numpy as np
import cv2
img_size = 640
initial_nodes = np.array([
[+1.0, +1.0, +1.0, +1.0],
[+1.0, +1.0, +1.0, -1.0],
[+1.0, +1.0, -1.0, +1.0],
[+1.0, +1.0, -1.0, -1.0],
[+1.0, -1.0, +1.0, +1.0],
JOINT_NAMES = [
'shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint',
'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'
]
class UR5Controller(object):
def __init__(self):
rospy.init_node('node', anonymous=True)
self.speed_pub = rospy.Publisher('ur_driver/joint_speed', JointTrajectory, queue_size=1)
@sergeant-wizard
sergeant-wizard / servo_id.py
Created July 11, 2017 09:02
parallel communication between multiple servos
from time import sleep, time
from multiprocessing import Process, Manager
def hardware_io(action, shared_dict):
write_duration = 1.2
read_duration = 0.4
sleep(write_duration) # mock write (put action)
sleep(read_duration) # mock read (get state)
shared_dict['state'] = time()
@sergeant-wizard
sergeant-wizard / generic_vector.cpp
Last active December 3, 2017 21:05
vector with generic types of elements
#include <vector>
#include <iostream>
// library code
template<class T>
double internal_pose(const T& data) {
std::cout << "not implemented error" << std::endl;
}
class Element {
@sergeant-wizard
sergeant-wizard / deoplete.log
Created May 9, 2018 01:02
deoplete_pythonpath_log
2018-05-09 09:19:56,646 INFO [25778] (deoplete.logging) --- Deoplete Log Start ---
2018-05-09 09:19:56,648 INFO [25778] (deoplete.logging) NVIM v0.3.0-1209-gebb1acb3c, Python 3.5.2, neovim client 0.2.6
2018-05-09 09:19:56,659 DEBUG [25778] (deoplete.core) Process 0: /home/ryo/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/base.py
2018-05-09 09:19:56,660 DEBUG [25778] (deoplete.core) Process 1: /home/ryo/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/file.py
2018-05-09 09:19:56,660 DEBUG [25778] (deoplete.core) Process 2: /home/ryo/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/dictionary.py
2018-05-09 09:19:56,660 DEBUG [25778] (deoplete.core) Process 3: /home/ryo/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/buffer.py
2018-05-09 09:19:56,660 DEBUG [25778] (deoplete.core) Process 0: /home/ryo/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/around.py
2018-05-09 09:19:56,660 DEBUG [25778] (deoplete.core) Process 1: /home/ryo/.
@sergeant-wizard
sergeant-wizard / config.yml
Created September 4, 2018 18:52
minimum circleci config file to reproduce the issue
version: 2
jobs:
# vm jobs
machine:
machine: true
steps:
- run: |
echo $SLEEP
date
import rospy
import numpy as np
import std_msgs.msg
from rx import Observable
class TopicObservable(object):
def __init__(self, topic_name, topic_type, max_msgs=None):
self._topic_name = topic_name
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergeant-wizard
sergeant-wizard / bread_first_traverse.py
Created May 22, 2019 16:17
breadth-first-traverse
import queue
class Node:
def __init__(self, name):
self._name = name
self._children = []
self.visited = False
@property