Skip to content

Instantly share code, notes, and snippets.

View guru-florida's full-sized avatar

Colin MacKenzie guru-florida

View GitHub Profile
@guru-florida
guru-florida / dynamic-urdf-publisher.py
Last active April 18, 2024 07:59
Monitor URDF file and dynamically update RViz2
#
# Dynamic URDF Publisher
#
# This script monitors a URDF file and when changed will publish to /robot_description
#
# Requirements:
# Besides the standard Ros2 modules, Install watchdog module for listening
# to filesystem events:
# `pip3 install watchdog`
#
@guru-florida
guru-florida / README.md
Last active March 10, 2021 20:30
Read/Write Memory Barriers for RealTime processing in Ros2

Work in Progress Looking for feedback on the design and code.

Read/Write Realtime Hardware buffers

From what I can tell, there are some issues with using realtime_tools::RealtimeBuffer in our ros2_control hardware interfaces. It seems this RealtimeBuffer is only useful for writing to a realtime based on the use of the new_data_available internal variable. For reading state from the realtime thread we dont have an existing RealtimeBuffer.

The internal implementation of the "swapping double buffer pointers" works for both modes, only the interface (read vs write) to this swapping buffer needs to change. Therefor I

@guru-florida
guru-florida / model-training.py
Created March 7, 2021 05:43
Model Training URDF parameters in Ros2 with Gazebo
#!/usr/bin/env python3
#
# model-training.py
# Use HyperOpt and Gazebo to train parameters of your robot. Perfoms a number
# of episodic simulations and optimizing the inputs to a xacro-enabled urdf file.
#
# Copyright 2020 FlyingEinstein.com
# Author: Colin F. MacKenzie
#
# Features:
@guru-florida
guru-florida / humanoid-daemon
Last active March 1, 2020 18:27
ROS2 Humanoid Control and SystemD
#!/usr/bin/python3
#
# Humanoid Service Control
#
# This python script controls an RGB LED connected to the RPi GPIO in order to display ROS2 robot status. It also
# scans a button which can toggle stand-alone or development mode, or on long-hold shutdown the RPi. This may not
# fit your needs, and you could instead just have it call humanoidctl command above on start, stop, status.
#
@guru-florida
guru-florida / timeline.json
Created October 22, 2019 17:56
Smooth Timeline control in Vega
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 1500,
"height": 50,
"padding": 15,
"signals": [
{
"name": "rangeLimits",
"value": [30, 120]