0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ROSでUSBカメラ画像の表示

Posted at

#概要
Ubutnu 16.04にUSBカメラをつないでROSからカメラ画像を表示する方法について
ターミナルからの起動とlaunchファイル作成のそれぞれを記載

#準備
下記コマンドを必要なパッケージをインストール
(indigoの場合はkineticindigoに置き換え)

sudo apt-get install ros-kinetic-uvc-camera 
sudo apt-get install ros-kinetic-image-*

#ターミナルからの起動
画像の表示するためにはターミナルを3つ別々に起動させる必要がある.

##roscoreの起動
1つ目のターミナルでroscoreを起動

roscore

##カメラnodeの起動
1つ目のターミナルはそのままにして
2つ目のターミナルでカメラ用のnodeを起動

rosrun uvc_camera uvc_camera_node

##画像を表示
これまでの2つのターミナルはそのままに
3つ目のターミナルで下記のコマンドを実行すれば画像が表示される

rosrun image_view image_view image:=/image_raw

#launchファイルの作成
ターミナルからいちいち起動させるのは面倒なのでlaunchファイルを作成しておく

camera.launch
<launch>
 <node name="uvc_camera_node" pkg="uvc_camera" type="uvc_camera_node">

 <node name="image_view" pkg="image_view" type="image_view" output="screen">
    <remap from="image" to="image_raw"/>
 </node>

</launch>

これで一発でroscoreの立ち上げからカメラ画像の表示までを一発で起動できる

0
1
0

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?