SawyerRTC
Simple Wiki Based Contents Management System
ソフトウェア関連 >> RTコンポーネント関連 >> SawyerRTC

SawyerRTCについて

Sawyerは、RethinkRobotics社製の7自由度マニピュレータです。Sawyerは、協働ロボットとして販売されており、Interaと呼ばれる制御インターフェースで動作していますが、ROSベースのIntera SDKを使うことで、外部PCから制御することができます。
最近、触る機会があったので、intera SDKを使うためのクラスの実装とRTコンポーネント化をしてみました。
すでに、Inter SDK、SwayerRTCのダウンロード済みの方は「SawyerRTCの使い方」に進んでください。

Intera SDKの準備

SawyerRTCは、Intera SDKを使いますので、ROSが動作する環境が必須です。まずは、Ubuntu-16.04(Ubuntu-18.04でも動作可能)が動作するPCに ROS(Kineteic)をインストールし、Intrera SDKのインストールと動作確認を行ってください。
Intera SDKのインストール手順の詳細は、”http://sdk.rethinkrobotics.com/intera/Workstation_Setup” を参照してください。
Intera SDKは、ROS Kineticが推奨されていますが、Ubuntu-18.04 + ROS(Melodic)でも動作確認済みです。
Ubuntu-18.04をお使いの場合には、千葉工大の上田先生が導入スクリプトをこちらに公開されていますので、このスクリプトを使うと簡単にROSのインストールを行うことができます。
以下では、Ubuntu-16.04 でのインストールとintera SDKのセットアップまで解説します。

ROS kineticのインストール

まずは、Ubuntu-16.04のマシンにROS(Kinetic)をインストールします。
下記のコマンドを順に入力してください。
# 'setup sources.list'
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'

# 'setup access-key'
$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

# 'Update to latese software lists'
$ sudo apt-get update

# 'install ROS Kinetic Desktop Full'
$ sudo apt-get install ros-kinetic-desktop-full

#
# 'Initialize rosdep'
$ sudo rosdep init
$ rosdep update

# 'install rosinstall'
$ sudo apt-get install python-rosinstall
ここまで終了すれば、ROS Kinetic のデスクトップのインストールが完了です。

開発用ワークスペースの作成

ROSのインストールが終わったら、開発用のワークスペースを作成します。
下記のコマンドを順に入力してください。
# 'create ROS Workspace'
$ mkdir -p ~/ros_ws/src

# 'source ROS setup'
$ source /opt/ros/kinetic/setup.bash

# 'Build workspace'
$ cd ~/ros_ws
$ catkin_make
以上で、開発用ワークスペースの準備完了です。

Intera SDKのインストール

次に、SawyerをコントロールするためのIntera SDKをインストールします。
まず、下記のコマンドを入力して必要なパッケージをインストールします。
$ sudo apt-get update
$ sudo apt-get install git-core python-argparse python-wstool python-vcstools python-rosdep ros-kinetic-control-msgs ros-kinetic-joystick-drivers ros-kinetic-xacro ros-kinetic-tf2-ros ros-kinetic-rviz ros-kinetic-cv-bridge ros-kinetic-actionlib ros-kinetic-actionlib-msgs ros-kinetic-dynamic-reconfigure ros-kinetic-trajectory-msgs ros-kinetic-rospy-message-converter
Ubunutu-18.04の場合には、基本的にkinetcicの部分が melodicとなります。また、melodicには、上記の中で一部のパッケージ(ros-melodic-joystick-driversとros-melodic-rospy-message-converter)がありませんので、ソースコードからインストールしてください。
次に、Intera SDKをGithubからダウンロードしインストールします。
# 'Download Intera SDK from Github'
$ cd ~/ros_ws/src
$ wstool init .
$ git clone https://github.com/RethinkRobotics/sawyer_robot.git
$ wstool merge sawyer_robot/sawyer_robot.rosinstall
$ wstool update


# 'source ROS setup'
$ source /opt/ros/kinetic/setup.bash

# 'Build Intera SDK'
$ cd ~/ros_ws
$ catkin_make
以上で、Intera SDKのインストールは完了です。

Intera SDKの実行環境のセットアップ

Intera SDKのインストールが終わったら、使用するSawyerにあわせて実行環境のセットアップを行います。
Intera SDKでは、ROSの実行環境をセットアップするために intera.shというスクリプトをSawyerのネットワーク環境にあわせてカスタマイズします。
intera.shは、~/ros_ws/src/intera_sdk/intera.shをコピーして使います。
$ cp ~/ros_ws/src/intera_sdk/intera.sh ~/ros_ws
を実行してコピーし、適当なエディタで開いてください。
このファイルの変更箇所は、
robot_hostname
your_ip
ros_version
の3か所です。それぞれSawyerのIPアドレス、自身のPCのIPアドレス そしてご使用のROSのバージョン(kinetic または melodic)です。
以上でセットアップは、終了です。
Intera SDKを使用する前に、必ず intera.shを実行してください。

SawyerRTCのダウンロード

最後に、SawyerRTCをGithubからダウンロードします。下記のコマンドを実行してください。
$ mkdir -p ~/ros_ws/work
$ cd ~/ros_ws/work
$ git clone https://github.com/haraisao/SawyerRTC
これで、~/ros_ws/work/SawyerRTC の下に、ソースコードがダウンロードされます。
次は、SawyerRTCの使い方を参照してください。

資料