LoginSignup
0
0

More than 1 year has passed since last update.

デジタル一眼をPCで制御

Last updated at Posted at 2022-06-04

PCにカメラがなかったので、使っていないEOS M3をwebカメラとして使えないか実験中。

計算環境

項目
CPU Intel Core i5-3320M
Ubuntu 20.04
ROS noetic
Camera Canon EOS M3

#カメラとの接続
EOS購入時についてきた付属のコードでPCとカメラを接続し、電源ON

コード

#gphoto2のインストール
sudo apt  install gphoto2
#接続されているカメラの確認
gphoto2 --auto-detect

下記のように表示され、認識されていそう

型式                         ポート                                            
----------------------------------------------------------
Canon EOS M3                   usb:003,004    

まずは撮影しようとすると

#カメラ撮影
gphoto2 --capture-image

下記エラーが発生。

*** エラー ***             
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (デバイスもしくはリソースがビジー状態です). Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
エラー: Could not capture image.
エラー: 取り込みできませんでした。
*** エラー (-53: 'Could not claim the USB device') *** 

gvfs-gphoto2-volume-monitorが問題ということで、現在実行中のプロセスを表示

ps aux | grep gphoto
name         977  0.0  0.2 255084 22644 ?        Ssl  09:49   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
name       17166  0.0  0.1 435440 13704 ?        Sl   19:20   0:00 /usr/libexec/gvfsd-gphoto2 --spawner :1.3 /org/gtk/gvfs/exec_spaw/8
name       18013  0.0  0.0  10092   720 pts/0    S+   19:25   0:00 grep --color=auto gphoto

ということで、問題のプロセスを停止

kill -9 977

無事に撮影できました。

gphoto2 --capture-image-and-download
0
0
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
0