実用ロボット開発のための ROS プログラミング サンプルページ 本 定価 判型, 以下 URL から 覧い けます. サンプルペ ジ 内容, 初版 1 刷発行時 も です.

Similar documents
PowerPoint プレゼンテーション

この演習について ROS 演習 1:catkinビルドシステム ROS 演習 2: ノードの作成とトピックの配信 購読 ROS 演習 3:TF の作成 ROS 演習 4:RViz での表示 ROS 演習 5:ROSBAG によるデータ記録 ROS 演習 1~5 では ROS の基本的な要素技術を学習

活用ガイド (ソフトウェア編)


SC-85X2取説


<4D F736F F F696E74202D C835B B E B8CDD8AB B83685D>

活用ガイド (ソフトウェア編)

version 1.3 TIER IV ACADEMY 自動運転システム構築塾 Day2 ROS 演習 ROS 演習 3:ROS 2.0 の最新動向について

活用ガイド (ハードウェア編)

ROSConJP2018

II

これわかWord2010_第1部_ indd

パワポカバー入稿用.indd

これでわかるAccess2010

Table of Contents ロボット関連の動向 ROS(Robot Operating System) の概要 イーソルの取り組み 2

untitled

i

2

平成18年版 男女共同参画白書

医系の統計入門第 2 版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 第 2 版 1 刷発行時のものです.

IPSJ SIG Technical Report Vol.2015-MUS-107 No /5/23 HARK-Binaural Raspberry Pi 2 1,a) ( ) HARK 2 HARK-Binaural A/D Raspberry Pi 2 1.

パソコン機能ガイド

パソコン機能ガイド


エクセルカバー入稿用.indd

01_.g.r..


ネットワークビデオレコーダー VK-64/VK-16/VK-Lite v2.2 セットアップガイド

田向研究室PPTテンプレート

困ったときのQ&A


<4D F736F F D B B BB2D834A836F815B82D082C88C602E646F63>

ii

MATLAB EXPO 2019 Japan プレゼン資料の検討

④【修正】プレゼン資料(九州工業大学_田向権1)

はしがき・目次・事例目次・凡例.indd

基礎輪講2週目 Kinectの話

21 e-learning Development of Real-time Learner Detection System for e-learning

困ったときのQ&A

d1-ros-picking-system-yasukawa

Raspberry Pi BF BF BF Raspberry Pi PC USB HDMI OS SD SD OS Raspberry Pi Model B MicroUSB MicroSD OS SD GPIO HDMI USB LAN Raspberry Pi MicroUSB MicroSD

<4D F736F F D B B83578B6594BB2D834A836F815B82D082C88C60202E646F63>

『戦時経済体制の構想と展開』

Javaと.NET

スライド 1


main.dvi

目次 1. はじめに 本書対象者 PALRO のアプリケーションについて Ubuntu 8.04LTS の入手について Linux 上での開発環境の構築 事前準備 Ubuntu のインストール..

ONLINE_MANUAL

ONLINE_MANUAL

ii


長崎県地域防災計画

LANFTP 1 FTP 047 PC 016 FTP HTTP 024 iphone Camera Control Pro 2 ii

ASP.NET 5 Web 開発 ~ フレームワーク編 ~

PowerPoint プレゼンテーション

フリーソフトでつくる音声認識システム ( 第 2 版 ) サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 第 2 版 1 刷発行時のものです.

™…

i


Wide Scanner TWAIN Source ユーザーズガイド

untitled


bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows ˆ Windows10 64bit Wi



地盤環境振動の対策技術-00-前付.indd

VB-C50i/VB-C50iR 使用説明書

FileMaker Server Getting Started Guide


Step2 入門


Transcription:

実用ロボット開発のための ROS プログラミング サンプルページ 本 定価 判型, 以下 URL から 覧い けます. http://www.morikita.co.jp/books/mid/067581 サンプルペ ジ 内容, 初版 1 刷発行時 も です.

URL https://github.com/nishida-lab/rosbook-pkgs

i ROS ROS 2018 ROS ROS ROS ROS ROS ROS ROS Wiki 1 2 ROS 1 ROS 2 ROS 3 4 ROS 5 13 ROS 9 5 13 MATLAB R ROS 14 ROS Linux Windows ROS Windows ROS 15 ROS iii 1 http://wiki.ros.org/ 2 http://wiki.ros.org/ja

ii ROS 30 7

iii

iv 1 ROS 1 1.1 ROS 1 1.2 4 1.3 ROS 4 1.4 ROS2 11 2 ROS 13 2.1 ROS 13 2.1.1 ROS OS 13 2.1.2 Ubuntu 13 2.2 ROS 14 2.3 17 3 ROS 21 3.1 ROS 21 3.1.1 21 3.1.2 package 22 3.2 ROS 24 3.2.1 node 24 3.2.2 topic 25 3.2.3 message 25 3.2.4 service 26 3.2.5 ROS ROS master 27 3.2.6 parameter server 27 3.2.7 namespace 27 3.2.8 remap 28 3.2.9 28 3.3 ROS 29 3.3.1 rosbash 30

v 3.3.2 31 3.3.3 33 3.4 ROS 38 3.4.1 38 3.4.2 launch 42 3.5 Git 45 4 47 4.1 ROS 47 4.1.1 rqt graph 48 4.1.2 rqt plot 48 4.1.3 RViz 50 4.1.4 ROS rosbag 52 4.2 ROS 55 5 57 5.1 USB 57 5.1.1 57 5.1.2 58 5.1.3 59 5.2 RGB-D 60 5.2.1 60 5.2.2 61 5.3 LiDAR 62 5.3.1 62 5.3.2 63 5.4 64 5.4.1 64 5.4.2 65 5.4.3 66 5.4.4 RViz 67 5.5 68 5.5.1 68 5.5.2 68 5.5.3 69 5.5.4 72 5.5.5 73

vi 6 3D 75 6.1 75 6.1.1 ROS 3D CAD 75 6.1.2 COLLADA 76 6.1.3 COLLADA 80 6.1.4 URDF 81 6.1.5 URDF 82 6.1.6 83 6.1.7 COLLADA 84 6.1.8 Gazebo 85 6.2 Gazebo ROS 89 6.2.1 hardware sim ros control 89 6.2.2 ros control 94 6.2.3 95 6.2.4 HardwareInterface 95 6.3 tf 104 6.3.1 tf 104 6.3.2 tf 105 6.3.3 106 6.3.4 tf 106 6.3.5 tf 109 6.3.6 110 6.3.7 tf static 112 6.3.8 112 7 115 7.1 ROS OpenCV 115 7.2 OpenCV 117 7.2.1 OpenCV 117 7.2.2 120 7.2.3 123 7.3 126 7.3.1 126 7.3.2 130 7.3.3 136 7.3.4 140

vii 8 143 8.1 PCL ROS 143 8.1.1 PCL 143 8.1.2 ROS API 144 8.2 145 8.2.1 145 8.2.2 146 8.2.3 CMakeLists.txt 146 8.3 1 147 8.3.1 147 8.3.2 152 8.4 2 160 8.4.1 2 161 8.4.2 164 8.4.3 167 8.4.4 169 8.4.5 174 9 177 9.1 177 9.1.1 178 9.1.2 178 9.1.3 179 9.1.4 180 9.1.5 180 9.2 slam gmapping 181 9.2.1 182 9.2.2 bag 183 9.2.3 bag 183 9.2.4 185 9.3 navigation 185 9.3.1 186 9.3.2 189 9.3.3 191 9.4 navigation slam gmapping 193 9.5 SLAM 194 9.6 196

viii 9.7 navigation slam gmapping 198 9.8 199 10 203 10.1 203 10.1.1 actionlib 203 10.1.2 SimpleActionClient/Server 205 10.1.3 action 205 10.2 206 10.2.1 actionlib 206 10.2.2 actionlib 210 10.3 212 10.3.1 smach 212 10.3.2 smach 213 10.3.3 smach 216 11 219 11.1 pluginlib 219 11.2 pluginlib 220 11.3 pluginlib arrayutil 221 11.4 pluginlib arrayutil 222 11.4.1 pluginlib arrayutil 222 11.4.2 pluginlib ArrayUtil 223 11.4.3 pluginlib 225 11.4.4 228 11.5 pluginlib arrayutil client 229 11.5.1 pluginlib arrayutil client 229 11.5.2 PluginlibArrayutilClient 230 11.5.3 client node 233 11.5.4 client node 234 12 237 12.1 rostest 237 12.2 238 12.3 C++ gtest 238 12.3.1 gtest 238 12.3.2 rostest 242

ix 12.3.3 package.xml 242 12.3.4 CMakeLists.txt 243 12.3.5 243 12.4 Python unittest 244 12.4.1 arrayutil python Python 245 12.4.2 unittest 246 12.4.3 rostest 248 12.4.4 package.xml 249 12.4.5 CMakeLists.txt 249 12.4.6 249 13 Travis CI 251 13.1 Travis CI 251 13.2 industrial ci 252 13.3 pluginlib arrayutil ci industrial ci 253 13.3.1 ROS 253 13.3.2 GitHub Travis CI 253 13.3.3.travis.yml 255 13.3.4 Travis CI 257 13.4 industrial ci 259 13.4.1 wstool 260 13.4.2 262 13.5 industrial ci 264 13.5.1 Docker 264 13.5.2 industrial ci 265 14 MATLAB 267 14.1 MATLAB 267 14.2 Robotics System Toolbox 267 14.3 Windows MATLAB ROS 268 14.3.1 268 14.3.2 MATLAB ROS 270 14.4 Simulink 274 14.4.1 ROS 274 14.4.2 Simulink 276 14.4.3 Simulink 278

x 15 279 15.1 279 15.2 280 15.3 Tips 1: 281 15.3.1 ROS ROS 281 15.3.2 ROS ROS 282 15.4 Tips 2: 283 15.5 Tips 3: 283 285

1 1 1 ROS ROS ROS ROS ROS ROS ROS ROS 1.1 ROS ROS Robot Operating System OSS OS 1 ROS 2007 Willow Garage ROS Willow Garage Open Source Robotics Foundation OSRF GitHub 2 5 3 ROS 2015 DARPA Robotics Challenge DRC 1 OS OpenRTM 2 Git GitHub Git 3

2 1 ROS 23 18 ROS ROS ROS ROS Rethink Robotics Baxter Ascending Technologies Hummingbird NASA Robonaut 2 NEXTAGE OPEN HSR Pepper ROS Southwest Research Institute Willow Garage ROS OSS ROS Industrial ROS I 2012 ABB KUKA Universal Robots ROS I OSRF ROS ROS ROS 1. 2. 3. 4. ROS HTTP XML RPC ROS publish/subscribe

1.1 ROS の広がり 3 型とよばれて存在するものであり ほかのロボット向けミドルウェアと比べて ROS が特段勝っ ているわけではありません 実は ROS の本質はもっと別の点にあります 開発 操作ツールは ROS の人気を支える最大の機能です 可視化ツール ビューア の RViz や三次元動力学シミュレータの Gazebo 各種の設定 ビルド リリース 起動 監視 ログ 取得などの ロボット開発工程を支える多様なツールが揃っています 図 1-1 には RViz を 利用して産業用ロボットのさまざまな処理を可視化した例を示しています とくに近年 格段に 充実してきたのがソースコードパッケージ管理とリリースの仕組みです ソフトウェアプロジェ クトの開始 運用における面倒な設定について統一的な手法を提供することで ROS による開発 のハードルが大幅に下がりました 具体的には パッケージ間の依存関係を自動的に解決できる rosdep 複数のパッケージを一括してコンパイルできる catkin バイナリパッケージ生成作 業の多くを自動化する bloom 手元のソースコード群をネット上で管理される最新版に一括更 新する wstool といったツールが非常に便利です ROS には ロボットを動作させるソフトウェアの基本機能の大半が収められています 移動ロ ボットによる自己位置推定と地図生成を行う機能を利用すれば 簡単なプログラムによって部屋 図 1-1 RViz を利用して産業用ロボットの自動把持システムを構築した例 (a) 産業用ロボット 把持対象物 計測用 センサを三次元空間に投影した例 (b) 対象物の認識と姿勢計測結果を表示した例 (c) 実物の動作を RViz の モデルに投影し 各関節の座標軸を表示した例 (d) 実際に計測された三次元点群を表示した例 1

4 1 ROS Python ROS OSS ROS 1 17 7 ROS Wiki 1 3 1.2 ROS BSD Berkeley Software Distribution BSD BSD ROS 1.3 ROS ROS ROS ROS OpenCV OpenCV Open Source Computer Vision Library VR AR C/C++ Python Java OpenCV ROS

57 5 5 ROS ROS 5.1 USB 5.1.1 ROS USB usb cam image view USB 5-1 usb cam $ sudo apt install ros-kinetic-usb-cam image view $ sudo apt install ros-kinetic-image-view 5-1 USB Logicool HD Pro Webcam C920t

58 5 5.1.2 USB usb cam image view roscore $ roscore $ rosrun usb_cam usb_cam_node /dev/video0 usb cam /dev/video0 USB $ rosrun usb_cam usb_cam_node _video_device:=/dev/video1 usb cam image view $ rosrun image_view image_view image:=/usb_cam/image_raw image:=/usb cam/image raw usb cam /usb cam/ image raw image view image 5-2 5-2 image view

5.1 USB 59 5.1.3 5-1 usb cam image view usb cam.launch launch usb cam Wiki 5-1 usb cam image view launch usb cam.launch 1 <launch> 2 <!-- usb_cam --> 3 <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen"> 4 <remap from="/usb_cam/image_raw" to="/usb_cam/image_raw"/> 5 <param name="video_device" value="/dev/video1" /> 6 <param name="image_width" value="640" /> 7 <param name="image_height" value="480" /> 8 <param name="pixel_format" value="mjpeg" /> 9 <param name="framerate" value="30" /> 10 <param name="contrast" value="32" /> 11 <param name="brightness" value="32" /> 12 <param name="saturation" value="32" /> 13 <param name="autofocus" value="true" /> 14 <param name="focus" value="51" /> 15 </node> 16 17 <!-- image_view --> 18 <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen"> 19 <remap from="image" to="/usb_cam/image_raw"/> 20 <param name="autosize" value="true"/> 21 </node> 22 </launch> 5 video device: /dev/video0 USB image width, image height: pixel format: mjpg yuyv uyvy framerate: fps frame per second contrast, brightness, saturation: http://wiki.ros.org/usb cam/

60 5 autofocus, focus: image view remap usb cam /usb cam/image raw image view image autosize: launch usb cam image view roscore GitHub $ roslaunch chapter5 usb_cam.launch 5.2 RGB-D Microsoft Kinect Xbox 360 Kinect ASUS Xtion PRO LIVE Xtion 5-3 RGB depth RGB D Kinect Xtion USB RGB 5-3 Microsoft Kinect Xbox 360 ASUS Xtion PRO LIVE 5.2.1 $ sudo apt install ros-kinetic-openni-* $ sudo apt install ros-kinetic-openni2-* $ sudo apt install ros-kinetic-freenect-* RGB-D chapter5/usb cam.launch

279 15 ROS RoboCup@Home 1 Exi@ ROS ROS 15.1 Exi@ 15-1 RGB-D LiDAR 2 Ubuntu 14.04 Windows 10 FPGA 2 CPU SoC 3 15 15-2 ROS ROS Windows 1 http://www.robocupathome.org/ 2 Field Programmable Gate Array 3 System on Chip OS Ubuntu 12.04

280 15 15-1 Exi@ 15-2 100 ROS 15.2 15-3 Part Time Working Nodes Full Time Working Nodes Sensor/Actuator Drivers 15-3 Tips

15.3 Tips 1: 281 15-3 Tips GitHub 15.3 Tips 1: 15-3 1 15.3.1 ROS ROS ROS IP 15 $ ifconfig inet addr IP ROS 1 IP 192.168.0.100 IP 192.168.0.200 https://github.com/hibikino-musashi-athome

282 15 roscore $ roscore IP $ export ROS_IP=192.168.0.100 IP $ export ROS_MASTER_URI=http://192.168.0.100:11311 $ export ROS_IP=192.168.0.200 ROS ROS 15.3.2 ROS ROS Windows ROS Windows ROS 1 Windows Mac OS Android Linux GitHub 2 ROS Indigo Windows 10 Visual Studio 2015 C++ 1 Exi@ 15-3 Windows Actuator Drivers ROS 15-3 1 1 Windows 2 ROS Windows ROS 1 TCP/IP 2 https://github.com/hibikino-musashi-athome/rosbook

285 Bitbucket 18 Blender 76 Docker 252, 264 Gazebo 3, 9, 89 Git 1, 18 GitHub 1, 18 gtest 237 IKFast 8 MATLAB 11, 267 ODE 9, 92 OMPL 8 OpenCV 4, 115 OpenRAVE 8 OpenRTM 1 OpenSLAM 6 PCL 5, 143 Robotics System Toolbox 267 Simulink 274 Travis CI 251 Ubuntu 13 unittest 237, 244 VMware Workstation Player 269 ROS actionlib 193, 203 amcl 190, 192 194, 196 base local planner 188, 197 carrot planner 197 cartographer 198 clear costmap recovery 198 costmap 2d 186, 193, 197 dwa local planner 197 global planner 197 gmapping 194 196, 200 hardware interface 89 image view 57, 59 industrial ci 252 joy 180 map saver 185 map server 185, 190, 193 move base 190, 192, 193, 196 move slow and clear 198 nav core 193, 197, 198 navfn 188, 197 navigation 52, 177, 181, 185, 191, 193, 198, 199 pluginlib 197, 219 ros control 89, 94 ros controller 92 rosbag 52, 183 rosbash 30 roscpp 22 rosdep 16 rospy 22 rostest 248 rotate recovery 198 rqt 47 rqt graph 48 rqt plot 48 RViz 3, 8, 50 slam gmapping 177, 181, 183, 185, 194, 198, 199 smach 212 teleop twist joy 180 tf 50, 105, 178, 179 turtlebot navigation 189 urg node 179 usb cam 57 wstool 252, 260 ypspur ros 180 ROS catkin make 21 roscd 30 roscore 32 roscp 31 rosd 31 rosed 31 roslaunch 33 rosls 31 rosmsg 36 rosnode 34 rospack 33 rosparam 37 rospd 30 rosrun 32 rosservice 36 rossrv 37 rostopic 34 ROS 2D Nav Goal 52 2D Pose Estimate 52 advertise 26 bag 52 catkin 21 joint 82 link 82 message 25 MoveIt! 8 node 24 package 22 parameter server 27 Publish Point 52 remap 28 ROS2 11 ROS Action Protocol 204 ROS Answers 17 ROS Discourse 18 ROS Index 18 ROS Industrial 2, 10 ROS Japan Users Group 18 ROS master 27 ROS.org 17 ROS Wiki 4, 13, 17 ROS 92

286 ROS 27 rviz 52 service 26 topic 25 URDF 9, 81 Xacro 86 FPGA 279 Kinect 60 Light Detection and Ranging LiDAR 62, 178 LRF 62 RGB-D 60, 178 TurtleBot2 65 USB 57 Xtion 60 GitHub Organizations 18 OSRF 1 RoboCup@Home 279 Willow Garage 1 Bayes Filter 194 Binary Bayes Filter 195 Dynamic Window Approach DWA 197 Extended Kalman Filter EKF 194, 195 Global Dynamic Window Approach Global DWA 196 Graph-Based SLAM 198 Grid-Based SLAM 195, 196 Histogram Filter HF 194 Iterative Closest Point ICP 152 Monte Carlo Localization MCL 194 196 Particle Filter PF 193, 194 Rao-Blackwellized Particle Filter RBPF 194, 195 Simultaneous Localization and Mapping SLAM 6, 181, 194, 196, 198 3D CAD 75 A* 197 AI 283 BSD 4 C++/Python API Documentation 18 call 26 COLLADA 9, 76 cv::mat 117 DDS 11 Differential Drive 178 geometry msgs/twist 49 n eff Number of Effective Particles 185, 196 namespace 27 Omni-Directional 178 ORB 135 pcd 147 SimpleActionClient 205 SimpleActionServer 205 STL 76 Toolbox 267 UV 77 25, 26 107, 143 2 126 180, 200 224 82 1 283 4 3 130 138 126, 128 268 118 140 140 132 130 178 106, 157 160 186, 188, 197 185, 194, 195 188, 196, 197 4 186, 197 26 213 123 178, 189 26 104 25 136 68 138 181, 193, 196, 198 64 212 185, 195, 198 212, 283 178 195 197 282 128 197 54 167 128 240 181, 194 2 132 78 241 237 241, 248 55 188, 196, 197 185, 194, 195 140 25 27 24 178, 189

287 54 22 25 27 82 178 21 105 174 169 5, 144 178, 189 1 5 25 129 130 105 28 178 186, 188, 197

AI RoboCup @Home League 2008 2010 2 furo SLAM hw/sw RoboCup 2017 @Home Domestic Standard Platform League Isaac I.Y. Saito ROS RoboCup 2004 RoboCup 2017 @Home Domestic Standard Platform League

ROS c 2018 2018 10 17 1 1 1-4-11 102-0071 03-3265-8341 FAX 03-3264-8709 http://www.morikita.co.jp/ Printed in Japan ISBN978-4-627-67581-0