Skip to content

Instantly share code, notes, and snippets.

View acolomb's full-sized avatar

André Colomb acolomb

  • Stuttgart, Germany
View GitHub Profile
@acolomb
acolomb / comm_cycle.py
Created January 15, 2022 21:49
Synchronized CANopen communication cycle for multiple remotes with deterministic, drift-free timing
import time
import sched
import logging
import threading
import functools
import math
logger = logging.getLogger(__name__)
@acolomb
acolomb / usb2can-vs-canal.diff
Created February 19, 2019 21:15
python-can: Difference between usb2can and suggested canal backend
diff -u usb2can/canal_interface.py canal/canal_interface.py
--- usb2can/canal_interface.py 2019-02-19 21:47:24.224270220 +0100
+++ canal/canal_interface.py 2019-02-19 21:53:05.516830236 +0100
@@ -1,30 +1,22 @@
+#!/usr/bin/env python
# coding: utf-8
"""
-This interface is for windows only, otherwise use socketCAN.
"""
@acolomb
acolomb / curtis_nodes.py
Created November 22, 2018 08:46
Wrapper class for Curtis' motor controllers as python-canopen nodes.
#! python3
import canopen
from canopen.objectdictionary import datatypes
def curtis_1232e_dict():
"""CAN object dictionary template for the Curtis 1232E motor controller"""
od = canopen.objectdictionary.import_od('../od/Curtis_1232E.eds')