This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
// Magically converts any representation of a point in 3D | |
// (type with x, y and z) to another one. Works with: | |
// | |
// - pcl::PointXYZ, pcl::PointXYZI, pcl::PointXYZRGB, etc | |
// - Eigen::Vector3d, Eigen::Vector3f | |
// - custom type with x,y,z fields. | |
// - arrays or vectors with 3 elements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <pcl_conversions/pcl_conversions.h> | |
namespace pcl_df | |
{ | |
// Usage: substitute pcl::fromROSMsg with pcl_df::fromROSMsg in your code and you have done. | |
// You should experience a considerable speedup. | |
template<typename T> | |
void fromROSMsg(const sensor_msgs::PointCloud2 &cloud, pcl::PointCloud<T> &pcl_cloud) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @brief Super simple, unmutable, string_view with | |
* small string optimization. | |
* If the string is 15 bytes or less, it is copied, otherwise, | |
* StringRef stores a not-owning reference. | |
*/ | |
class StringRef | |
{ | |
private: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SizeStream{ | |
unsigned size; | |
SizeStream(): size(0) {} | |
template <typename T> | |
typename std::enable_if<std::is_arithmetic<T>::value, SizeStream&>::type | |
operator <<(T& op) | |
{ | |
size += sizeof(op); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <QJSEngine> | |
#include "sol.hpp" //https://github.com/ThePhD/sol2 | |
#include <benchmark/benchmark.h> | |
static void QmlFunction(benchmark::State& state) { | |
QJSEngine js; | |
js.evaluate("function calc(time, value){ return value*2 }"); | |
QJSValue func = js.evaluate("calc"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <benchmark/benchmark.h> | |
#include <pcl/common/centroid.h> | |
#include <pcl/common/common.h> | |
#include <pcl/filters/conditional_removal.h> | |
#include <pcl/io/pcd_io.h> | |
#include <pcl/pcl_base.h> | |
#include <pcl/point_cloud.h> | |
#include <pcl/point_types.h> | |
using namespace pcl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2013 Adobe | |
Distributed under the Boost Software License, Version 1.0. | |
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
*/ | |
/**************************************************************************************************/ | |
#ifndef STLAB_COPY_ON_WRITE_HPP | |
#define STLAB_COPY_ON_WRITE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> | |
#include <atomic> | |
// The purpose of the this apparently fine application is to make you appreciate thread santizers | |
// https://clang.llvm.org/docs/ThreadSanitizer.html | |
class Foo{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
#include <unordered_map> | |
// https://github.com/martinmoene/string-view-lite | |
#include "string_view.hpp" | |
template <typename Value> | |
class StringMap: public std::unordered_map<std::string, Value> | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <memory> | |
#include <functional> | |
#include <list> | |
/** | |
* Super simple Signal/Slop implementation, AKA "Observable pattern". | |
* The subscriber is active until it goes out of scope or Subscriber::reset() is called. | |
*/ | |
template <typename... CallableArgs> |
NewerOlder