How to have a simple debian repository to offer your packages.
You probably have them already installed
- Python (I used 2.7).
- dpkg-scanpackages:
sudo apt-get install dpkg-dev
- gzip:
sudo apt-get install gzip
The instructions are based on this answers.ros.org thread.
You may need the latest pip, follow the official instructions.
Install bloom:
#!/usr/bin/env python | |
"""Example of usage of ipython debugger (ipdb) | |
to interactively debug something in the code with autocomplete and color support. | |
You may need to install: | |
sudo pip install ipdb | |
""" | |
#!/usr/bin/env python | |
import numpy as np | |
import math | |
from tf.transformations import euler_from_quaternion, quaternion_from_euler | |
from geometry_msgs.msg import Point | |
""" | |
Stuff to compute an orientation quaternion | |
from three points in the space (that represent a plane, |
#!/usr/bin/env python | |
import sys | |
import rospy | |
from sensor_msgs.msg import Image | |
from cv_bridge import CvBridge | |
import cv2 | |
""" | |
Node to transform an input Image topic into |
In order to open a Visual Studio Code sometimes we want to do it from the command line. Either because that allows us to just open the current file or folder, or because we would like to script opening some specific resource. This resource may be placed in another machine (e.g. via ssh), or in a docker container (running in the same machine or in another machine).
code <file or folder>
# e.g. code .
#!/usr/bin/env python | |
import itertools | |
import sys | |
import time | |
import rospy | |
import rosbag | |
import message_filters | |
""" | |
Example using a message_filters filter (ApproximateTimeSynchronizer) iterating |
You must use the magic method %save
:
In [1]: %save?
Type: Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace: IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
From this stack overflow question I got this great snippet.
# Threaded function snippet
def threaded(fn):
"""To use as decorator to make a function call threaded.
Needs import
from threading import Thread"""
#!/usr/bin/env python | |
import time | |
import pprint | |
import openvr | |
""" | |
Get the HTC Vive controllers keypresses and print them to screen. |