Skip to content

Instantly share code, notes, and snippets.

View goldbattle's full-sized avatar

Patrick Geneva goldbattle

View GitHub Profile
@goldbattle
goldbattle / install go.ps
Created March 7, 2016 03:17 — forked from dlsniper/install go.ps
Install go
$cwd = $PSScriptRoot+"\"
$gosdk = $cwd+"go"
$zip7 = $cwd+"7z"
$mingw = $cwd+"mingw64"
$gitdir = $cwd+"git"
$gopath = $cwd+"gopath"
# Install Go
if (-Not (Test-Path $gosdk)) {
echo "Installing Go into: "$gosdk
<?xml version="1.0" encoding="ISO-8859-15"?>
<launch>
<param name="imuRate" type="int" value="200" />
<param name="camRate" type="int" value="28" />
<!-- VI- Sensor node -->
<node name="visensor_node" pkg="visensor_node" type="visensor_node" output="screen">
<remap from="/cam0/image_raw" to="/raw/cam0/image_raw" />
<remap from="/cam1/image_raw" to="/raw/cam1/image_raw" />
@goldbattle
goldbattle / ptr_example.cpp
Created October 31, 2017 14:49
Simple example of how pointers work when passing into a function.
#include <cstdio>
/**
* This function has a local reference to a pointer
* Thus the memory address of the pointer is different
* But the value the pointer contains remains the same
*/
void function(double* ptrlocal) {
printf("ptr = %p [function ptr address]\n", &ptrlocal);
void Subscriber::imageCallback(const sensor_msgs::ImageConstPtr& msg,/*
const sensor_msgs::CameraInfoConstPtr& info,*/
unsigned int cameraIndex)
{
//==============================================================================
// Copy the ros image message to cv::Mat.
// Note we force reading it in as a MONO image (we don't handle color images)
cv_bridge::CvImageConstPtr cv_ptr;
try {
cv_ptr = cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::MONO8);
cmake_minimum_required(VERSION 2.8.12)
project(msckf_vio)
add_compile_options(-std=c++11)
# Modify cmake module path if new .cmake files are required
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(catkin REQUIRED COMPONENTS
roscpp
#include <boost/math/distributions/chi_squared.hpp>
/// Chi squared 95th percentile table
std::map<int, double> chi_squared_table;
// Initialize the chi squared test table with confidence level 0.95
// https://github.com/KumarRobotics/msckf_vio/blob/050c50defa5a7fd9a04c1eed5687b405f02919b5/src/msckf_vio.cpp#L215-L221
for (int i = 1; i < 100; ++i) {
boost::math::chi_squared chi_squared_dist(i);
#
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019 Vladimír Vondruš <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@goldbattle
goldbattle / updatekalibr2opencv4.sh
Created July 8, 2020 05:23
Script to update Kalibr calibration toolbox to use opencv 4 (allows compiling on ubuntu 18.04).
#!/bin/sh
# update from old OPENCV to the newest OPENCV 3/4
# https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/912#issue-377202823
# place this file in your /kalibr/ directory and run it
# -> you will still need to comment out cvStartWindowThread(); function calls
# -> aslamcv_helper.hpp needs to be corrected for the pointer logic
# -> cv::Ptr<cv::Mat> _pts(new cv::Mat(1, N * N, CV_32FC2));
@goldbattle
goldbattle / pointgrey_bkfy.launch
Created September 12, 2020 03:39
Example launch with low shutter time for pointgrey.
<launch>
<!-- Determine this using rosrun pointgrey_camera_driver list_cameras. -->
<!-- If not specified, defaults to first camera found. -->
<arg name="camera_name" default="bkfy" />
<arg name="camera_serial" default="17371919" />
<arg name="calibrated" default="0" />
<arg name="framerate" default="20" />
<arg name="shutterspeed" default="0.005" />
<group ns="$(arg camera_name)">
@goldbattle
goldbattle / Eigen Cheat sheet
Created September 28, 2020 19:59 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.