Skip to content

Instantly share code, notes, and snippets.

declare -x ROS_PACKAGE_PATH="/home/pi/ros_catkin_ws/src:/opt/ros/hydro/share:/opt/ros/hydro/stacks"
If xboxdrv has error busy then sometimes unplugging and replugging works
.el_minlgnd .dc_sb svg {
width: 50%;
}
.el_minlgnd .dc_sb {
display: inline;
no vert align
}
@thomasweng15
thomasweng15 / log.txt
Created December 4, 2016 22:03
log.txt
[INFO] [WallTime: 1480888191.052460] ticks: 1 rotation: 0
[INFO] [WallTime: 1480888191.173918] ticks: 2 rotation: 0
[INFO] [WallTime: 1480888191.235789] ticks: 3 rotation: 0
[INFO] [WallTime: 1480888191.286737] ticks: 4 rotation: 0
[INFO] [WallTime: 1480888191.329928] ticks: 5 rotation: 0
[INFO] [WallTime: 1480888191.369103] ticks: 6 rotation: 0
[INFO] [WallTime: 1480888191.406187] ticks: 7 rotation: 0
[INFO] [WallTime: 1480888191.440691] ticks: 8 rotation: 0
[INFO] [WallTime: 1480888191.473786] ticks: 9 rotation: 0
[INFO] [WallTime: 1480888191.505036] ticks: 10 rotation: 0
@thomasweng15
thomasweng15 / log1. txt
Created December 4, 2016 22:30
log1.txt
[INFO] [WallTime: 1480888191.052460] ticks: 1 rotation: 0
[INFO] [WallTime: 1480888191.173918] ticks: 2 rotation: 0
[INFO] [WallTime: 1480888191.235789] ticks: 3 rotation: 0
[INFO] [WallTime: 1480888191.286737] ticks: 4 rotation: 0
[INFO] [WallTime: 1480888191.329928] ticks: 5 rotation: 0
[INFO] [WallTime: 1480888191.369103] ticks: 6 rotation: 0
[INFO] [WallTime: 1480888191.406187] ticks: 7 rotation: 0
[INFO] [WallTime: 1480888191.440691] ticks: 8 rotation: 0
[INFO] [WallTime: 1480888191.473786] ticks: 9 rotation: 0
[INFO] [WallTime: 1480888191.505036] ticks: 10 rotation: 0
@thomasweng15
thomasweng15 / docker-ml.service
Last active February 5, 2017 01:06
Save at /etc/systemd/system/docker-ml.service
[Unit]
Description=ML container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a ml
ExecStop=/usr/bin/docker stop -t 2 ml
@thomasweng15
thomasweng15 / get_transform
Last active July 26, 2017 02:20
Get transform through transformlistener
#!/usr/bin/env python
import rospy
import tf
if __name__ == '__main__':
rospy.init_node("person_tf_broadcaster")
br = tf.TransformBroadcaster()
rate = rospy.Rate(10)
@thomasweng15
thomasweng15 / builder.sh
Created August 1, 2017 00:17
rebuild and relaunch scripts for C++ ROS projects
#!/bin/sh
WATCH_DIRS=(~/catkin_ws/src/ros-project/src/perception/src ~/catkin_ws/src/ros-project/src/perception/include/perception)
inotifywait -m ${WATCH_DIRS[@]} -e close_write |
while read path action file; do
if [[ "$file" =~ .*cpp$ ]] || [[ "$file" =~ .*h$ ]]; then
echo "$file modified, rebuilding..."
if catkin --force-color build | grep "succeeded!"; then
rosnode kill process_cloud_main
@thomasweng15
thomasweng15 / bbox.cpp
Created August 1, 2017 19:15
bound box stub for octomap
// get object marker then raycast box edges
// then expand to multiple objects
octomap::OcTreeKey bbxMinKey, bbxMaxKey;
double min_x, min_y, min_z;
octree->getMetricMin(min_x, min_y, min_z);
octomap::point3d min = octomap::point3d(float(min_x), float(min_y), float(min_z));
double max_x, max_y, max_z;
octree->getMetricMax(max_x, max_y, max_z);
@thomasweng15
thomasweng15 / gist:3bab5a91bb7a391e3d09a326456e2b3f
Created September 9, 2017 22:36
QC35 Wireless Headphones setup
Restart bluetooth after making conf changes, use system settings to connect. Turn headphones off before starting the connection. The device should appear as headphones.
Have to use A2DP mode for good sound quality.
https://askubuntu.com/questions/833322/pair-bose-quietcomfort-35-with-ubuntu-over-bluetooth
https://askubuntu.com/questions/370254/how-can-i-get-the-a2dp-output-option-and-the-input-working-again
@thomasweng15
thomasweng15 / Code.gs
Created December 23, 2017 06:57
[Google Apps Script] Randomize range
function randomizeImages() {
spreadsheetId = "1u3XwgQ5ga36KX9j2yKkSuyUlUJo7lTdAsmj2JJ4Yq08";
var ss = SpreadsheetApp.openById(spreadsheetId);
SpreadsheetApp.setActiveSpreadsheet(ss);
var uploadSheetName = "HIT Upload";
SpreadsheetApp.setActiveSheet(ss.getSheetByName(uploadSheetName));
var sheet = ss.getActiveSheet();
var sheetData = sheet.getDataRange().getValues();