LoginSignup
4

More than 3 years have passed since last update.

ROSでDOBOT Magicianを動かす

Last updated at Posted at 2021-01-07

環境

ubuntu20.04
ROS noetic

手順

1 ROSのインストール

ROS講座02 インストール

2 dobotパッケージのインストール

  • パッケージをインストール
インストール&ビルド
cd ~/catkin_ws/src
git clone https://github.com/wcaarls/dobot.git

#依存パッケージのインストール
sudo apt-get install libqt5serialport5*
  • dobot_driverのCMakeLists.txtにset(CMAKE_CXX_FLAGS "-fPIC")を追加(dobot_apiをリンクする場合は必要みたい)
dobot/dobot_driver/CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(dobot_api)

set(CMAKE_CXX_FLAGS "-fPIC") #追加

find_package(catkin REQUIRED COMPONENTS
)

find_package(Qt5 REQUIRED COMPONENTS
  Core
  Network
  SerialPort
)

...

  • ビルド
##noetic(ubuntu20.04)以外
sudo apt install python-catkin-tools
catkin build 

##noetic(ubuntu20.04の場合はこちら)
sudo apt install python3-osrf-pycommon python3-catkin-tools
catkin build 

4 動作確認

  • DobotMaicianの電源を入れ、PCとDobotMagicianをUSBケーブルで接続

  • roscoreの立ち上げ

roscore
  • サーバの立ち上げ(/dev/ttyUSB0 はDobotMagicianのポート名に合わせる)
rosrun dobot_driver DobotServer /dev/ttyUSB0 
  • 以下のコマンドでDobotMagicianがホーミングすればOK
rosservice call /DobotServer/SetHOMECmd "{}"

5 パッケージ構成

dobot_api:C++ dobot API ライブラリ
dobot_driver:dobot APIをROSのcmd_velやserviceに対応するためのラッパー
dobot_bringup:dobot_driverにcmd_velやserviceの司令を送り動作させるサンプルプログラム

6 メモ

dobot_apiを直接使用して,自作のプログラムから純粋なC++のAPIからdobotを制御することもできます。その場合はdobot_driverのCMakeLists.txtとソースが参考になります

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4