Skip to content

Instantly share code, notes, and snippets.

View wongkaiweng's full-sized avatar

Catherine Wong wongkaiweng

View GitHub Profile
@wongkaiweng
wongkaiweng / queue.hpp
Created November 26, 2022 19:00 — forked from Kuxe/queue.hpp
C++ implementation of a general semaphore and a thread-safe circular queue. I recommend refitting the queue class with the standard semaphore available in <semaphore> if you can use C++20.
#ifndef QUEUE_HPP
#define QUEUE_HPP
#include <cstdio>
#include "semaphore.hpp"
/** A thread-safe queue which supports one read-thread and one write-thread
manipulating the queue concurrently. In other words, the thread-safe queue can
be used in the consumer-producer problem with one consumer and one producer. **/
template<typename T>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <pthread.h>
#include <math.h>
#include <ethercattype.h>
#include <nicdrv.h>
#include <ethercatbase.h>
@wongkaiweng
wongkaiweng / computeRigidTransformUsingSVD.cpp
Created October 13, 2018 04:43 — forked from JiaxiangZheng/computeRigidTransformUsingSVD.cpp
compute the rigid transformation using SVD with library [Eigen](http://eigen.tuxfamily.org/), usally useful in ICP registration or related works.
//using Eigen's SVD to fastly compute the rigid transformation between two point clouds.
#include <iostream>
#include <ctime>
#include <Eigen/SVD>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <Eigen/Geometry>
using namespace Eigen;