Skip to content

Instantly share code, notes, and snippets.

View michalpelka's full-sized avatar

Michał Pełka michalpelka

View GitHub Profile
```
#usda 1.0
(
defaultPrim = "root"
doc = "Blender v4.4.3"
metersPerUnit = 1
upAxis = "X"
)
def Xform "root" (
#usda 1.0
(
defaultPrim = "root"
doc = "Blender v4.4.3"
metersPerUnit = 1
upAxis = "Z"
)
def Xform "root" (
customData = {
@michalpelka
michalpelka / CMakeLists.txt
Created April 23, 2025 16:14
Minimal Drake C++ example
cmake_minimum_required(VERSION 3.26)
project(drake_project)
# N.B. This is a temporary flag. It only really applies to Linux, as Mac
# does not need X11.
option(RUN_X11_TESTS "Run tests that require X11" OFF)
include(CTest)
@michalpelka
michalpelka / CMakeLists.txt
Last active April 28, 2025 12:42
Minimal MuJoCo C++ example
cmake_minimum_required(VERSION 3.26)
project(mujco_test_app)
set(CMAKE_CXX_STANDARD 17)
set (MUJOCO_INSTALL_PATH /home/michalpelka/physics/mujoco_install/lib/cmake/)
find_package(mujoco REQUIRED PATHS ${MUJOCO_INSTALL_PATH} NO_DEFAULT_PATH)
find_package(glfw3 REQUIRED)

Command

fio --name=write_test --filename=/media/usb/foo --size=1G --time_based --runtime=30 --rw=write --direct=1 --bs=4M --iodepth=1 --numjobs=1

Results

Device Technology FS Write (MB/s) RPI5 Write (MB/s) x86
Platinet PMFPPD256 USB 3.2 SSD FAT32 309 409
from pymodbus.client import ModbusTcpClient
import struct
import os
# Define device connection
client = ModbusTcpClient('127.0.0.1', port=502) # Change IP and port as needed
# Connect to the device
while client.connect():
num_registers = 12
@michalpelka
michalpelka / CMakeLists.txt
Created November 22, 2024 13:50
PL2000ToWGS
cmake_minimum_required(VERSION 3.10)
project(WGS)
add_executable(main main.cpp wgs84_do_puwg92.cc)
@michalpelka
michalpelka / CMakeLists.txt
Created November 18, 2024 17:19
Ceres SLAM example with standalone cmake
cmake_minimum_required(VERSION 3.10)
project(HelloCeres)
# Find Ceres.
find_package(Ceres REQUIRED)
# Add executable.
add_executable(hello_ceres hello_ceres.cpp)
# Link Ceres to the target.
import os
import rosbag2_py
import numpy as np
import struct
from sensor_msgs.msg import PointCloud2
from sensor_msgs_py import point_cloud2
from rclpy.serialization import deserialize_message
def read_bag_convert_to_csv(bag_file, topic, output_csv):
# Open ROS 2 bag
@michalpelka
michalpelka / Test_GPIO_FOR_Raspberry.md
Last active September 29, 2024 09:18
Nice tools to detect GPIOs in Rapsbery pi

Install libs:

sudo apt-get install python3-rpi.gpio

Then run:

python3 test_gpio_output.py
python3 test_gpio_input.py
``