Skip to content

Instantly share code, notes, and snippets.

View Splinter1984's full-sized avatar
:octocat:
SEE YOU SPACE SAMURAI

Andrianov Roman Splinter1984

:octocat:
SEE YOU SPACE SAMURAI
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`
#
// schedule_read is called o start reading
void connection::connect()
{
boost::asio::ip::tcp::resolver resolver(_io);
boost::asio::ip::tcp::resolver::query query(_hostname, std::to_string(_port));
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query);
boost::system::error_code ec;
boost::asio::connect(_socket, iterator, ec);
if (ec)
@ericdouglas
ericdouglas / super-tip.txt
Last active February 25, 2024 10:09
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
@mpapierski
mpapierski / channels.cpp
Created April 26, 2014 12:46
C++ by example - Channels
#include <iostream>
#include <cassert>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
constexpr int NTASK = 50;
int
main()
{
@exallium
exallium / thread.cpp
Created March 5, 2012 03:38
Boost Multithread Example with shared lock
#include <iostream>
#include <boost/thread.hpp>
using namespace std;
using boost::thread;
using boost::mutex;
using boost::shared_lock;
using boost::shared_mutex;
using boost::upgrade_lock;
using boost::upgrade_to_unique_lock;