Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import rospy
from std_msgs.msg import String, Empty
from geometry_msgs.msg import PoseStamped
rospy.init_node("moveit_visualization_sample")
# publisher to change the arm group
@garaemon
garaemon / in1b.txt
Created October 13, 2022 22:39
IN1B error
[ERROR] [1665694767.726928] [/station_task:rosout]: Large diff detected 0.09167943382746951 > 0.0873: arm_link1_roll_j: -0.038
arm_link2_yaw_j: 0.024
arm_link3_roll_j: 0.013
arm_link4_yaw_j: 0.037
arm_link5_roll_j: -0.016
arm_link6_yaw_j: -0.068
arm_link7_roll_j: 0.003
function ssh-with-copy-id() {
ssh -o "PasswordAuthentication=no" $@
if [ $? != "0" ]; then
echo "Failed to ssh w/o password. Copy id_rsa.pub to the machine."
ssh-copy-id $@
ssh -o "PasswordAuthentication=no" $@
fi
}
@garaemon
garaemon / topics_to_ssv.py
Created February 17, 2011 12:24
a script to output the values of ros topics into a text file
#!/usr/bin/env python
import roslib
roslib.load_manifest("sensor_msgs")
roslib.load_manifest("message_filters")
roslib.load_manifest("rxtools")
import rospy
import rxtools
import rxtools.rosplot
import sys
@garaemon
garaemon / karabinar_slack_code.json
Last active February 14, 2021 01:49
Use command+e to create code region
{
"description": "Remap Command+e to Command+Shift+c in slack",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.tinyspeck\\.slackmacgap$"
],
"type": "frontmost_application_if"
@garaemon
garaemon / settings.json
Created April 25, 2020 10:22
C++ settings for customize-indentation-rules extension
"customizeIndentationRules.rules": [
{
"language": "cpp",
"increaseIndentationPattern": "^.*\\{[^}\"\\']*$|^.*\\([^\\)\"\\']*$|^\\s*(public|private|protected):\\s*$|^\\s*@(public|private|protected)\\s*$|^\\s*\\{\\}$",
"decreaseIndentationPattern": "^\\s*(\\s*/[*].*[*]/\\s*)*\\}|^\\s*(\\s*/[*].*[*]/\\s*)*\\)|^\\s*(public|private|protected):\\s*$|^\\s*@(public|private|protected)\\s*$"
}
]
(use-package gist :ensure t
:bind
(("C-c C-g" . gist-region-or-buffer))
)
(defun ros-catkin-make (dir)
"Run catkin_make command in DIR."
(interactive (list default-directory))
;; clear compilation buffer first not to occupy memory space.
(if (get-buffer "*catkin_make*")
(kill-buffer "*catkin_make*"))
(let* ((default-directory dir)
(compilation-buffer-name-function (lambda (major-mode-name) "*catkin_make*")))
(compile "catkin bt --no-status"))
(switch-to-buffer-other-window (get-buffer-create "*catkin_make*"))
@garaemon
garaemon / emacs-gc.el
Last active August 3, 2019 06:00
emacsのGCのしきい値を増やし, 入力がないときにGCを走らせる
;; Increase threshold to fire garbage collection
(setq gc-cons-threshold 1073741824)
(setq garbage-collection-messages t)
;; Run GC every 60 seconds if emacs is idle.
(run-with-idle-timer 60.0 t #'garbage-collect)
@garaemon
garaemon / wstool-chekcout-default.sh
Created March 8, 2019 01:40
Checkout default branch for all the repositories under catkin workspace
#!/bin/bash
wstool foreach "bash -c 'git symbolic-ref refs/remotes/origin/HEAD | sed s@^refs/remotes/origin/@@ | xargs git checkout'"