Skip to content

Instantly share code, notes, and snippets.

View Zzzonkeed's full-sized avatar

Cristian Carrera Zzzonkeed

  • Santiago, Chile
View GitHub Profile
@Zzzonkeed
Zzzonkeed / qe.c
Created September 9, 2020 20:02 — forked from ast/qe.c
How to read a quadrature encoder in C on the Raspberry Pi GPIO, using the wiringPi library.
//
// qe.c
// hidtest
//
// Created by Albin Stigö on 09/09/2017.
// Copyright © 2017 Albin Stigo. All rights reserved.
//
// License BSD
// https://opensource.org/licenses/BSD-2-Clause
@Zzzonkeed
Zzzonkeed / compare_poses.py
Created November 3, 2022 14:23 — forked from awesomebytes/compare_poses.py
Compare poses to be equal within a tolerance
from geometry_msgs.msg import Pose
def are_poses_equal(p1, p2):
pos1 = p1.position
pos2 = p2.position
if isclose(pos1.x, pos2.x) and isclose(pos1.y, pos2.y) and isclose(pos1.z, pos2.z):
o1 = p1.orientation
o2 = p2.orientation
r1, p1, y1 = euler_from_quaternion([o1.x, o1.y, o1.z, o1.w])
r2, p2, y2 = euler_from_quaternion([o2.x, o2.y, o2.z, o2.w])