Skip to content

Instantly share code, notes, and snippets.


Darko Lukić lukicdarkoo

View GitHub Profile
lukicdarkoo /
Last active Sep 2, 2021
Webots VRML conversion script
# Converts rotation and translation VRML fields.
# It takes the clipboard content, applies transforms, and pastes the transformed VRML to the clipboard.
# Dependencies:
# pip3 install clipboard numpy transforms3d
# sudo apt install xclip
# In GNOME, you can run the script as a keyboard shortcut.
lukicdarkoo /
Last active Feb 15, 2022
VNC with NVIDIA acceleration (without display)

Server Configuration

Install VirtualGL and TurboVNC

# Install VirtualGL
sudo apt install ./virtualgl_2.6.5_amd64.deb

# Install TurboVNC
lukicdarkoo / Makefile
Created Apr 15, 2021
Plugin System using `dlopen`
View Makefile
g++ -shared -fPIC MyPlugin.cpp -o
g++ main.cpp -o main -ldl
import gym
import numpy as np
import torch
import torch.nn
from torch.nn.functional import smooth_l1_loss, relu, softmax
class ActorCriticNet(torch.nn.Module):
def __init__(self, n_states=4, n_hidden=128, n_actions=2):
lukicdarkoo / arraycuckoo.c
Created Nov 24, 2020
Python Buffer Protocol Example
View arraycuckoo.c
#include <Python.h>
typedef struct {
PyObject_HEAD char *arr;
int len;
} ArrayCuckoo;
static int ArrayCuckoo_init(ArrayCuckoo *self, PyObject *args, PyObject *kwds) {
self->len = 2;
self->arr = (char *)malloc(self->len * sizeof(char));
View c_cpp_properties.json
"configurations": [
"name": "ROS2 Foxy",
"browse": {
"databaseFilename": "",
"limitSymbolsToIncludedHeaders": true
"includePath": [
lukicdarkoo / egpu.bash
Last active Nov 28, 2020
Computer Vision with NVIDIA eGPU Configuration
View egpu.bash
# This script prepares your machine for computer vision challenges (with NVIDIA).
# Tested with Ubuntu 20.04 LTS and NVIDIA GeForce GTX 1070 (Aorus Gaming Box enclosure).
# Reddit post:
# The script does the following:
# * Installs NVIDIA driver
# * Installs NVIDIA CUDA Toolkit (`nvcc`)
# * Installs NVIDIA CUDA Deep Neural Network library (cuDNN)
# * Installs OpenCV with CUDA support (WIP)
# * Installs TensorFlow with CUDA support
lukicdarkoo / e-puck2.wbt
Last active Sep 6, 2020
Log Webots position
View e-puck2.wbt
#VRML_SIM R2020b utf8
WorldInfo {
info [
"The model of the e-puck 2 robot"
title "e-puck simulation"
coordinateSystem "NUE"
Viewpoint {
orientation 0.04913069345659068 0.9922428678493876 0.11419398479121845 3.8679
Converts LabelMe annotations to annotations compatible with YOLO.
The script does the following:
- cleans (!) the output directory and prepare it for training,
- splits the dataset on validation and training,
- converts all LabelMe annoations (*.json) to YOLO annoations (*.txt) and
- creates YOLO metadata (`.data`, `.names`, `train.txt` and `valid.txt`)
import os
lukicdarkoo /
Last active Aug 29, 2020
UWB Follower
# pip3 install pyserial
import time
import serial
import rclpy
import threading
from rclpy.node import Node
from std_msgs.msg import Int32