Skip to content

Instantly share code, notes, and snippets.

View mlomb's full-sized avatar

Martín Lombardo mlomb

View GitHub Profile
  • Renamed 'Sensors' to 'Devices', to better reflect the abstraction (devices may have multiple sensors, ex: camera & IMU). Right now we are assuming a 1:1 relationship, but we want to future-proof.
  • Extracted the state machine of the sensors (now devices) into a new abstraction Lifecycle so it can be also shared with modules like recording, calibration, teleop.
  • Changed WebSocket communication to send messages to specific modules (by ID). This enables multiple instances of the same module (ex teleoperation)
  • Now leader-follower teleoperation is a module on itself: LeaderFollowerTeleop. It must be instantiated via config file (see config_sample.yaml)
  • Now app state is handled per module to reduce CPU usage.
  • Simplified Makefile for development (now make front and make back)
  • Reorganized the backend folder structure: now all modules live inside the modules/ folder, all the devices inside devices/ folder. Renamed short-names to be more explicit system_info.cpp -> system_info_module.cpp.
@mlomb
mlomb / slides.html
Created September 21, 2023 03:58
Slides template (reveal.js)
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Slides</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/reveal.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/theme/white.css">
@mlomb
mlomb / index.html
Last active February 20, 2022 22:23
Boilerplate for canvas with zoom and panning with minimal code
<html>
<head>
<title>Visualizer boilerplate</title>
</head>
<body>
<style>
body {
background-color: #303030;
margin: 0;
padding: 0;
@mlomb
mlomb / halite2-leaderboard.html
Last active January 24, 2018 02:38
Haliite 2 Leaderboard live to prevent breaking F5's keys
<html>
<head>
<link rel="shortcut icon" type="image/png" href="https://halite.io/favicon.ico"/>
<title>Halite II Live Leaderboard</title>
<style>
@import url('https://fonts.googleapis.com/css?family=Teko');
* {
outline: none;
margin: 0px;
@mlomb
mlomb / ChangePixelColor.php
Last active March 20, 2017 03:40
Takes a grayscale image and tints it with a hex color.
<?php
$image = imagecreatetruecolor(32, 64);
$width = imagesx($image);
$height = imagesy($image);
imagealphablending($image, true);
imagecolortransparent($image, imagecolorallocate($image, 0, 0, 0)); // Make transparent
function hex2rgb($hex) { // http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/
$hex = str_replace("#", "", $hex);
@mlomb
mlomb / DB.php
Last active March 20, 2017 03:17
DB class for PHP
<?php
/*
* No database selected
* Usage:
$query = "SELECT 'testrow' FROM 'database_name'.'table'";
$result = DB::getInstance()->query($query);