pytheta
index
/home/craig/Documents/Development/multi_view_image_modified/scripts/pytheta.py

pytheta is a Python library that interfaces with gphoto2 to control multiple RICOH THETA cameras 
using Ubuntu. It is distributed under the GPL3 license. The RICOH THETA must be turned
on and connected to the computer with a USB cable. 
 
 
--------
Japanese
--------
複数台の全天球カメラ:ThetaをUbuntuPC上で制御するためのプログラム。
ライセンスはGPL3

 
Modules
       
gphoto2
logging
os
re
six
subprocess
sys
threading
time
urllib

 
Classes
       
exceptions.Exception(exceptions.BaseException)
no_xtp_dev

 
class no_xtp_dev(exceptions.Exception)
    Error indicating that there are no xTP devices
 
--------
Japanese
--------
xTPデバイスが何もないことを示すエラー
 
 
Method resolution order:
no_xtp_dev
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__str__(self)

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
Functions
       
camera_control_util(addr)
A utility that summarizes the basic parts of a function 
that you need in order to select and send to a Theta sending a command in Python-gPhoto2.
 
 
Parameters
----------
addr : char
        ID for connected THETA
 
Returns
-------
camera : Camera object
parent_widget : camera widget object
 
--------
Japanese
--------
Python-gPhoto2において
コマンドを送信するThetaを選択して送信する必要がある関数の
基本部分をまるっとまとめたユーティリティ。
 
Parameters
----------
addr : char
        接続されているThetaのID
 
Returns
-------
camera : Camera object
parent_widget : camera widget object
check_if_theta(xtp_dev_list)
Using lsusb, extract RICOH THETA camera from the list of MTP or PTP devices acquired.
We are using this technique with lsusb since gPhoto2 cannot be used to identify the
RICOH THETA cameras when they are mounted.
 
Parameters
----------
xtp_dev_lis : list
        List of connected xTP devices
 
Returns
-------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
lsusbを用いて獲得したMTP or PTPデバイスの一覧の中からThetaを抽出する。  
gPhoto2側の認識機能はマウント状態では使用不能なためこのような実装となった。                   
 
Parameters
----------
xtp_dev_lis : list
        接続されているxTPデバイスのリスト
 
Returns
-------
theta_list : list
        接続されているThetaのリスト
connect_init()
A function that summarizes the items to be performed all at once when connecting.
 
Returns
-------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
接続に際して一斉に行う項目をまとめた関数
 
Returns
-------
theta_list : list
        接続されているThetaのリスト
finish_capture(theta_list)
Function for executing the body function inner_finish_capture in multiple threads
 
Parameters
----------
addr : char
        ID of connected THETAs
 
--------
Japanese
--------
本体関数inner_finish_captureをマルチスレッドで実行するための関数
 
Parameters
----------
addr : char
        接続されているThetaのID
get_bat_lv(theta_list)
Outputs as an integer the current battery level of each THETA contained in theta_list
Whether or not the loop is outside the function depends on future implementation.
I am doing gp.Camera over and over, but I am wondering if I can do this only once.
 
Parameters
----------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
theta_listに含まれる各Thetaの現在のバッテリーレベルを整数で出力する。  
ループを関数外部にするか、否かは今後の実装次第。  
逐一gp.Cameraを行っているが、これを一回やるでだけにできないか考えている。
 
Parameters
----------
theta_list : list
        接続されているThetaのリスト
get_files(theta_list)
Download the file from the camera and save it in the main unit storage.
Then, delete it from  storage on the camera side.
 
Parameters
----------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
カメラからファイルをダウンロードして本体ストレージへ保存する。
そして、カメラ側ストレージからこれを削除する。
 
Parameters
----------
theta_list : list
        接続されているThetaのリスト
get_rem_time_v(theta_list)
Display of remaining time due to storage capacity [in seconds]
 
Parameters
----------
theta_list : list
        List of connected THETAs
 
Returns
-------
result_list : list
        List of execution results
 
--------
Japanese
--------
ストレージ容量に起因する残時間の表示[second]
 
Parameters
----------
theta_list : list
        接続されているThetaのリスト
 
Returns
-------
result_list : list
        実行結果のリスト
get_serial(theta_list)
Output the serial number of each Theta included in theta_list.
Whether or not the loop is outside the function depends on future implementation.
I am doing gp.Camera over and over, but I am wondering if I can do this only once.
 
Parameters
----------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
theta_listに含まれる各Thetaのシリアル番号を出力する。  
ループを関数外部にするか、否かは今後の実装次第。  
逐一gp.Cameraを行っているが、これを一回やるでだけにできないか考えている。
 
Parameters
----------
theta_list : list
        接続されているThetaのリスト
get_xtp_dev_list()
Make a list of connected xTP devices.
xTP device is a general term for PTP and MTP devices. (I named it arbitrarily.)
 
Returns
-------
xtp_dev_lis : list
        List of connected xTP devices
 
--------
Japanese
--------
接続されているxTPデバイスのリストを作成する。  
xTPデバイスとは、PTP、MTPデバイスの総称である。(勝手に名付けた。)
 
Returns
-------
xtp_dev_lis : list
        接続されているxTPデバイスのリスト
inner_finish_capture(addr)
Actual processing part responsible for shooting end processing
Currently, the method using Python-gPhoto2 is unknown, so CLI-gPhoto2 is used instead.
 
Parameters
----------
addr : char
        ID of connected THETA
 
--------
Japanese
--------
撮影終了処理を担う実処理部分
現状Python-gPhoto2による方法が不明なため、CLI-gPhoto2で代用
 
Parameters
----------
addr : char
        接続されているThetaのID
inner_start_capture(addr)
Actual processing part responsible for the start of shooting processing
 
Parameters
----------
addr : char
        ID of the connected THETA
 
--------
Japanese
--------
撮影開始処理を担う実処理部分
 
Parameters
----------
addr : char
        接続されているThetaのID
select_config_util(parent_widget, child_name, grandchild_name)
A utility that puts together all the overlapping 
parts when getting various statuses with Python-gPhoto2.
 
Parameters
----------
parent_widget : camera widget object
child_name : char
        Name of child widget
grandchild_name : char
        Name of grandchild widget
 
Returns
-------
grandchild_widget : camera widget object?
        Grandchild widget
 
--------
Japanese
--------
Python-gPhoto2によって諸ステータスを取得する際に 重複する部分をまるっとまとめたユーティリティ。
 
Parameters
----------
parent_widget : camera widget object
child_name : char
        子ウィジェットの名前
grandchild_name : char
        孫ウィジェットの名前
 
Returns
-------
grandchild_widget : camera widget object?
        孫ウィジェット
start_capture(theta_list)
Function for executing the body function inner_start_capture in multiple threads.
 
Parameters
----------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
本体関数inner_start_captureをマルチスレッドで実行するための関数
 
Parameters
----------
theta_list : list
        接続されているThetaのリスト
unmount_theta(theta_list)
Unmount mounted THETAs. Ultimately, it may be better not to mount it, 
but this implementation was made because it is necessary to make 
settings that allow the master to use other equipment.
 
Parameters
----------
theta_list : list
        List of connected THETAs
 
--------
Japanese
--------
マウントされているThetaをアンマウントする。  
そもそもマウントしないようにすれば良いかもしれないが、  
他の機材の使用に師匠が出うる設定が必要なのでこの実装となった。
 
Parameters
----------
theta_list : list
        接続されているThetaのリスト

 
Data
        TIMEOUT = 10
print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)