Skip to content

Instantly share code, notes, and snippets.

View michalpelka's full-sized avatar

Michał Pełka michalpelka

View GitHub Profile
@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
``
@michalpelka
michalpelka / ZED_NMEA_LIVOX360
Created April 6, 2024 19:46
ZED-F9P and Mid360 config
{
"type": "CFG-ITEM",
"items": [
{
"value": 9600,
"layer": 0,
"action": "Set",
"valueType": "U4",
"requestId": "1882a918-6321-4b5f-aa26-ac4a1f98fa68",
"key": "0x40520001"
from pathlib import Path
import gpxpy
import gpxpy.gpx
from rosbags.highlevel import AnyReader
import sys
bag = sys.argv[1]
gpx = sys.argv[2]
@michalpelka
michalpelka / sample.cpp
Created January 19, 2024 10:12
O3DE draw coordinate system
#include <Atom/RPI.Public/AuxGeom/AuxGeomFeatureProcessorInterface.h>
#include <Atom/RPI.Public/Scene.h>
void MyComponent::Activate()
{
auto* entityScene = AZ::RPI::Scene::GetSceneForEntityId(GetEntityId());
m_drawQueue = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(entityScene);
AZ::TickBus::Handler::BusConnect();
TwistNotificationBus::Handler::BusConnect(GetEntityId());
#!/usr/bin/env python
# --------------------------------------------------------------------
# Simple sum of squared differences (SSD) stereo-matching using Numpy
# --------------------------------------------------------------------
# Copyright (c) 2016 David Christian
# Licensed under the MIT License
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# Copyright (c) 2021 PickNik, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the

My enviorment

ros2 Humble, ubuntu 22.04

Step by step

Clone:

mkdir -p ~/husky_ws/src
cd ~/husky_ws/src
git clone https://github.com/husky/husky.git
cd husky
@michalpelka
michalpelka / usbmount-headless.md
Last active April 23, 2023 12:52 — forked from zebrajaeger/usbmount-headless.md
usbmount (also ntfs) for Raspberry PI 4b - Raspberry PI OS lite 32 (headless)

usbmount (also ntfs) for Raspberry PI 4b - Raspberry PI OS lite 32 (headless)

1. Install OS

Download and install "Raspberry Pi Imager" from https://www.raspberrypi.org/software/

Choose "Raspberry PI OS Lite 32" Press Ctrl+Shift+X

  • Maybe switch to save always