Skip to content

Instantly share code, notes, and snippets.

View ynrng's full-sized avatar

ynrng

  • University of Birmingham
  • Shanghai, China
View GitHub Profile
@salmagro
salmagro / euler_from_quaternion.py
Created January 11, 2021 20:13
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
@pantor
pantor / nvidia-driver-realtime.sh
Last active June 3, 2024 12:27
Installing NVIDIA drivers on a realtime Linux (PREEMPT-RT)
# Tested on Ubuntu 16.04 and X11, 2019
# 1. Download NVIDIA driver as a .run file
# 2. Stop X-Server
sudo service lightdm stop
# 3. Blacklist Nouveau driver
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
@NikhilManapure
NikhilManapure / Gif.swift
Last active October 29, 2023 07:31
Create Gif from array of UIImages in Swift 3
import Foundation
import UIKit
import ImageIO
import MobileCoreServices
extension UIImage {
static func animatedGif(from images: [UIImage]) {
let fileProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [kCGImagePropertyGIFLoopCount as String: 0]] as CFDictionary
let frameProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [(kCGImagePropertyGIFDelayTime as String): 1.0]] as CFDictionary
@prucha
prucha / UnityMeshCreator.cs
Last active March 31, 2024 15:45
Unity: Creating a Mesh in code
using UnityEngine;
using System.Collections;
// This Unity script demonstrates how to create a Mesh (in this case a Cube) purely through code.
// Simply, create a new Scene, add this script to the Main Camera, and run.
public class UnityMeshCreator : MonoBehaviour {
GameObject _cube;
VGG_ILSVRC_19_layers_train_val.prototxt
name: "VGG_ILSVRC_19_layers"
layers {
name: "data"
type: DATA
include {
phase: TRAIN
}
transform_param {
crop_size: 224
@marc-hanheide
marc-hanheide / robot-overlord.sh
Last active October 17, 2022 16:25
robot-overlord
export ROS_HOSTNAME=`grep \`ifconfig | grep -A1 ppp | grep inet | cut -f2 -d:| cut -f1 -d" "\` /etc/hosts | tr -s " " | cut -f2 -d " "`
echo "ROS_HOSTNAME set to $ROS_HOSTNAME" >&2
export ROS_MASTER_URI=http://linda:11311/
echo "ROS_MASTER_URI set to $ROS_MASTER_URI" >&2