This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get corner vertices of the label | |
std::vector<geometry_msgs::Point> label_rect; | |
geometry_msgs::Point pt; | |
pt.x = center.position.x - side_length / 2; | |
pt.y = center.position.y - side_length / 2; | |
label_rect.push_back(pt); | |
pt.x = center.position.x + side_length / 2; | |
pt.y = center.position.y - side_length / 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function populatePivotTableData() { | |
spreadsheetId = "1AJbG6ZhqJCyU7vlb2D2d81ZG3dU5ICGkA4GPb0Xa0q8"; | |
var ss = SpreadsheetApp.openById(spreadsheetId); | |
SpreadsheetApp.setActiveSpreadsheet(ss); | |
// Get sheet containing data | |
var srcSheetName = "Reordered Data"; | |
SpreadsheetApp.setActiveSheet(ss.getSheetByName(srcSheetName)); | |
var srcSheet = ss.getActiveSheet(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Basic stuff | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install -y build-essential vim git tmux python-dev curl python-pip cmake libgif-dev | |
rm -r Documents Pictures Videos Templates Public Music examples.desktop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://codepen.io/thomasweng/pen/QQWZaO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rostopic pub /torso_controller/position_joint_action/goal pr2_controllers_msgs/SingleJointPositionActionGoal "header: | |
seq: 0 | |
stamp: | |
secs: 0 | |
nsecs: 0 | |
frame_id: '' | |
goal_id: | |
stamp: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install QEMU OSX port with ARM support | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew update && brew install qemu | |
export QEMU=$(which qemu-system-arm) | |
# Dowload kernel and export location | |
curl -OL \ | |
https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.34-jessie | |
export RPI_KERNEL=./kernel-qemu-4.4.34-jessie | |
# Download filesystem and export location |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TARGET="/home/thomas_weng11/deploy-robopubs" | |
GIT_DIR="/home/thomas_weng11/robopubs.git" | |
BRANCH="master" | |
while read oldrev newrev ref | |
do | |
# only checking out the branch to deploy | |
if [[ $ref = refs/heads/"$BRANCH" ]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
def save_pdf(base_url, year, href): | |
chunk_size = 2000 | |
pdf_url = base_url + href | |
pdf_req = requests.get(pdf_url, stream=True) | |
fname = year + "_" + href | |
with open("./data/%s" % fname, 'wb') as fd: | |
for chunk in pdf_req.iter_content(chunk_size): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rosdep update | |
mkdir -p ~/catkin_ws/src | |
cd ~/catkin_ws | |
catkin build | |
cp -r packages/.* ~/catkin_ws/src/.* | |
catkin build | |
cp ~/setup/scripts/thing1.sh ~/catkin_ws/thing1.sh | |
cp ~/setup/scripts/thing2.sh ~/catkin_ws/thing2.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import cv2 | |
im = cv2.imread("2019-02-13-19-03-1912345DepthImage.png", cv2.IMREAD_UNCHANGED) | |
color_im = cv2.applyColorMap(im.astype(np.uint8), cv2.COLORMAP_JET) | |
plt.imshow(color_im) | |
plt.show() |