Skip to content

Instantly share code, notes, and snippets.

View chrissunny94's full-sized avatar
🎯
Focusing

Chrissunny94 chrissunny94

🎯
Focusing
View GitHub Profile
# Use NVIDIA CUDA 11.8 base image with Ubuntu 22.04
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
# Set noninteractive mode for apt
ENV DEBIAN_FRONTEND=noninteractive
# Install basic utilities and dependencies
RUN apt update && apt install -y \
curl gnupg2 lsb-release \
git cmake build-essential \
@chrissunny94
chrissunny94 / gist:e5e0f1944b1f16b874f1a7d1fe35c360
Created August 12, 2024 08:35
convert Kazam Video to Windows compatible format
ffmpeg -y -i input_file.mp4 -c:v libx264 -c:a aac -strict experimental -tune fastdecode -pix_fmt yuv420p -b:a 192k -ar 48000 output_file.mp4
@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 / list_input.py
Last active June 17, 2023 04:45
Template for Inputing elements for Hacker rank questions [Please dont hessitate to add a comment , if you find issues .]
```
Input Format
A list of elements. An element of list to be counted.
Sample Input 0
[1,2,2,3,4,5,5,4,3,3,4,3,3,5]
```
@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.

https://stackoverflow.com/questions/59838238/importerror-cannot-import-name-gi-from-partially-initialized-module-gi-mo