Giter Site home page Giter Site logo

dynamixel's Introduction

Dynamixel用RTコンポーネント

大阪電気通信大学
澤崎 悠太,升谷 保博
2019年11月23日

はじめに

  • ROBOTIS社のロボットアクチェータDynamixel複数台とUSBと介して接続し,入力された位置と速度の指令をアクチュエータへ送ったり,アクチェータから取得した現在位置を出力したりするRTコンポーネントです.
  • 以下の環境で開発,動作確認しています.
    • Dynamixel AX-12, XL-320, XM-430
    • Windows 10 64bit版
    • Visual Studio 2015
    • OpenRTM-aist 1.2.0 64bit版
    • DynamixelSDK 3.7
  • 同じ種類のDynamixelが同じバスに任意個数接続されており,それらのIDが1から個数まで1刻みで付けられていることを前提にしています.

仕様

入力ポート

  • goalPosition
    • 型: RTC::TimedUShortSeq
    • 概要: DynamixelsのControl TableのGoal Positionに設定する値
  • movingSpeed
    • 型: RTC::TimedUShortSeq
    • 概要: DynamixelsのControl TableのMoving SpeedまたはProfile Velocityに設定する値
  • pGain
    • 型: RTC::TimedUShortSeq
    • 概要: DynamixelsのControl TableのCompliance SlopeまたはP GainまたはPosition P Gainに設定する値.0の場合は特別にトルクオフにする.

出力ポート

  • presentPosition
    • 型: RTC::TimedUShortSeq
    • 概要: DynamixelsのControl TableのPresent Positionから読み出した値
  • moving
    • 型: RTC::TimedUShortSeq
    • 概要: DynamixelsのControl TableのMovingから読み出した値.エラーが起きている場合はそれも表す.

コンフィギュレーション

  • NUM_ACTUATOR
    • 型: short
    • 概要: アクチュエータの数
  • DEVICENAME
    • 型: string
    • 概要: Dynamixelと通信するためのシリアルポートの名前
  • BAUDRATE
    • 型: int
    • 概要: 通信速度 [bps]
  • MODEL
    • 型: string
    • 概要: アクチュエータの種類(AX12またはXL320またはXM430)
  • initialPositionString
    • 型: string
    • 概要: 初期位置.空白で区切った複数の数値の文字列を与えることができる.例:NUM_ACTUATOR = 5の場合,10ならば,10,10,10,10,10が設定され,10 20 30ならば,10,20,30,30,30が設定される.
  • initialSpeedString
    • 型: string
    • 概要: 初期速度.空白で区切った複数の数値の文字列を与えることができる.例:NUM_ACTUATOR = 5の場合,10ならば,10,10,10,10,10が設定され,10 20 30ならば,10,20,30,30,30が設定される.

インストール

  • OpenRTM-aist 1.2.0をインストール.
  • DynamixelSDKをインストール.
    • GitHubのDynamixelSDKリポジトリをクローン
    • DynamixelSDK\c++\build\win64\dxl_x64_cpp.sln を開いてReleaseでビルド
    • DynamixelSDK\c++\build\win64\outputの内容を例えばC:\Program Files\DynamixelSDK\libへコピー
    • DynamixelSDK\c++\include\dynamixel_sdkの内容を例えばC:\Program Files\DynamixelSDK\includeへコピー
    • DynamixelSDKのヘッダファイルとライブラリを適切な場所にインストールする.例えば,
    • DLLファイルのインストールされたディレクトリのパス(C:\Program Files\DynamixelSDK\lib)を環境変数のPathの並びに追加する.
  • Dynamixelをクローンかダウンロードする.
  • CMake
    • ビルドディレクトリはトップ直下のbuild
    • ConfigureはVisual Studio 64bit
    • キャッシュ変数のDYNAMIXELSDK_DIRにDynamixelSDKをインストールしたディレクトリを設定する.
    • キャッシュ変数のDYNAMIXELSDK_LIBRARIESにDynamixelSDKのファイル名を設定する.
  • build\Dynamixel.slnをVisual Studioで開く.
  • ビルド

使い方

  • DynamixelをUSB2Dynamixelなどを介してPCのUSBポートに接続する.
  • Windowsのデバイスマネージャーの設定で,対応するUSB Serial PortのプロパティでLatency Timeを最小の1(msec)に変更する.
  • RTCのコンフィギュレーションで,アクチュエータの数,シリアルポート名,通信速度,モデル,初期位置,初期速度を変更できる.
  • アクティベートすると設定した初期速度で設定した初期位置へ移動する.
  • ディアクティベートしても安全のためトルクはオフにならない.
  • 過大トルクなどでアラームシャットダウン(脱力)に陥ると,コンポーネントがエラー状態へ遷移する.
  • エラーをリセットすると,トルクオフし,電源を入れ直さなくても再び使えるようになる.
  • TkInterを使ったPythonのRTコンポーネントと組み合わせてテストできるようにしている.

既知の問題・TODO

  • モデルはAX12とXL320とXM430にしか対応していない.
  • 複数種類のアクチェータを接続することは想定していない.
  • IDは1から始まる連続した値であること想定している.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.