Skip to content

Instantly share code, notes, and snippets.

View AtsushiSakai's full-sized avatar
:octocat:

Atsushi Sakai AtsushiSakai

:octocat:
View GitHub Profile
@AtsushiSakai
AtsushiSakai / MartinGardnerSolver.py
Last active December 21, 2015 01:48
マーティン・ガードナーの最難問を解くPython Script
#coding:utf-8
'''
マーティン・ガードナーの最難問を解くPython Script
解けるかな? 史上最難問10題 : ギズモード・ジャパン http://www.gizmodo.jp/2013/08/_so_you_th.html?utm_source=rss20&utm_medium=rss
ある数の粘度は、すべての桁を掛けて出る答えが1桁になるまでにかかる積算の回数で表す。
それぞれの桁の数を掛け算して出るのが2番目の数で、そのまた全桁の数を掛けて出るのが3番目の数…こうして1桁の数が出るまでやり、
出るまでに重ねた掛け算の回数を数えるのだ。
例えば、77は粘度4だ。なぜなら1桁になるまで4回掛け算しなきゃならないからね(77-49-36-18-8)。
@AtsushiSakai
AtsushiSakai / BayesianFilter1D.m
Last active December 20, 2015 20:29
一次元の変数のガウス分布に基づくベイズ推定のサンプルプログラム
% -------------------------------------------------------------------------
%
% File : BayesianFilter1D.m
%
% Discription : 1 dimentioanl Bayesian Filter Sample Program
%
% Environment : Octave (Matlab)
%
% Author : Atsushi Sakai
%
@AtsushiSakai
AtsushiSakai / EigenMatLib.h
Last active December 18, 2015 04:48
EigenMatLib.h : C++行列演算ライブラリEigenを使った,MATLABの便利関数を模倣したヘッダライブラリ.
//-------------------------------------------------------------------------
//
// File : EigenMatLib.m
//
// Discription : Eigen Library inspired by Matlab functions.
//
// Environment : C++
//
// Author : Atsushi Sakai
//
@AtsushiSakai
AtsushiSakai / ExtendedKalmanFilterLocalization.m
Last active December 16, 2015 04:28
移動ロボットにおける拡張カルマンフィルタを使用した自己位置推定のサンプルプログラム
% -------------------------------------------------------------------------
%
% File : ExtendedKalmanFilterLocalization.m
%
% Discription : Mobible robot localization sample code with
% Extended Kalman Filter (EKF)
%
% Environment : Matlab
%
% Author : Atsushi Sakai
@AtsushiSakai
AtsushiSakai / tf_listener_sample.cpp
Created March 23, 2013 23:49
座標変換ライブラリtfのlistenerサンプルコード
#include "tf/transform_listener.h"
tf::TransformListener tflistener;
//それぞれの座標系におけるレーザの点群のデータ変数
sensor_msgs::PointCloud laserPointsRobot;
sensor_msgs::PointCloud laserPointsGlobal;
//robot座標系におけるレーザ点群の情報の取得
laserPointsRobot=getLaserPoints();
@AtsushiSakai
AtsushiSakai / tf_broadcaster_sample.cpp
Created March 23, 2013 23:47
座標変換ライブラリtfのBroadcast サンプルコード
#include "tf/transform_broadcaster.h"
//TF Broadcasterの実体化
tf::TransformBroadcaster glabal_robot_broadcaster;
//Robot位置と姿勢(x,y,yaw)の取得
double x=GetRobotPositionX();
double y=GetRobotPositionY();
double yaw=GetRobotPositionYaw();
@AtsushiSakai
AtsushiSakai / GoldenSectionSample.m
Last active December 15, 2015 04:49
線形探索アルゴリズムの代表ロジックである黄金分割法のMATLABサンプル
% ------------------------------------------------------------------------
% Sample file of Golden section method for linear search
%
% file : GoldenSectionSample.m
%
% Latest Update: 2013/03/20
%
% Author : A.Sakai
%
% ----------------------------------------------------------------------------------
@AtsushiSakai
AtsushiSakai / Topics2CSV.py
Last active August 29, 2015 14:09
Topics2CSV
#!/usr/bin/env python
import rospy
import sys
import socket
import rosgraph
import roslib.message
def msgevalgen(pattern):
"""
Generates a function that returns the relevant field (aka 'subtopic') of a Message object
@AtsushiSakai
AtsushiSakai / AStarSamle.m
Last active August 29, 2015 14:00
A*による最短経路探索MATLABプログラム
function [] = AStarSample()
%AStarSample() A*法による最短経路探索プログラム
%
% Author: Atsushi Sakai
%
% Copyright (c) 2014, Atsushi Sakai
% All rights reserved.
% License : Modified BSD Software License Agreement
clear all;
close all;
@AtsushiSakai
AtsushiSakai / DijkstraSample.m
Last active August 29, 2015 14:00
ダイクストラ法による最短経路探索プログラム
function [] = DijkstraSample()
%DijkstraSample() ダイクストラ法による最短経路探索プログラム
%
% Author: Atsushi Sakai
%
% Copyright (c) 2014, Atsushi Sakai
% All rights reserved.
% License : Modified BSD Software License Agreement
clear all;