Skip to content

Instantly share code, notes, and snippets.

@driftregion
driftregion / flask_with_websocket_server.py
Created August 6, 2021 11:52
Flask app that pushes updates to the browser with a websocket
#!/usr/bin/env python3
import threading
from flask import Flask
from websocket_server import WebsocketServer
import logging
import time
app = Flask(__name__)
@driftregion
driftregion / service_from_service.py
Created May 19, 2020 09:39
Calling a ROS2 service from the callback of another service
import time
from threading import Event
from example_interfaces.srv import AddTwoInts
import rclpy
from rclpy.node import Node
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import MultiThreadedExecutor, SingleThreadedExecutor
@driftregion
driftregion / udp-XRCE-DDS-dissector.lua
Last active July 27, 2021 12:44
rudimentary Wireshark plugin for XRCE-DDS
-- place in ~/.config/wireshark/plugins/
local p_xrce_dds = Proto("xrce-dds", "XRCE-DDS");
local p_xrce_dds_header = Proto("xrce-dds-header", "Header");
local p_xrce_dds_submessage = Proto("xrce-dds-submessage", "Submessage");
local f_sessionId = ProtoField.uint8("xrce-dds.sessionId", "sessionId", base.HEX)
local f_streamId = ProtoField.uint8("xrce-dds.streamId", "streamId", base.HEX)
local f_sequenceNr = ProtoField.uint16("xrce-dds.sequenceNr", "sequenceNr", base.DEC)
local f_clientKey = ProtoField.uint32("xrce-dds.clientKey", "clientKey", base.HEX)