• 検索結果がありません。

つくばチャレンジ2008プログラム Robot Design and Control Lab direction

N/A
N/A
Protected

Academic year: 2018

シェア "つくばチャレンジ2008プログラム Robot Design and Control Lab direction"

Copied!
25
0
0

読み込み中.... (全文を見る)

全文

(1)

リファレンスマニュアル

作成: Doxygen 1.5.5

Fri Mar 6 23:01:56 2009

(2)
(3)

Contents

1 方位センサコンポーネント 1

2 構成索引 3

2.1 構成 . . . 3

3 ファイル索引 5 3.1 ファイル一覧 . . . 5

4 クラス 7 4.1 クラスCSerial . . . 7

4.2 クラスdirection. . . 11

5 ファイル 15 5.1 direction.cpp . . . 15

5.2 direction.h . . . 17

5.3 directionComp.cpp . . . 18

5.4 serial.cpp . . . 19

5.5 serial.h. . . 20

(4)
(5)

Chapter 1

方位センサコンポーネント

方位センサ(3DM-GX1)により方位を取得するコンポーネントです。 つくばチャレンジ用に作成したプログラムです。

バグが残っていると思いますが、何かの役に立てばと思い公開します。 注意:

このプログラムによって発生した損害は補償しません。 あくまでもサンプルとお考えください。

日付:

2008.03.03

作者:

Chiba Institute of Technology

(6)
(7)

Chapter 2

構成索引

2.1 構成

クラス、構造体、共用体、インタフェースの説明です。

CSerial (シリアル通信(バイナリ)を行うクラス) . . . 7 direction (方位センサのデータを取得するコンポーネント) . . . 11

(8)
(9)

Chapter 3

ファイル索引

3.1 ファイル一覧

これはファイル一覧です。

direction.cpp(方位センサからデータを取得するためのコンポーネント) . . . 15

direction.h(方位センサからデータを取得するためのコンポーネント) . . . 17

directionComp.cpp(方位センサのデータを取得するコンポーネント) . . . 18

serial.cpp(シリアル通信(バイナリ)を行うクラス) . . . 19

serial.h(シリアル通信(バイナリ)を行うクラス) . . . 20

(10)
(11)

Chapter 4

クラス

4.1 クラス CSerial

シリアル通信(バイナリ)を行うクラス

#include <serial.h>

Public メソッド

ˆ CSerial () コンストラクタ

ˆ ∼CSerial() デストラクタ

ˆ FILE ∗getDevice () デバイスの取得

ˆ intgetBaudRate() ボーレートの取得

ˆ char ∗ getPortName() ポート名の取得

ˆ intOpen(const char ∗port_name, int aSpeed) シリアル通信デバイスをオープンする

ˆ intClose()

シリアル通信デバイスをクローズする

ˆ intSend(char ∗data, int len) バイナリデータを送信する

(12)

8 クラス

ˆ intRecv(char ∗data, int max_len) バイナリデータを受信する

ˆ intClearRecvBuf()

ˆ speed_tbitrate(int aBR)

ビットレートを定数に変換する関数

Public 変数

ˆ FILE ∗device デバイス名

4.1.1 説明

シリアル通信(バイナリ)を行うクラス

4.1.2 コンストラクタとデストラクタ

4.1.2.1 CSerial::CSerial ()

コンストラクタ

デバイスとボーレートの初期化 戻り値:

無し

4.1.2.2 CSerial::∼CSerial ()

デストラクタ

4.1.3 関数

4.1.3.1 FILE∗ CSerial::getDevice () [inline]

デバイスの取得 戻り値:

デバイスのポインタ

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(13)

4.1 クラス CSerial 9

4.1.3.2 int CSerial::getBaudRate () [inline]

ボーレートの取得 戻り値:

ボーレート

4.1.3.3 char∗ CSerial::getPortName () [inline]

ポート名の取得 戻り値:

ポート名のポインタ

4.1.3.4 int CSerial::Open (const char ∗ port_name, int aSpeed)

シリアル通信デバイスをオープンする デバイスとボーレートの初期化 引数:

← port_name ポートの名称

← aSpeed ボーレート

戻り値:

1:成功0:失敗

4.1.3.5 int CSerial::Close ()

シリアル通信デバイスをクローズする 戻り値:

1

4.1.3.6 int CSerial::Send (char ∗ data, int len)

バイナリデータを送信する

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(14)

10 クラス

引数:

← data 送信するデータのポインタ

← len データのバイト数 戻り値:

送信したデータのバイト数(0:失敗)

4.1.3.7 int CSerial::Recv (char ∗ data, int max_len)

バイナリデータを受信する 引数:

→ data 受信するデータのポインタ

← max_len データのバイト数の最大値 戻り値:

受信したデータのバイト数(-1:失敗)

4.1.3.8 int CSerial::ClearRecvBuf ()

4.1.3.9 speed_t CSerial::bitrate (int aBR) [inline]

ビットレートを定数に変換する関数 引数:

← aBR ボーレート 戻り値:

ボーレートの定数

4.1.4 変数

4.1.4.1 FILE∗ CSerial::device

デバイス名

このクラスの説明は次のファイルから生成されました:

ˆ serial.h

ˆ serial.cpp

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(15)

4.2 クラス direction 11

4.2 クラス direction

方位センサのデータを取得するコンポーネント

#include <direction.h>

Public メソッド

ˆ direction (RTC::Manager ∗manager)

ˆ ∼direction()

ˆ virtual RTC::ReturnCode_t onInitialize() 方位センサの初期化

ˆ virtual RTC::ReturnCode_t onFinalize() コンポーネントを終了するときに呼び出される関数

ˆ virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id) コンポーネントをアクティベートするときに呼ばれる関数

ˆ virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id) アクティベート後に定期的に呼ばれる関数

Protected 変数

ˆ std::stringm_devName シリアル通信のデバイス名

ˆ TimedFloatSeqm_directionData

pitch,roll,yawを含む方位データ配列(コンポーネント出力)

ˆ OutPort< TimedFloatSeq >m_directionDataOut

4.2.1 説明

方位センサのデータを取得するコンポーネント

4.2.2 コンストラクタとデストラクタ

4.2.2.1 direction::direction (RTC::Manager ∗ manager)

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(16)

12 クラス

4.2.2.2 direction::∼direction ()

4.2.3 関数

4.2.3.1 RTC::ReturnCode_t direction::onInitialize () [virtual]

方位センサの初期化

オープンするデバイスを設定 コンポーネントの出力の設定 戻り値:

RTC_OK

4.2.3.2 RTC::ReturnCode_t direction::onFinalize () [virtual]

コンポーネントを終了するときに呼び出される関数 シリアル通信デバイスをクローズする

戻り値: RTC_OK

4.2.3.3 RTC::ReturnCode_t direction::onActivated (RTC::UniqueId ec_id) [virtual]

コンポーネントをアクティベートするときに呼ばれる関数

シリアル通信デバイスがオープンしていないときデバイスをオープンする また、方位センサに初期化のデータを送信する

戻り値:

RTC_OK:成功、RTC_ERROR:失敗

4.2.3.4 RTC::ReturnCode_t direction::onExecute (RTC::UniqueId ec_id) [virtual]

アクティベート後に定期的に呼ばれる関数 方位センサにコマンドを送信

方位のデータを受信

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(17)

4.2 クラス direction 13

データをdegee(short)に変更した後、コンポーネントの出力に送るparam[out] m_directionData pitch,roll,yawの方位データの配列

戻り値: RTC_OK

4.2.4 変数

4.2.4.1 std::string direction::m_devName [protected]

シリアル通信のデバイス名

4.2.4.2 TimedFloatSeq direction::m_directionData [protected] pitch,roll,yawを含む方位データ配列(コンポーネント出力)

4.2.4.3 OutPort<TimedFloatSeq> direction::m_directionDataOut [protected]

このクラスの説明は次のファイルから生成されました:

ˆ direction.h

ˆ direction.cpp

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(18)
(19)

Chapter 5

ファイル

5.1 direction.cpp

方位センサからデータを取得するためのコンポーネント

#include "direction.h"

関数

ˆ short convert2short(char ∗buer) 受信したデータをshort型に変換する

ˆ void directionInit(RTC::Manager ∗manager)

5.1.1 説明

方位センサからデータを取得するためのコンポーネント 日付:

2008.03.03

作者: CIT

5.1.2 関数

5.1.2.1 short convert2short (char ∗ buer)

受信したデータをshort型に変換する

(20)

16 ファイル

引数:

← buer 変換元の 2 バイトデータのポインタ 戻り値:

変換後のshort型の値

5.1.2.2 void directionInit (RTC::Manager ∗ manager)

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(21)

5.2 direction.h 17

5.2 direction.h

方位センサからデータを取得するためのコンポーネント

#include <rtm/Manager.h>

#include <rtm/DataFlowComponentBase.h>

#include <rtm/CorbaPort.h>

#include <rtm/DataInPort.h>

#include <rtm/DataOutPort.h>

#include <rtm/idl/BasicDataTypeSkel.h>

#include "serial.h"

構成

ˆ classdirection

方位センサのデータを取得するコンポーネント

関数

ˆ void directionInit(RTC::Manager ∗manager)

5.2.1 説明

方位センサからデータを取得するためのコンポーネント 日付:

2008.03.03

作者:

Y.Hayashibara

5.2.2 関数

5.2.2.1 void directionInit (RTC::Manager ∗ manager)

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(22)

18 ファイル

5.3 directionComp.cpp

方位センサのデータを取得するコンポーネント

#include <rtm/Manager.h>

#include <iostream>

#include <string>

#include <stdlib.h>

#include "direction.h"

関数

ˆ void MyModuleInit(RTC::Manager ∗manager)

ˆ intmain (int argc, char ∗∗argv)

5.3.1 説明

方位センサのデータを取得するコンポーネント 日付:

2008.03.03

作者:

Y.Hayashibara

5.3.2 関数

5.3.2.1 int main (int argc, char ∗∗ argv)

5.3.2.2 void MyModuleInit (RTC::Manager ∗ manager)

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(23)

5.4 serial.cpp 19

5.4 serial.cpp

シリアル通信(バイナリ)を行うクラス

#include "serial.h"

5.4.1 説明

シリアル通信(バイナリ)を行うクラス 日付:

2008.03.03

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(24)

20 ファイル

5.5 serial.h

シリアル通信(バイナリ)を行うクラス

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <sys/termios.h>

構成

ˆ classCSerial

シリアル通信(バイナリ)を行うクラス

5.5.1 説明

シリアル通信(バイナリ)を行うクラス 日付:

2008.03.03

Fri Mar 6 23:01:56 2009に生成されました。Doxygen

(25)

Index

∼CSerial CSerial,8

∼direction direction,11 bitrate

CSerial,10 ClearRecvBuf

CSerial,10 Close

CSerial,9 convert2short

direction.cpp,15 CSerial,7

∼CSerial,8 bitrate,10 ClearRecvBuf,10 Close,9

CSerial,8 device,10 getBaudRate,8 getDevice,8 getPortName,9 Open,9

Recv,10 Send,9 device

CSerial,10 direction,11

∼direction,11 direction,11 m_devName,13 m_directionData,13 m_directionDataOut,13 onActivated,12

onExecute,12 onFinalize,12 onInitialize,12 direction.cpp,15

convert2short,15 directionInit,16 direction.h,17

directionInit,17

directionComp.cpp,18 main,18

MyModuleInit,18 directionInit

direction.cpp,16 direction.h,17 getBaudRate

CSerial,8 getDevice

CSerial,8 getPortName

CSerial,9 m_devName

direction,13 m_directionData

direction,13 m_directionDataOut

direction,13

maindirectionComp.cpp,18 MyModuleInit

directionComp.cpp,18 onActivated

direction,12 onExecute

direction,12 onFinalize

direction,12 onInitialize

direction,12 OpenCSerial,9

RecvCSerial,10

SendCSerial,9 serial.cpp,19 serial.h,20

参照

関連したドキュメント

×10 8 ~2.4×10 8 Bq、当該ノッチタンク(南側)が約 4.6×10 7 ~9.7×10 7 Bq であ り、漏えいした水の放射能量(Sr-90)は約 1.7×10 8 ~3.3×10 8

8月 9月 10月 11月 12月 1月 2月 3月..

1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月.

令和4年3月8日(火) 9:00 ~ 9:50 10:10 ~ 11:00 11:20 ~ 12:10 国  語 理  科 英  語 令和4年3月9日(水) 9:00 ~ 9:50 10:10 ~

1月 2月 3月 4月 5月 6月 7月 8月 9月10月 11月 12月1月 2月 3月 4月 5月 6月 7月 8月 9月10月 11月 12月1月 2月 3月.

2月 1月 12月 11月 10月 9月. 8月

2月 1月 12月 11月 10月 9月 8月 7月

10月 11月 12月 1月 2月 … 6月 7月 8月 9月 …