Skip to content

Instantly share code, notes, and snippets.

View wjwwood's full-sized avatar
🙃

William Woodall wjwwood

🙃
View GitHub Profile
--- #! /usr/bin/env python
+++ (clipboard)
@@ -1,10 +1,34 @@
#! /usr/bin/env python
# coding=utf-8
+# The MIT License (MIT)
+#
+# Copyright (c) 2010, 2011, 2012, 2013, 2014 Ilya Kulakov
+#
void create_subscription(..., std::function<void()> callback);
void create_subscription(..., std::function<void(const T & message)> callback);
create_subscription(..., []() -> void {}); // This is an ambiguous call on Windows.
@wjwwood
wjwwood / gist:a18fbc58dc76c9aa35ae
Created September 19, 2015 02:21
Calculating the LoC for ROS Jade Desktop-Full
william@farl /tmp/jade
% rosinstall_generator desktop_full --deps --tar --rosdistro jade > jade-desktop_full.rosinstall
william@farl /tmp/jade
% wstool init ./src jade-desktop_full.rosinstall
Using initial elements from: jade-desktop_full.rosinstall
Writing /private/tmp/jade/src/.rosinstall
[actionlib] Fetching https://github.com/ros-gbp/actionlib-release/archive/release/jade/actionlib/1.11.4-0.tar.gz (version actionlib-release-release-jade-actionlib-1.11.4-0) to /private/tmp/jade/src/actionlib
[actionlib] Done.
[angles] Fetching https://github.com/ros-gbp/geometry_angles_utils-release/archive/release/jade/angles/1.9.10-0.tar.gz (version geometry_angles_utils-release-release-jade-angles-1.9.10-0) to /private/tmp/jade/src/angles
% sudo -H python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to src/wstool.egg-info/requires.txt
writing src/wstool.egg-info/PKG-INFO
writing top-level names to src/wstool.egg-info/top_level.txt
# - Find python interpreter
# This module finds if Python interpreter is installed and determines where the
# executables are. This code sets the following variables:
#
# PYTHONINTERP_FOUND - Was the Python executable found
# PYTHON_EXECUTABLE - path to the Python interpreter
#
# PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
# PYTHON_VERSION_MAJOR - Python major version found e.g. 2
# PYTHON_VERSION_MINOR - Python minor version found e.g. 5
>>> class A(object):
... def __init__(self):
... self.__foo = 'bar'
... @property
... def foo(self):
... return self.__foo
...
>>> a = A()
>>> a.foo
'bar'
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_lint:
type: git
url: https://github.com/ament/ament_lint.git
version: master
ament/ament_package:
from phant import Phant
from serial import Serial
import time
p = Phant('XGXqQ3maWluV1vn9xLgQ', 'moisture', private_key='REPLACEMEWITHPRIVATEKEY')
s = Serial('COM3')
@wjwwood
wjwwood / cond_wait_for_error.cpp
Created March 14, 2015 00:47
Example which fails to compile on Windows.
#include <chrono>
#include <condition_variable>
#include <mutex>
const std::chrono::seconds operator "" _s(unsigned long long s)
{
return std::chrono::seconds(s);
}
const std::chrono::duration<long double> operator "" _s(long double s)
import os
import subprocess
this_dir = os.path.abspath(os.path.dirname(__file__))
xacro_py_path = os.path.join(this_dir, '..', 'xacro.py')
subprocess.call([xacro_py_path, 'arg1', 'arg2'])