Skip to content

Instantly share code, notes, and snippets.

View Achllle's full-sized avatar

Achille Verheye Achllle

View GitHub Profile
Achllle /
Created April 26, 2023 17:13
An Async TTL cache with a lock that forces concurrent calls to wait for the first call to complete and use the cached result rather than recompute
import asyncio
import time
import functools
def cache_result(seconds):
Caches result of an async function, depending on its arguments
No support for maxsize, only TTL for now
Achllle / Dockerfile
Last active January 25, 2023 01:59
Building a ROS2 component from source with Docker for development
FROM ubuntu:jammy
ENV DEBIAN_FRONTEND=noninteractive
# apt-get -y install --no-install-recommends software-properties-common \
apt-get update \
&& apt-get -y install --no-install-recommends \
Achllle /
Last active December 4, 2020 21:52
generic ROS topic to service relay node
#!/usr/bin/env python
convert topic with payload to a service. The topic does not have to exist yet for this to run.
rosrun [some_pkg] /input_topic topic_type /service_address srv_type python_expression
rosrun [some_pkg] /my_trigger_topic std_msgs/Empty /trigger_this std_srvs/Empty ''
Achllle /
Last active November 18, 2019 09:22
visualization dual quaternions with RViz
#!/usr/bin/env python
import rospy
import copy
import numpy as np
from interactive_markers.interactive_marker_server import *
from visualization_msgs.msg import *
from dual_quaternions_ros import DualQuaternion
from geometry_msgs.msg import Vector3, Point, Pose