ラベル robot platoform の投稿を表示しています。 すべての投稿を表示
ラベル robot platoform の投稿を表示しています。 すべての投稿を表示

2013年1月21日月曜日

Design Philosophy and Concept of my robots

私の4足歩行ロボットのコンセプトモデルです。笑っちゃうでしょ。

”KONG LIVES" このバッチを知っている人は、かなりのKONGマニアだと思います。
Universal Studios Hollywoodで配られたモノです。
その理由は、日本が関係しています。ちょっと悲しい。
普段は、画像認識のテストで使っています。
「自分の仕事を楽にする為に、15万円トマト収穫ロボットを作る!」と決心し、その重要な要素である4足歩行ロボットの開発を決めた後、作ったのがこれです。大事に、飾って、毎日見ています。ロボット開発は、先にデザインを決めました
コンセプトは、「SIMPLE & SMART」、これは私の目指す生き方でもあります。
「ゴテゴテのロボットで御座います。」というのは好きじゃない。
基本は、フレーム形状にして、追加の装置を載せられる様にする。
サンダーバード2号の様に、格納するもよし、フレームのうえに櫓型で載せるのでもよし。作業装置と分けて考えました。
後、全体の形状の比率も試行錯誤しました。用途などを考えて、形状の比率の試行錯誤に結構時間を使いました。もともと設計をしていたので、こだわってしまいました。
ロボットの用途や、載せるものの動き・重さ、搭載し移動する時の重心、使用材料の力学特性などを考え、構造力学の計算もしました。結果的に、搭載する物への要求仕様もつくる事になりました。その結果このロボットの形状比率は、コルビジェの黄金比ではないですが、自分のロボット形状比率として大切にしています。

僕の物創りの経験としては、コンピュータシステムもそうですが、既存機能の寄せ集めの結果として、最終品を考えるのではなく、目的を端的に訴求できるデザインから、それを実現するための機能を考えた方が良いと思います。機能の寄せ集めから最終品を考えると先に設計条件を決めます。それに縛られて後々、つまらない物になります。(作る側の理屈は、顧客を無視し、イノベーションを否定します。)
目的に基づいたデザインを決めると、デザインに合わせて機能も開発しなければならない事も発生します。一見遠回りのようですが、その過程でいろいろな発見があり、本来必要な機能が研ぎすまされ、simpleになり拡張性のある良い物になります。創ると、作るの違いです。

プログラム開発に使っているロボット(2代), ぼろぼろです。木で作っているのは、加工のし易さを優先した為。木材の力学的特性は優れいているので、実機も一部は木材です。実機は4月に公開予定!!
Raspberry Piのメリットは、この様な家の中で開発作業できる小さなロボットを作れる事。
いきなり、実機で開発するより、数段開発生産性が高くなります。
その為にも、構造計算に基づいた形状比率を、
最初に考える事は大切だと、後からつくづく思いました。ラッキーでした。
まだまだプロトタイプは、デザインの様になっていませんが、比率は守っています。

このデザインから、重くて、しかも設置場所の制約を要求する、不細工なノートPCを載せる事は考えませんでした。ロボットのコントローラーは、自分で創るか、産業用のマザーボードを使おうか迷っていました。それでいろいろ探しているうちに、Raspberry Piに出会いました。性能値は低いのですが、コンピュータとして必要な機能は、全て搭載し、カードサイズで、価格が安い。単体の性能が低い分は、分散処理システムで他のサービスで補える様に仕上げれば良いです。その為に考えたのが、「分散コンピューティング環境にロボットの部品を置く」と言うシステムアークテクチャー(RDCS)です。「部品を置く」これが、ミソです。ロボットのコントローラであるRaspberry Piも、部品です。脚も部品です。画像処理プログラムも部品。計測データも部品。何もかもが対等な部品(Object)です。それらを制御するのは、Job Description(JD)だけです。人間とロボットが協調して作業をする為には、共通のJob Descriptionが必要です。このJSをScenario Generator経由でロボットの部品の制御に使います。この考えの元は、約10年前に、企業の知識創造マネジメントを研究していた時に、作ったプロセスデータベースの開発経験です。上場企業約100社、のべ約10,000人以上の方にアンケート・インタビューして作った企業の知識創造マネジメントモデルをベースにした組織活動データベースです。7年前にソフトウェア商品化して、今も多くの企業で使われています。今でも、この大量のアンケート、インタビューよくやったなぁと思うけど。その事業企画を許してくれた会社や、インタービューに応じて下さった企業の方々には、今でも感謝です。しかも、分析サービスとして、お金を頂いてやっていたのです。お客様も、ご自分の会社の知識創造の実体を知りたかったのです。この分野は、大学でも研究している方がいるけど、これだけのデータで研究している人は、世界にもいません。この実績を評価して下さった米国東海岸のTopクラスの大学と共同研究もできました。企業の知識創造(利益の源)はマネジメントできます。ただ、みんなその方法を知らないだけ。)
また、直感的にも、元々のDesign Philosophy & Conceptに対しても、分散アーキテクチャーの方が似合っているように思いました。
Simple & Smartな、ロボット達がワイワイ集まって、トマトを作るなんて、考えただけでも面白そうで、ワクワクしてきます。Toy Storyの世界観です。
同じ目標の元に、人と沢山の自律型のロボットが協調して働く、その環境を作るのがRDCSです。だから働いているロボットの部品もRDCSは、ちゃんと知っている。なぜなら、修理ロボットが部品を持っていかなければならないから。。。
話は変わるけど、Raspberry Piの開発者には、おこられちゃうかもしれないけど、システム開発は性能の低いハードで作った方が良いです。なぜなら、アークテクチャー構造やアルゴリズムを考えなければならないから。それに、それ以下の性能になる事はない訳です。それが、後々、システムの成長を可能とします。また、技術者としても面白いですよ!

実機の組み立てを初めて、まぁいろいろ大変ですし、分散システムのfail safe & recovery機能の実装などでも苦労しましたが、デザインは一切後悔していません。

しかし、開発を突き進めて行くと、さまざまな畝の幅に対応する必要があり、4つの脚の間隔を用途に合わせて自由に変える必要に迫られました。まぁ、その方が合理的なので、4月に導入するバージョンは、4つの脚の位置が自由に変更できます。RDCSでは、4つの脚の間隔を、それぞれ1,000kmにしても制御できます。(そんなもん、誰がするか!)
でも、このようにロボットの形状を自由に考えられるのも、元のデザイン、RDCSの考え方あるからです。それと、Raspberry Piが小さく、軽いからです。

ただ、犬を散歩させる「お散歩ロボット」や、人をサポートするロボットは、比率は変えません。ロボットの重量や強度の最適な形状比率なので。。。。。

しかし野外用の実用ロボットを創るって、本当に大変!!
農業しながら、一人でする事ではないです。
昼は、農家で、夜は技術者。
昼は、植物学で、夜は工学。
昼は、現実で、夜は未来。
昼は、嫁さんニコニコ、夜は金稼げ!
はっきり言って、
脳みそパンクで、分裂状態
睡眠不足で、体力限界
なんで、こんな事しているのだろう?
こんなときは、バナナボートに乗ってはいけません。
くれぐれも真似をしない様に。なんちゃって!

でも、でも、僕の一番の理解者は、嫁さんです。感謝、感謝

Simple & Smart
peace!  (^_^)v

追加
今のソフトウェアは、本当にそれで良いのか私には、大きな疑問があります。
特に、Windows関連のソフトには、疑問だらけです。
高性能なハードに、使いもしない機能満載のOS、使いもしない機能満載のアプリケーション。Vicious Circleそのもの。2、8(ニッパチ)の理論がありますが、もっとひど事になっています。個々の技術が進歩しているように見えて、美意識もなく、全体が退化している。
ビジネスだからしょうがない事は、挿し引いても、全体が退化している。
System Architectの、プロ技術者としての美意識は???

コンピュータを学ぶ、子供達には、個人的に、そのような物は触らせない方が良いと思います。「三つ子の魂、百まで」です。日本のように技術立国を目指す国のコンピュータ教育は、根本的に考える必要があると考えていますし、自分なりに、すこしチャレンジしてみようと思うこの頃です。

大事な事は、
・コンピュータの基本動作の仕組みを正しく知る事
・コンピュータ化する対象を、正確に構造化して分析・体系化する事
・実現するためのアークテクチャーを考える事
・処理のアルゴリズムにこだわる事
そして、最も大切な事は、コンピュータは創造の為の道具であると認識する事

それができれば、システムの目的が正しく設定でき、良いシステムが考えられ、良いプログラムが作れます。
結果として、良いシステムになります。そして、そのシステムを使う人が幸せになります。そして、システムを創った人たちも、創造の意欲と技術が高まります。
このサイクルを実現しなくっちゃ。進歩したとはいえない。

しかし、上記のような問題意識を持つと、今のこの時代に於ける
Raspberry Piの存在意義は、とても大きなものだと思えてきます。

2012年10月30日火曜日

New house & new machine

Kurin is happy.
Because he has a new house.
Now Japan is autumn, It will be winter soon.
I wonder if his house will warm KURIN in winter.

A new cutting machine!
I use this machine to make a robot part.
It can cut materiales at a right angle.
To cut materiales at a right angle is very important to build up robots.
Hitachi  Koki      FC7FSB


Peace!

2012年10月29日月曜日

The Video !! Walking a 4 legged robot. v(^.^)v

Please see a  prototype robot video.
It's a powerful  4 legged robot.


This prototype robot is used for functional verification.
It seem a simple robot, but it have many function.
Space recognition, obstacle detection,  autonomous locomotion,,,,

These function is  on my original robot platform called 'RDCS'.
I will improve these robot function  using  results of prototype robot testing.

By the way, he recognizes  his environment through his eye (xtion).

Peace!

2012年10月8日月曜日

A new robot on 4 legs. (prototype)

Now, I'm developing a 4 legs robot. The pictures are a prototype 4 legs robot.
The prototype robot is half size model.
4本脚ロボットを開発しています。写真は、そのプロトタイプです。

30cm ruler in lower side

I grow organic tomatoes in the greenhouse.  And in the greenhouse, an aisle is narrow (40cm) and uneven ground.

 There are several robot moving methods  that are wheels, caterpillar, 4 legs and others. I have considered  which is the best moving method in the 'farm' and 'greenhouse'.
I decided to develop a 4 legs robot, first of all.

私は、化学農薬などを使わないオーガニック トマトを農業ハウスで栽培しています。
ハウス内は、通路も狭く、また平ではありません。

ロボットの移動方法には、車輪、キャタピラー、4本脚、それ以外の方法もあります。
最初に、4本脚のロボットを作る事に決めました。


The selection points are below:
(1) A function of holding on the level ( a height level requirement )
My forming robot have to move on the application which are an actuator, pruner machine,,,
Therefore a robot need to hold these applications on the level in order to exercise their capacities.
A wheel and caterpillar machin are difficult to hold on the level.
But 4 legs moving system is easy to realize  my height level requirement, nothing any other parts.
I'm going to research and to develop for putting into practical use.


peace!

2012年10月3日水曜日

Performance testing Xtion on Raspberry Pi
Using a capturing server

Raspberry Pi is a good machine. But it don't have a capacity for 3D processing.  For this test, I use a Raspberry Pi as a capturing service (server).  And MacMini is 3D Processing service and viewing.
My test environment diagram is below.

Raspberry Piは、3D処理をするには性能がたりません。従って、Xtionを使ったcaputuring setverとして使い、空間認識などの処理をMacminiで処理します。そのテストをしました。
テストは、RDCS環境を使いまいた。RDCSは、分散コンピューティングをベースにしたロボットプラットフォームです。その機能を使ってテストをしました。
Micminiでpoint cloud処理をしています。さすがに瞬間的な処理です。


 Capturing Service        3D recognizing service
   Xtion
    Raspberry Pi                Mac MIni
----------------------------------------------------  Coordinator Layer
---------------------------------------------------- (Service Control)
             |                                |
----------------------------------------------------      Cooperative Layer
---------------------------------------------------- (Communication Control)

A performance testing was executed on RDCS.

RDCS is a robot platform based on a distributed computing model.
A lots of robot function (hardware, software) is connected by  "Cooperative Control" and "Coordinator".
"Cooperative Control" is a network communication control.  The control  connects computer , actuator, sensor and other robot device.
"Coordinator" offers robot required software. "Coordinator" integrates a lot robot software on RDCS.

This test flow is :

(1) 3D recognized service requests a data set ( image and depth ) to Capturing service.
(2) Capturing service on Raspberry Pi execute to capture image and depth.
(3) 3D recognized service receive a couple of capturing data.
(4) 3D processing and viewing

RESULT (sec)
(1)      0-1
(2)     8-10 (include the time which is Xtion initialize and terminate)
                   A Capture time is 1-2 sec.
(3)      0-1
(4)      0-1


This result means that a single robot don't have all function in it.
Therefore, it's able to develop a lightweight and low cost robot.
There are a lot of kinds wrok in farm. And my farm is large. Thus I need  a lot of robot. To do that,  I have to develop a low cost and multi-function robot.
My robots are structured by base robot and add-in function in order to realize a multi-function of robot.
And these robots have to been set up by commercialized product and builded  by component-based.

Now I'm developing a core component of robot  using 2 or 3 Raspberry Pi.
A core component of robot is structured by  6 components which are robot platform(RDCS), space recognition, obstacle detection, moving, fail-safe and recovery.
An effectivity of RDCS which I have developed was  confirmed by this testing.


この結果は、1台のロボットに全ての機能を集約しなくても良い事を示しています。
従って、軽量なかつ低価格のロボットを作る事ができます。
ロボットプラットフォーム、障害物検知、通信、移動、フェイルセーフと回復機能を持ったシンプルなロボットを、Raspberry Piを2、3個使って作れば良いと思います。その上に、アクチュエータなどのロボットのパーツを載せればよのではないでしょうか?
私の開発している、RDCSのアーキテクチャーの有効性を確認できました。




                                                     3D point cloud

Peace!

Nexus7

I got a "Nexus 7" which new android machine produced by google.

I'll use a brain of my robot.

2012年9月28日金曜日

Performance testing Xtion on Raspberry Pi
Capturing RGB

Yesterday, I had done a performance testing.
A test program attached this post.
It's a processing time  from capturing  a  RBG data via OpenNI -Xtion  to writing a formated data.

A test path is below.
Xtion -> OpenNI (RGB, Depth) -> OpenCV (conversion format, writing) -> SD-card

(1)Capturer : 640x480, RGB24
(2)Pieces of writing format type are bmp, dib, jpd, jp2, png, pbm, pgm, ppm, ras, and tiff.

RESULT
(1) It's take 15-20 sec from capturing to writing SD-card.
        processing             time (sec)
     Initialize OpenNI            : 4 - 5
     Capture depth & RBG  : 0 - 1
     Merge                           : 3 - 4
     Convert & save            : 4 - 5
     Terminate                     : 4 - 5
     ( Processing time on MacMini (i5 2.5GHz 8G) is 2sec. )
   
(2) Processing time depends data format a little.
     Jpeg format is faster than png, 2-3 seconds.
(3) There aren't a difference  of processing time between clock speed 700MHz and 800MHz.

Next performance testing is a following process.
Capture (Raspberry Pi) ---  depth & RGB  (UDP) --> Receive (other machine).
This test use a function of Cooperative control of RDCS.

Peace!

/*****************************************************************************************
        Sample snapshot & save  program   (No Warranty)
******************************************************************************************/
OpenNI  1.5.4
Sensor  5.1.2.1
OpenCV 2.4
Xtion Pro Live

(1) Raspberry Pi  800MHz and 700MHz
Arch Linux arm 3.2.27-8-ARCH+
gcc (GCC) 4.7.1 20120721
It need a compiler option "-mcpu=arm1176jzf-s".

(2) Macmini
Darwin Kernel Version 12.2.0
llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)

(3) Windows
No test.

//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <XnOS.h>
#include <opencv2/opencv.hpp>
#include <XnCppWrapper.h>
#include <fstream>
#include <iostream>
#include <string>
#include <cstring>

#include <stdio.h>
//#include <stdlib.h>
#include <time.h>
#include <math.h>

using namespace std;
using namespace xn;
using namespace cv;
//---------------------------------------------------------------------------
// Defines
//---------------------------------------------------------------------------
#define SAMPLE_XML_PATH "../../Config/SamplesConfig.xml"

//#define PR1(A)
//#define PR2(A, B)
#define PR1(A) std::cout << A << endl;
#define PR2(A, B) std::cout << A << ":" << B << endl;
#define ER1(A) std::cout << A << endl;
#define ER2(A, B) std::cout << A << ":" << B << endl;

//---------------------------------------------------------------------------
// Globals
//---------------------------------------------------------------------------
XnStatus nRetVal = XN_STATUS_OK;

float* g_pDepthHist;
XnRGB24Pixel* g_pTexMap = NULL;
unsigned int g_nTexMapX = 0;
unsigned int g_nTexMapY = 0;
XnDepthPixel g_nZRes;

Context g_context;
xn::ScriptNode g_scriptNode;
xn::DepthGenerator g_depth;
xn::ImageGenerator g_image;
xn::DepthMetaData g_depthMD;
xn::ImageMetaData g_imageMD;


cv::Mat colorArr[3];
cv::Mat colorImage;

const XnRGB24Pixel* pImageRow;
const XnRGB24Pixel* pPixel;

void printTime(const char *msg) ;

//---------------------------------------------------------------------------
// Code
//---------------------------------------------------------------------------

/************************************************************************
*** Callback glutIdle
*************************************************************************/
void printTime(const char *msg) {
time_t timer;
struct tm *date;
char str[256];

timer = time(NULL);
date = localtime(&timer);
PR2(msg, asctime(date));
}
/************************************************************************
*** main
*************************************************************************/

int main(int argc, char* argv[])
{
XnStatus rc;
EnumerationErrors errors;
IplImage bgrIpl;
cv::Mat bgrImage;
int i, iFrame, iClean;
int iCnt = 0;

char framenumber[10];
std::stringstream ss;
std::string str_frame_number;



// -------------------------------------------------------------------------
// check argument.
// -------------------------------------------------------------------------
if (argc != 4) {
PR1("argument error. output file, format (jpg, png), count.");
return 1;
}
iFrame = atoi(argv[3]);
if (iFrame < 1 || iFrame > 100) {
ER1("frame 1-100.");
return 1;
}
if (!(strcmp(argv[2], "bmp") == 0 ||
strcmp(argv[2], "dib") == 0 ||
strcmp(argv[2], "jpg") == 0 ||
strcmp(argv[2], "jp2") == 0 ||
strcmp(argv[2], "png") == 0 ||
strcmp(argv[2], "pbm") == 0 ||
strcmp(argv[2], "pgm") == 0 ||
strcmp(argv[2], "ppm") == 0 ||
strcmp(argv[2], "ras") == 0 ||
strcmp(argv[2], "tiff") == 0
)) {
ER1("format error.");
return 1;
}

// -------------------------------------------------------------------------
// set up OpenNI camera.
// -------------------------------------------------------------------------
// read a device configuration file and initialyze
rc = g_context.InitFromXmlFile(SAMPLE_XML_PATH, g_scriptNode, &errors);
if (rc == XN_STATUS_NO_NODE_PRESENT){
XnChar strError[1024];
errors.ToString(strError, 1024);
ER1(strError);
return (rc);
}else if (rc != XN_STATUS_OK){
ER2("Open failed ", xnGetStatusString(rc));
return (rc);
}

// Searches for an existing created node of a specified type and returns a reference to it.
rc = g_context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_depth);
if (rc != XN_STATUS_OK){
ER1("No depth node exists! Check your XML.");
return 1;
}

// Searches for an existing created node of a specified type and returns a reference to it.
rc = g_context.FindExistingNode(XN_NODE_TYPE_IMAGE, g_image);
if (rc != XN_STATUS_OK){
ER1("No image node exists! Check your XML.");
return 1;
}

PR1("first genelation*******************");
g_depth.GetMetaData(g_depthMD);
g_image.GetMetaData(g_imageMD);
PR1("***********************************");

// Hybrid mode isn't supported in this sample
if (g_imageMD.FullXRes() != g_depthMD.FullXRes() || g_imageMD.FullYRes() != g_depthMD.FullYRes()){
ER1 ("The device depth and image resolution must be equal!");
return 1;
}

// RGB is the only image format supported.
if (g_imageMD.PixelFormat() != XN_PIXEL_FORMAT_RGB24){
ER1("The device image format must be RGB24");
return 1;
}

// Texture map init
g_nTexMapX = (((unsigned short)(g_depthMD.FullXRes()-1) / 512) + 1) * 512;
g_nTexMapY = (((unsigned short)(g_depthMD.FullYRes()-1) / 512) + 1) * 512;
g_pTexMap = (XnRGB24Pixel*)malloc(g_nTexMapX * g_nTexMapY * sizeof(XnRGB24Pixel));

g_nZRes = g_depthMD.ZRes();
g_pDepthHist = (float*)malloc(g_nZRes * sizeof(float));

rc = g_context.WaitAnyUpdateAll();
if (rc != XN_STATUS_OK){
ER2("Read failed ", xnGetStatusString(rc));
return 1;
}
// -------------------------------------------------------------------------
// main routine.
// -------------------------------------------------------------------------

for (i = 0; i < iFrame; i++) {
printTime("start generation");
g_depth.GetMetaData(g_depthMD);
g_image.GetMetaData(g_imageMD);
printTime("end generation");
}

printTime("start output");
g_depth.GetAlternativeViewPointCap().SetViewPoint(g_image);
pImageRow = g_imageMD.RGB24Data();

colorArr[0] = cv::Mat(g_imageMD.YRes(), g_imageMD.XRes(),CV_8U);
colorArr[1] = cv::Mat(g_imageMD.YRes(), g_imageMD.XRes(),CV_8U);
colorArr[2] = cv::Mat(g_imageMD.YRes(), g_imageMD.XRes(),CV_8U);

printTime("create new matrix");
PR2("g_imageMD.YRes", g_imageMD.YRes());
for (int y = 0; y < g_imageMD.YRes(); y++){
pPixel = pImageRow;
uchar* Bptr = colorArr[0].ptr<uchar>(y);
uchar* Gptr = colorArr[1].ptr<uchar>(y);
uchar* Rptr = colorArr[2].ptr<uchar>(y);
for(int x=0; x < g_imageMD.XRes() ;++x , ++pPixel){
Bptr[x] = pPixel->nBlue;
Gptr[x] = pPixel->nGreen;
Rptr[x] = pPixel->nRed;
}
pImageRow += g_imageMD.XRes();
}
printTime("start merge");
cv::merge(colorArr, 3, colorImage);

printTime("start save");
sprintf(framenumber,"%s.%s",argv[1], argv[2]);
ss << framenumber;
ss >> str_frame_number;
std::string str_aux = str_frame_number;
bgrIpl = colorImage;
cvSaveImage(str_aux.c_str(), &bgrIpl);
printTime("end output");
//g_context.Shutdown();

return 0;
}

2012年9月24日月曜日

Xtion vs Kinect, which is the best Robot EYE


The purpose of introducing robots into farming is to improve productivity through reducing labor and other cost. My robots have  to work without the help of farmers.
Therefore my robots must have  self-control feature. I think the most important technology to acquire self-control is to recognize the space. This technology is base on  space 3D scanning and 3D recognition.
To develop the technology, I did a lot of experiments with  Xtion and Kinect. I decided to adopt Xtion from the results of the experiment.
(1) small and light
(2) bus power
(3) near mode
(4) cross platform (Arch Linux, Ubuntu, OSX, WindowsXp)
(5) cooperative with OpenCV and PCL
(6) commercial use free

私は、実際に業務で使えるロボットを開発したと考えています。
それは、人件費の削減を通じた生産性の向上をはたすものでなければなりません。
そのようなロボットを実現ためには、空間認識が最も重要な技術であると考えています。その為に、3Dスキャナーとして、XtionとKinectを実験してきましたが、ロボットに適しているのは、Xtionという結果を得ました。

Xtion and Kinect