Skip to content

Instantly share code, notes, and snippets.

@bricerebsamen
bricerebsamen / memory_pool.h
Created June 18, 2015 02:00
comparison of memory pool implementations
#ifndef __SEGMENTATION__MEMORY_POOL__H__
#define __SEGMENTATION__MEMORY_POOL__H__
#define NO_POOL 0
#define BOOST_POOL 1
#define CUSTOM_POOL 2
#define USE_POOL NO_POOL
void
RingColors::convertPoints(const sensor_msgs::PointCloud2ConstPtr &inMsg)
{
if (output_.getNumSubscribers() == 0) // no one listening?
return; // do nothing
// allocate an PointXYZRGB message with same time and frame ID as
// input data
sensor_msgs::PointCloud2::Ptr outMsg(new sensor_msgs::PointCloud2());
sensor_msgs::PointCloud2Modifier modifier(*outMsg);
@bricerebsamen
bricerebsamen / rpy_quat.cpp
Created May 6, 2015 23:44
roll pitch yaw from quaternion using KDL
double roll, pitch, yaw;
KDL::Rotation::Quaternion(x, y, z, w).GetRPY(roll, pitch, yaw);
@bricerebsamen
bricerebsamen / rpy_tf2.cpp
Last active August 29, 2015 14:19
roll pitch yaw from tf2 transform using KDL
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_kdl/tf2_kdl.h>
geometry_msgs::TransformStamped trans;
double roll, pitch, yaw;
tf2::transformToKDL(trans).M.GetRPY(roll, pitch, yaw);
#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
#include <vector>
#include <queue>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
@bricerebsamen
bricerebsamen / diamond_display.cpp
Created October 17, 2013 02:11
This allows to use OpenGL code in ROS Rviz. Tested in hydro, might work in groovy. Won't work under fuerte (I also have fuerte code available upon request). I am not sure who originally wrote this... Original code credited to a certain wak1pal... I modified it substantially. Enjoy!
#include <OGRE/OgreNode.h>
#include <OGRE/OgreSceneManager.h>
#include <OGRE/OgreCamera.h>
#include <OGRE/OgreRenderQueueListener.h>
#include <rviz/frame_manager.h>
#include <rviz/helpers/color.h>
#include <rviz/visualization_manager.h>
#include <rviz/properties/color_property.h>
#include <rviz/properties/ros_topic_property.h>