Skip to content

Instantly share code, notes, and snippets.

View reinzor's full-sized avatar
🤖

Rein Appeldoorn reinzor

🤖
View GitHub Profile
@reinzor
reinzor / signaldecode.c
Last active February 17, 2016 07:18
Decode CAN signals
#include <stdint.h>
#include <iostream>
#define MASK32(nbits) ((0xffffffff)>> (32-nbits))
uint32_t extractSignal(const uint8_t* frame, const uint8_t startbit, const uint8_t length, bool is_big_endian)
{
uint8_t startByte = startbit / 8;
uint8_t startbit_in_byte = startbit % 8;
uint8_t end_byte = 0;
@reinzor
reinzor / signaldecode.c
Last active February 26, 2016 21:57 — forked from ebroecker/signaldecode.c
Decode CAN signals
#include <stdint.h> //uint typedefinitions, non-rtw!
#include <iostream>
#define MASK64(nbits) ((0xffffffffffffffff)>> (64-nbits))
inline float toPhysicalValue(uint64_t target, float factor, float offset, bool is_signed)
{
if (is_signed)
return ( (int64_t) target ) * factor + offset;
@reinzor
reinzor / validators.py
Created February 18, 2017 15:10 — forked from jrosebr1/validators.py
Validator for files, checking the size, extension and mimetype for Django.
# @brief
# Performs file upload validation for django. The original version implemented
# by dokterbob had some problems with determining the correct mimetype and
# determining the size of the file uploaded (at least within my Django application
# that is).
# @author dokterbob
# @author jrosebr1
import mimetypes
@reinzor
reinzor / VOClabelcolormap.py
Created July 18, 2017 20:01 — forked from wllhf/VOClabelcolormap.py
Python implementation of the color map function for the PASCAL VOC data set.
"""
Python implementation of the color map function for the PASCAL VOC data set.
Official Matlab version can be found in the PASCAL VOC devkit
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/index.html#devkit
"""
import numpy as np
from skimage.io import imshow
import matplotlib.pyplot as plt
def color_map(N=256, normalized=False):
@reinzor
reinzor / debian_from_ros_pkg.md
Created April 12, 2021 17:12 — forked from awesomebytes/debian_from_ros_pkg.md
How to create a debian from a ROS package