Skip to content

Instantly share code, notes, and snippets.

View safijari's full-sized avatar

Jari safijari

View GitHub Profile
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
/*
* Copyright (C) 2012-2014 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@safijari
safijari / realsense_cloud_voxel_filtering.cpp
Last active December 21, 2023 10:10
The code I used to further denoise the R200 point cloud derived from the filtered cloud(see here https://gist.github.com/safijari/fca7fa75649dbaba4b0be54f5dd742ec). Note that this will need at least PCL 1.7.2 (for Ubuntu, it's in the official PPA)
/*
Purpose of node: subscribe to a point cloud, use a VoxelGrid filter on it with a setting that
clobbers voxels with fewer than a threshold of points.
*/
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <iostream>
#include <pcl/filters/voxel_grid.h>
@safijari
safijari / depth_image_filter_ros.py
Created August 2, 2016 17:20
The code I used to apply a median filter to the Intel R200 camera's depth image coming from ROS. Note that you will need to remap topics and that once the filtering is done, you will need to pass it through a depth_image_proc/point_cloud_xyz node to get a point cloud (more info here http://wiki.ros.org/depth_image_proc#depth_image_proc.2BAC8-poi…
#!/usr/bin/env python
"""
Purpose of the file: subscribe to a topic called /image_raw of type sensor_msgs/Image
Apply filter to the resulting image
"""
from __future__ import print_function
import cv2
import numpy as np
import rospy
from sensor_msgs.msg import Image