Skip to content

Instantly share code, notes, and snippets.

View chrissunny94's full-sized avatar
🎯
Focusing

Chrissunny94 chrissunny94

🎯
Focusing
View GitHub Profile
@chrissunny94
chrissunny94 / euler_from_quaternion.py
Created February 20, 2024 07:39 — forked from salmagro/euler_from_quaternion.py
ROS2 euler to quaternion transformation.
def euler_from_quaternion(quaternion):
"""
Converts quaternion (w in last place) to euler roll, pitch, yaw
quaternion = [x, y, z, w]
Bellow should be replaced when porting for ROS 2 Python tf_conversions is done.
"""
x = quaternion.x
y = quaternion.y
z = quaternion.z
w = quaternion.w
@chrissunny94
chrissunny94 / ros_depth_cloud_filtering_example.cpp
Created September 28, 2023 09:02 — forked from neomanic/ros_depth_cloud_filtering_example.cpp
A demo of how to use the PCL filtering functions in a real-life ROS example.
/*
This is an example of how to use the PCL filtering functions in a real robot situation.
This node will take an input depth cloud, and
- run it through a voxel filter to cut the number of points down (in my case, from ~130,000 down to 20,000)
- with a threshold to remove noise (requires minimum 5 input points per voxel)
- then transform it into the robot footprint frame, i.e. aligned with the floor
- subtract the robot footprint (our depth sensor's FOV includes the robot footprint, which changes dynamically with the load)
- subtract points in the ground plane, with different tolerances for near or far
- ground plane by default z = 0, but
@chrissunny94
chrissunny94 / PCL_smart_pointer.md
Created September 21, 2023 10:45 — forked from PerceptMD/PCL_smart_pointer.md
PCL Smart Pointer
@chrissunny94
chrissunny94 / CMakeLists.txt
Created August 29, 2023 09:25 — forked from kervel/CMakeLists.txt
Small ros2 python using pybind11
# will need to be tweaked for your project
make_minimum_required(VERSION 3.5)
project(test_ros_pb11)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++14
@chrissunny94
chrissunny94 / SynchNTPtoGPS.md
Last active January 20, 2023 12:32 — forked from edro15/SynchNTPtoGPS.md
[How To] Synchronize NTP server to a GPS/PPS source

So, I want to have a GPS Receiver driving a PPS (pulse-per-second) signal to the NTP server for a highly accurate time reference service.

Introduction

There are at least a couple of ways to propagate the PPS signal to the ntpd (NTP daemon) service, plus some variants in each case. However, the GPS device must be seen as a device that sources two different types of data:

  • the absolute date and time, and
  • the 1Hz clock signal (PPS).

The first one provides the complete information (incl. date and time) about when now is, but with poor accuracy because data is sent over the serial port and then encoded using a specific protocol such as NMEA (National Marine Electronics Association). PPS provides instead a very accurate clock but without any reference to absolute time.

@chrissunny94
chrissunny94 / README.md
Created September 30, 2022 05:36 — forked from jpetazzo/README.md
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@chrissunny94
chrissunny94 / orbslam2_ubuntu_mate.md
Created June 27, 2018 12:11 — forked from nickoala/orbslam2_ubuntu_mate.md
Build ORB-SLAM2 on Raspberry Pi 3

Build ORB-SLAM2 on Raspberry Pi 3

Operating system: Ubuntu Mate 16.04

I use Ubuntu Mate instead of the usual Raspbian Jessie mainly because of the gcc version. ORB-SLAM2 requires C++11 support. Raspbian comes with gcc 4.9, which does not handle C++11 by default. That means you have to play around with some compiler flags in ORB-SLAM2's CMakeLists.txt to make it work. In contrast, Ubuntu Mate's gcc 5.4 handles C++11 naturally.

@chrissunny94
chrissunny94 / ros_odometry_publisher_example.py
Created February 5, 2018 06:48 — forked from atotto/ros_odometry_publisher_example.py
Publishing Odometry Information over ROS (python)
#!/usr/bin/env python
import math
from math import sin, cos, pi
import rospy
import tf
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
@chrissunny94
chrissunny94 / README-opencv-3.1-raspberry-pi-installation.md
Created September 22, 2016 03:30 — forked from willprice/README-opencv-3.1-raspberry-pi-installation.md
How to install OpenCV 3.1 on Raspbian Jessie (Lite)

Installing OpenCV 3.1 on Raspbian Jessie

Prerequisites

  • Keep your system up to date:
    • $ sudo apt-get update
    • $ sudo apt-get upgrade
    • $ sudo reboot
  • Make sure you've got an internet connection.
  • Make sure you've got
  • wget