Skip to content

Instantly share code, notes, and snippets.

@peci1
peci1 / path_tracer.sh
Created October 27, 2021 12:07
subt virtual path_tracer launcher script
#!/bin/bash
[ $# -lt 1 ] && echo "Provide path to simulator logs" && exit 1
dir="$1"
[ ! -f "${dir}/state.tlog" ] && echo "The given path is incorrect, it doesn't contain file state.tlog" && exit 1
tracer_conf="$(d="${dir}"; while [ "$d" != "/" ]; do if [ -f "${d}/path_tracer.yml" ]; then echo "${d}/path_tracer.yml"; break; else d="$(dirname "$d")"; fi; done)"
[ -z "${tracer_conf}" ] && echo "path_tracer.yml not found in the given or any parent directory" >&2 && exit 1
@peci1
peci1 / ignition-dome.yaml
Created May 1, 2021 17:23
/etc/ros/rosdep/sources.list.d/ignition-dome.yaml
ignition-dome:
ubuntu: [ignition-dome]
ignition-cmake2:
ubuntu: [libignition-cmake2-dev]
ignition-common3:
ubuntu: [libignition-common3-dev]
ignition-fuel-tools5:
ubuntu: [libignition-fuel-tools5-dev]
ignition-gazebo4:
ubuntu: [libignition-gazebo4-dev]
@peci1
peci1 / Install.md
Last active April 8, 2022 01:03
Install Ubuntu 18.04 on Lenovo T14s AMD with Ryzen 7 PRO 4750U CPU and AMD Renoir GPU

Ubuntu 18.04 on Lenovo T14s

What's the problem?

The Ryzen CPU and Renoir GPU are too new for all kernels supported by Ubuntu 18.04 (5.4 is the latest supported). The notebook will boot with 18.04.5, but a lot of things will not work (sleep, screen brightess, audio, graphics only works in a limited way etc.).

This tutorial shows the steps necessary to be done to successfully run the system with full support for the GPU and other peripherals.

Steps

@peci1
peci1 / subt_cuda.Dockerfile
Last active January 6, 2021 19:33
Dockerfile combining SubT virtual testbed images with CUDA support
FROM osrf/subt-virtual-testbed:cloudsim_bridge_latest
RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | sudo apt-key add - && echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list && echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/nvidia-ml.list && sudo apt-get -yy update
ARG cuda_maj=10
ARG cuda_min=0
ARG cuda=$cuda_maj-$cuda_min
ARG cudnn=7
RUN sudo apt-get install -y --no-install-recommends cuda-cudart-$cuda cuda-compat-$cuda cuda-libraries-$cuda cuda-npp-$cuda cuda-nvtx-$cuda cuda-cublas-$cuda libnccl2="*+cuda$cuda_maj.$cuda_min" libcudnn$cudnn="$cudnn.*+cuda$cuda_maj.$cuda_min" && sudo apt-get clean && sudo apt-mark hold libnccl2 && sudo apt-mark hold libcudnn$cudnn && sudo ln -s cuda-$cuda /usr/local/cuda && echo "/usr/local/nvidia/lib" | sudo tee /etc/ld.so.conf.d/nvidia.con
@peci1
peci1 / path_tracer.sh
Created October 26, 2020 13:59
Launcher for path_tracer subt script that automatically records a video, autoconfigures the top-view camera to view exactly the explored space, zooms out several levels in the end to show the whole world, and repeats the last frames of the video a few times for easier inspection of what the state was in the very end.
#!/bin/bash
[ $# -lt 1 ] && echo "Provide path to simulator logs" && exit 1
dir=$1
[ ! -f "${dir}/state.tlog" ] && echo "The given path is incorrect, it doesn't contain file state.tlog" && exit 1
tracer_conf="${dir}/../../path_tracer.yml"
[ $# -gt 1 ] && tracer_conf="$2"
@peci1
peci1 / ground_truth_publisher.cpp
Created September 26, 2020 14:21
Subt virtual publish ground truth
#include <ignition/transport.hh>
#include <ignition/msgs/pose_v.pb.h>
#include <ros/ros.h>
#include <nav_msgs/Odometry.h>
#include <tf2_ros/transform_broadcaster.h>
#include <tf2_ros/static_transform_broadcaster.h>
class GroundTruthPublisher
{
@peci1
peci1 / Output:
Created July 1, 2020 13:54
Test of behavior when ROS subscribes to a message published using a different allocator
[ INFO]: pub1 a boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > >
[ INFO]: pub2 b boost::shared_ptr<sensor_msgs::PointCloud2_<boost::fast_pool_allocator<void, boost::default_user_allocator_new_delete, std::mutex, 32u, 0u> > >
[ INFO]: sub a boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const>
[ INFO]: Received message a is equal to p
[ INFO]: sub b boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const>
[ INFO]: Received message b is a new instance
[ WARN]: length PC2 with frame b
[ WARN]: write PC2 with frame b
[ WARN]: read PointCloud2 with frame b
@peci1
peci1 / syslog-ng.conf
Created May 28, 2020 01:09
Syslog NG config for Turris Omnia which saves important parts of the logs to NAS. Date is also unified to a single timezone for all messages.
@version:3.19
options {
chain_hostnames(no);
flush_lines(0);
stats_freq(0);
flush_lines(0);
log_msg_size(65536);
};
@peci1
peci1 / FindFilesystem.cmake
Created January 13, 2020 20:18
CMake module for using the most modern of std::filesystem, std::experimental::filesystem and boost::filesystem.
# Distributed under the OSI-approved BSD 3-Clause License.
# Base on https://github.com/vector-of-bool/CMakeCM/blob/master/modules/FindFilesystem.cmake
#[=======================================================================[.rst:
FindFilesystem
##############
This module supports the C++17 standard library's filesystem utilities. Use the
:imp-target:`std::filesystem` imported target to enable support of it.
@peci1
peci1 / clean build output
Last active August 13, 2019 08:24
gazebo build problem
Subprocess > gazebo:make `cd /media/data/gazebo/build/gazebo; catkin build --get-env gazebo | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -`
[gazebo:make] /usr/bin/cmake -H/media/data/gazebo/src/gazebo -B/media/data/gazebo/build/gazebo --check-build-system CMakeFiles/Makefile.cmake 0
[gazebo:make] /usr/bin/cmake -E cmake_progress_start /media/data/gazebo/build/gazebo/CMakeFiles /media/data/gazebo/build/gazebo/CMakeFiles/progress.marks
[gazebo:make] /usr/bin/make -f CMakeFiles/Makefile2 all
[gazebo:make] make[1]: Vstupuje se do adresáře „/media/data/gazebo/build/gazebo“
[gazebo:make] /usr/bin/make -f deps/opende/ou/CMakeFiles/gazebo_opende_ou.dir/build.make deps/opende/ou/CMakeFiles/gazebo_opende_ou.dir/depend
[gazebo:make] /us