Skip to content

Instantly share code, notes, and snippets.

View jacknlliu's full-sized avatar

Jack Liu jacknlliu

  • State Key Laboratory of Robotics
  • China
View GitHub Profile
@jacknlliu
jacknlliu / DoubleSlider.py
Created April 5, 2019 11:19 — forked from dennis-tra/DoubleSlider.py
PyQt - QSlider for float or double values + tests
from PyQt5.QtWidgets import QSlider
class DoubleSlider(QSlider):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.decimals = 5
self._max_int = 10 ** self.decimals
super().setMinimum(0)
@jacknlliu
jacknlliu / Kollmorgen_RGM_remap.eds
Last active October 3, 2018 17:52
Kollmorgen RGM PDO remapping
; This file contains the CANopen Electronic Data Sheet for
; the KOLLMORGEN RGM C01 amplifier family.
;
; The EDS is a standard CANopen file format used to describe the
; device's object dictionary. It is used as part of the CANopen
; test tool.
[FileInfo]
CreatedBy=Daniel Tian; Kollmorgen Corp.
ModifiedBy=Daniel Tian; Kollmorgen Corp.
@jacknlliu
jacknlliu / Kollmorgen_RGM.eds
Created September 24, 2018 14:22
EDS files for Kollmorgen RGM
; This file contains the CANopen Electronic Data Sheet for
; the KOLLMORGEN RGM C01 amplifier family.
;
; The EDS is a standard CANopen file format used to describe the
; device's object dictionary. It is used as part of the CANopen
; test tool.
[Comments]
lines=0
@jacknlliu
jacknlliu / candump.log
Created September 23, 2018 10:59 — forked from rishabhagarwal880/candump.log
schunk_lwa4p with ros_canopen
Script started on Wed Jul 12 11:53:45 2017
]0;rishabh@robotik-dev-1: ~/host/repositoriesrishabh@container robotik-dev-1:~/host/repositories$ candump can0
can0 000 [2] 82 03
can0 703 [1] 00
can0 603 [8] 2B 17 10 00 64 00 00 00
can0 583 [8] 60 17 10 00 00 00 00 00
can0 703 [1] 7F
can0 603 [8] 40 00 18 01 00 00 00 00
can0 583 [8] 43 00 18 01 83 01 00 00
can0 603 [8] 23 00 18 01 83 01 00 80
@jacknlliu
jacknlliu / posdef.py
Created September 4, 2018 09:44 — forked from fasiha/posdef.py
Python/Numpy port of John D’Errico’s implementation (https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd) of Higham’s 1988 paper (https://doi.org/10.1016/0024-3795(88)90223-6), including a built-in unit test. License: whatever D’Errico’s license, since this is a port of that.
from numpy import linalg as la
def nearestPD(A):
"""Find the nearest positive-definite matrix to input
A Python/Numpy port of John D'Errico's `nearestSPD` MATLAB code [1], which
credits [2].
[1] https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd
@jacknlliu
jacknlliu / bag2csv.py
Created May 4, 2018 02:54 — forked from razekmaiden/bag2csv.py
convert ROS bag to cvs files
'''
This script saves each topic in a bagfile as a csv.
Accepts a filename as an optional argument. Operates on all bagfiles in current directory if no argument provided
Usage1 (for one bag file):
python bag2csv.py filename.bag
Usage 2 (for all bag files in current directory):
python bag2csv.py
@jacknlliu
jacknlliu / clip_min_max.cpp
Last active April 25, 2018 08:55
c++ implement of numpy clip. reference https://stackoverflow.com/a/9324086
#include <math.h>
#include <iostream>
using namespace std;
float clip(float n, float lower, float upper) {
return std::max(lower, std::min(n, upper));
}
int main()
@jacknlliu
jacknlliu / gaussian-processes-1.ipynb
Created January 20, 2018 14:59 — forked from abridgland/gaussian-processes-1.ipynb
A Jupyter notebook to accompany Intro to Gaussian Processes - Part I at http://bridg.land/posts/gaussian-processes-1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jacknlliu
jacknlliu / topics_to_ssv.py
Created November 13, 2017 02:38 — forked from garaemon/topics_to_ssv.py
a script to output the values of ros topics into a text file
#!/usr/bin/env python
import roslib
roslib.load_manifest("sensor_msgs")
roslib.load_manifest("message_filters")
roslib.load_manifest("rxtools")
import rospy
import rxtools
import rxtools.rosplot
import sys
@jacknlliu
jacknlliu / qrcode_generator.py
Last active December 21, 2023 10:33
Python QRCode generator
#!/usr/bin/env python3
#coding:utf-8
# forked from http://www.cnblogs.com/babycool/p/4734819.html
'''
Python QRCode generator
- transform the input string to general QRCode image
- generate QRCode image with logo image