A Python 2/3 library for ifm efector O3D3xx 3D cameras
Usage with Python 2 requires the 'future' package
Install the package with
$ python setup.py install
For a quick start, go to the examples
folder and run
$ python create_application.py 192.168.0.69
with your device's IP address to create an example application and
$ python image_viewer.py 192.168.0.69
to view the image data coming from the camera (requires matplotlib)
The library provides all XMLRPC objects as mentioned in the camera's XMLRPC manual. The entry point is the RPC main object which can be created with e.g.
camera = o3d3xx.Device("192.168.0.69")
RPC calls can be performed e.g. like this
version_info = camera.getSWVersion()
These are the different RPC objects and the possibilites how they can be acquired:
session = camera.requestSession()
camera.sessionID
session = camera.session
(only valid after a requestSession()
call)edit = session.startEdit()
which is equivalent toedit = session.setOperatingMode(1)
(again, this is different from the
pure RPC call)edit = session.edit
(only valid after a startEdit()
call)device = edit.device
network = edit.network
application = edit.editApplication(1)
(different from the pure RPC)application = edit.application
(only valid after a editApplication()
call)imagerConfig = application.imagerConfig
spatialFilter = application.spatialFilter
temporalFilter = application.temporalFilter
The library currently provides three basic clients:
pcic = o3d3xx.PCICV3Client("192.168.0.69", 50010)
providing the device's address and PCIC port.answer = pcic.sendCommand("G?")
. All
asnychronous PCIC messages are discarded while waiting for the answer
to the command.answer = pcic.readAnswer("0000")
ticket, answer = pcic.readNextAnswer()
o3d3xx.PCICFormat
to describe which data you
want to retrieveo3d3xx.PCICFormat.blobs("amplitude_image", "distance_image")
.pcic = o3d3xx.FormatClient("192.168.0.69", format)
with format
being
the PCICFormat
instance described above.result = pcic.readNextFrame()
returns for the given example,
result
is a dictionary containing image arrays for the keys
amplitude_image
and distance_image
.o3d3xx.FormatClient
instead, it uses much
less network bandwidth if you are not interested in all available image
types.pcic = o3d3xx.ImageClient("192.168.0.69", 50010)
.result = pcic.readNextFrame()
O3D3xx related libraries for other programming languages:
o3d3xx-python is available at Github