Skip to content

Instantly share code, notes, and snippets.

View yenchenlin's full-sized avatar
👋
Hi!

Yen-Chen Lin yenchenlin

👋
Hi!
View GitHub Profile
h scroll left
j scroll down
k scroll up
d scroll down for half page
u scroll up for half page
l scroll right
gg scroll to top of the page
G scroll to bottom of the page
f activate link hints mode to open in current tab
F activate link hints mode to open in new tab
{"0": "person", "1": "bicycle", "2": "car", "3": "motorcycle", "4": "airplane", "5": "bus", "6": "train", "7": "truck", "8": "boat", "9": "traffic light", "10": "fire hydrant", "11": "stop sign", "12": "parking meter", "13": "bench", "14": "bird", "15": "cat", "16": "dog", "17": "horse", "18": "sheep", "19": "cow", "20": "elephant", "21": "bear", "22": "zebra", "23": "giraffe", "24": "backpack", "25": "umbrella", "26": "handbag", "27": "tie", "28": "suitcase", "29": "frisbee", "30": "skis", "31": "snowboard", "32": "sports ball", "33": "kite", "34": "baseball bat", "35": "baseball glove", "36": "skateboard", "37": "surfboard", "38": "tennis racket", "39": "bottle", "40": "wine glass", "41": "cup", "42": "fork", "43": "knife", "44": "spoon", "45": "bowl", "46": "banana", "47": "apple", "48": "sandwich", "49": "orange", "50": "broccoli", "51": "carrot", "52": "hot dog", "53": "pizza", "54": "donut", "55": "cake", "56": "chair", "57": "couch", "58": "potted plant", "59": "bed", "60": "dining table", "61": "toile
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import json
import numpy as np
import cv2
import argparse

image

pip install --upgrade jax jaxlib==0.1.65+cuda110 -f https://storage.googleapis.com/jax-releases/jax_releases.html

image

#!/usr/bin/env python
import socket
import struct
import time
import threading
import os
import sys
import math
import numpy as np
# Construct 3D calibration grid across workspace
gridspace_x = np.linspace(self._workspace_bounds[0,0]+0.1,self._workspace_bounds[0,1]-0.1,1+(self._workspace_bounds[0,1]-self._workspace_bounds[0,0]-0.2)/calib_grid_step)
gridspace_y = np.linspace(self._workspace_bounds[1,0]+0.1,self._workspace_bounds[1,1]-0.1,1+(self._workspace_bounds[1,1]-self._workspace_bounds[1,0]-0.2)/calib_grid_step)
calib_grid_x,calib_grid_y,calib_grid_z = np.meshgrid(gridspace_x,gridspace_y,self._workspace_bounds[2,0]+0.1)
num_calib_grid_pts = calib_grid_x.shape[0]*calib_grid_x.shape[1]*calib_grid_x.shape[2]
calib_grid_x.shape = (num_calib_grid_pts,1)
calib_grid_y.shape = (num_calib_grid_pts,1)
calib_grid_z.shape = (num_calib_grid_pts,1)
calib_grid_pts = np.concatenate((calib_grid_x,calib_grid_y,calib_grid_z), axis=1)

How to install UR_RTDE

Some bugs exist in the newest version but I found a checkout point that works well! Please follow the instructions below.

Prerequisite

sudo apt-get install libboost-all-dev
conda install pybind11

Note: pip install pybind11 will cause error later, make sure you use conda.

@yenchenlin
yenchenlin / A
Created November 20, 2019 18:29
# Check if something is in between gripper fingers by measuring grasp width
# def check_grasp_robotiq(self):
# self._gripper_data = None
# tcp_msg = 'def process():\n'
# tcp_msg += ' socket_open("127.0.0.1",63352,"gripper_socket")\n'
# tcp_msg += ' rq_pos = socket_get_var("POS","gripper_socket")\n'
# tcp_msg += ' sync()\n'
# tcp_msg += ' textmsg("value = ",rq_pos)\n'
# tcp_msg += ' socket_open("100.107.146.22",50201,"desktop_socket")\n'
# tcp_msg += ' socket_send_int(rq_pos,"desktop_socket")\n'
@yenchenlin
yenchenlin / figure_tips.md
Created October 25, 2019 18:37
Figure tips from Prof. Isola

Figure tips

General advice

  • Spend as much time on figures as you do on writing
  • Use perceptual grouping to your advantage
  • Never use default graphical styles; develop your own brand
  • Minimize the data-ink ratio
  • The figure should be understandable without reading the caption

Perceptual grouping

@yenchenlin
yenchenlin / writing_tips.md
Last active October 25, 2019 18:34
Writing tips from Prof. Isola

Writing tips

The golden rule: do the most, with the least

General advice

11 rules

(1-4 and 11 adapted from George Orwell's six rules)

  • Rule 1: Never use a metaphor, simile, or other figure of speech that you are used to seeing in print
  • Rule 2: Never use jargon if you can think of an everyday English equivalent