Skip to content

Instantly share code, notes, and snippets.

View awesomebytes's full-sized avatar

Sam Pfeiffer awesomebytes

View GitHub Profile
@awesomebytes
awesomebytes / urdf_to_disable_colisions.py
Last active June 17, 2024 18:29
Generate MoveIt! srdf disable collision pairs from adjacent links and links without collision mesh
#!/usr/bin/env python
"""
Given a URDF given by either
1) param server /robot_description
2) as an argument
Generate all the MoveIt! SRDF
disable collision lines between adjacent
links and links without collision mesh.
@awesomebytes
awesomebytes / loop_joint_limits.bash
Created March 30, 2016 10:12
A bash script to send command topic pubs for moving a joint to one limit and the other
#!/bin/bash
# To stop control+C
trap "echo Exited!; exit;" SIGINT SIGTERM
# Loop indefinitely
while true; do
# First go to one limit of arm right 3
echo "Going to limit of arm_right_3_joint -2.3"
rostopic pub /right_arm_controller/command trajectory_msgs/JointTrajectory "header:
#!/bin/env python
"""Paint a black background (for a projector to not project),
over it paint white circles with a red number in them
identifying the order of it.
When hitting RIGHT key you advance apose
if you did it by mistake you can press LEFT to go back.
When you hit the last one the time will stop in green.
@awesomebytes
awesomebytes / reduce_faces.py
Created April 6, 2016 23:23
Executing meshlab from commandline reduce faces of a mesh iteratively
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)
@awesomebytes
awesomebytes / get_pixel_depth.py
Last active June 25, 2023 02:13
From a depth image of a kinect / xtion get the average depth of a pixel area
#! /usr/bin/env python
"""
Created on 11/04/2016
@author: Sam Pfeiffer
Get depth of a pixel or pixel area.
"""
import sys
#! /usr/bin/env python
from copy import deepcopy
import rospy
from geometry_msgs.msg import WrenchStamped
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
class HandByFT(object):
def __init__(self):
self.last_ft_msg = None
@awesomebytes
awesomebytes / box.scene
Created April 26, 2016 10:16
MoveIt! scene file example, remove the commented one to load it (it does not support comments)
box_scene
* box1
1
box
0.1 0.2 0.3
1.0 1.0 1.0
0 0 0 1
0 1 0 1
.
@awesomebytes
awesomebytes / persistent_live_usb_ros.md
Last active March 9, 2019 15:11
Create a persistent live USB for ROS development on any machine

Requisites

How to

After downloading the Ubuntu ISO image, use Unetbootin to write the image to the pendrive. The pendrive must be 8GB+.

Take care on choosing the size of the persistent part you want the pendrive to have, at the field Space used to preserve files across reboots (Ubuntu only):, I'm using a 8GB pendrive so I'm setting 4GB (if there is less space it will take as much as it can anyways).

@awesomebytes
awesomebytes / Install_intel_3165_onubuntu_12.04.md
Last active May 23, 2016 11:27
How to install Wifi card intel 3165 in ubuntu 12.04

Get the module

wget https://www.kernel.org/pub/linux/kernel/projects/backports/2015/11/20/backports-20151120.tar.gz

Uncompress it somewhere and

cd backports-2051120
make defconfig-iwlwifi
make
sudo make install
@awesomebytes
awesomebytes / .bashrc
Last active April 12, 2021 01:23
Example bashrc that adds some colors and useful shortcut commands
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac