Skip to content

Instantly share code, notes, and snippets.

@najlepsiwebdesigner
najlepsiwebdesigner / tx2-device-tree-notes.md
Last active July 8, 2024 23:07
This file documents my efforts to implement linux device tree modifications required to enable USB on custom carrier board

DTB file to edit

this is the correct file In many tutorials elinux,devtalk devtalk on the internet, this file is modified: tegra186-quill-p3310-1000-c03-00-base.dtb

Current official documentation mentions file: tegra186-quill-power-tree-p3310-1000-a00-00.dtb

check currently used configuration from tx2:

@najlepsiwebdesigner
najlepsiwebdesigner / pcl2octomap.cpp
Created May 30, 2019 09:32
This converts pcl pointcloud to octomap instance
octomap::OcTree pcl2octomap(const pcl::PointCloud<pcl::PointXYZRGB>::Ptr input_cloud, double resolution = 5) {
// create pcl octree - ultra fast
pcl::octree::OctreePointCloudVoxelCentroid<pcl::PointXYZRGB> octree(resolution);
octree.setInputCloud(input_cloud);
octree.addPointsFromInputCloud();
std::vector< pcl::PointXYZRGB, Eigen::aligned_allocator<pcl::PointXYZRGB> > voxel_centers;
octree.getOccupiedVoxelCenters(voxel_centers);
// create octomap instance from pcl octree
OcTree final_octree(resolution);
@najlepsiwebdesigner
najlepsiwebdesigner / file2stdstring.cpp
Created June 19, 2017 20:46
Load whole file to std::string C++
std::ifstream t("test.txt");
std::string str;
t.seekg(0, std::ios::end);
str.reserve(t.tellg());
t.seekg(0, std::ios::beg);
str.assign((std::istreambuf_iterator<char>(t)),
std::istreambuf_iterator<char>());
#define CERES_FOUND true
#include <opencv2/sfm.hpp>
#include <opencv2/viz.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <pcl/io/pcd_io.h>
@najlepsiwebdesigner
najlepsiwebdesigner / simple-curl.php
Created January 13, 2017 18:58 — forked from james2doyle/simple-curl.php
a simple PHP curl function to get the content type
function simple_curl($url)
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
$content = curl_exec ($ch);
@najlepsiwebdesigner
najlepsiwebdesigner / wp-bootstrap-gallery.php
Created December 30, 2016 09:56
make wordpress gallery responsive with bootstrap grid
#include <boost/thread.hpp>
#include <iostream>
using namespace std;
void ThreadFunction()
{
int counter = 0;
for(;;)
@najlepsiwebdesigner
najlepsiwebdesigner / color.cpp
Created May 19, 2016 12:52
map color to custom range C++
typedef struct {
double r,g,b;
} COLOUR;
COLOUR GetColour(double v,double vmin,double vmax)
{
COLOUR c = {1.0,1.0,1.0}; // white
double dv;
if (v < vmin)
@najlepsiwebdesigner
najlepsiwebdesigner / gist:f00af2b2dfbca6494d0a
Last active March 23, 2016 10:34
Foundation datepicker - no inputs
<table class="table">
<thead>
<tr>
<th>Start date&nbsp;
<a href="#" class="button tiny" id="dp4" data-date-format="yyyy-mm-dd" data-date="2012-02-20">Change</a>
</th>
<th>End date&nbsp;
<a href="#" class="button tiny" id="dp5" data-date-format="yyyy-mm-dd" data-date="2012-02-25">Change</a>
</th>
</tr>