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
#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)。 |
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
% ------------------------------------------------------------------------- | |
% | |
% File : BayesianFilter1D.m | |
% | |
% Discription : 1 dimentioanl Bayesian Filter Sample Program | |
% | |
% Environment : Octave (Matlab) | |
% | |
% Author : Atsushi Sakai | |
% |
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
//------------------------------------------------------------------------- | |
// | |
// File : EigenMatLib.m | |
// | |
// Discription : Eigen Library inspired by Matlab functions. | |
// | |
// Environment : C++ | |
// | |
// Author : Atsushi Sakai | |
// |
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
% ------------------------------------------------------------------------- | |
% | |
% File : ExtendedKalmanFilterLocalization.m | |
% | |
% Discription : Mobible robot localization sample code with | |
% Extended Kalman Filter (EKF) | |
% | |
% Environment : Matlab | |
% | |
% Author : Atsushi Sakai |
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 "tf/transform_listener.h" | |
tf::TransformListener tflistener; | |
//それぞれの座標系におけるレーザの点群のデータ変数 | |
sensor_msgs::PointCloud laserPointsRobot; | |
sensor_msgs::PointCloud laserPointsGlobal; | |
//robot座標系におけるレーザ点群の情報の取得 | |
laserPointsRobot=getLaserPoints(); |
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 "tf/transform_broadcaster.h" | |
//TF Broadcasterの実体化 | |
tf::TransformBroadcaster glabal_robot_broadcaster; | |
//Robot位置と姿勢(x,y,yaw)の取得 | |
double x=GetRobotPositionX(); | |
double y=GetRobotPositionY(); | |
double yaw=GetRobotPositionYaw(); |
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
% ------------------------------------------------------------------------ | |
% Sample file of Golden section method for linear search | |
% | |
% file : GoldenSectionSample.m | |
% | |
% Latest Update: 2013/03/20 | |
% | |
% Author : A.Sakai | |
% | |
% ---------------------------------------------------------------------------------- |
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
#!/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 |
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
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; |
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
function [] = DijkstraSample() | |
%DijkstraSample() ダイクストラ法による最短経路探索プログラム | |
% | |
% Author: Atsushi Sakai | |
% | |
% Copyright (c) 2014, Atsushi Sakai | |
% All rights reserved. | |
% License : Modified BSD Software License Agreement | |
clear all; |