ifm3dpy.device.Device

class ifm3dpy.device.Device

Bases: None

Base class for managing an instance of an all cameras

__init__(self: ifm3dpy.device.Device, ip: str = '192.168.0.69', xmlrpc_port: int = 80, password: str = '', throw_if_unavailable: bool = True) None

Constructor

Parameters
  • ip (string, optional) – The ip address of the camera. Defaults to 192.168.0.69.

  • xmlrpc_port (uint, optional) – The tcp port the sensor’s XMLRPC server is listening on. Defaults to port 80.

  • password (string, optional) – Password required for establishing an “edit session” with the sensor. Edit sessions allow for mutating camera parameters and persisting those changes. Defaults to ‘’ (no password).

Methods

__init__(self[, ip, xmlrpc_port, password, ...])

Constructor

am_i(self, family)

Checking whether a device is one of the specified device family

check_minimum_firmware_version(self, major, ...)

Checks for a minimum ifm camera software version

device_parameter(self, key)

Convenience accessor for extracting a device parameter

device_type(self[, use_cached])

Obtains the device type of the connected camera.

firmware_version(self)

Version of firmware installed on device

force_trigger(self)

Sends a S/W trigger to the camera over XMLRPC.

from_json(self, json)

Configures the camera based on the parameter values of the passed in JSON.

reboot(self, mode)

Reboot the sensor

to_json(self)

A JSON object containing the state of the camera

trace_logs(self, count)

Delivers the trace log from the camera

who_am_i(self)

Retrieve the device family of the connected device

Attributes

ip

The IP address associated with this Camera instance

xmlrpc_port

The XMLRPC port associated with this Camera instance

am_i(self: ifm3dpy.device.Device, family: ifm3dpy.device.Device.device_family) bool

Checking whether a device is one of the specified device family

Parameters

family (CameraBase.device_family) – The family to check for

Returns

True if the device is of the specified family

Return type

bool

class boot_mode

Bases: None

Enum: Camera boot up modes.

Members:

PRODUCTIVE : the normal runtime firmware comes up

RECOVERY : allows you to flash new firmware

property name
check_minimum_firmware_version(self: ifm3dpy.device.Device, major: int, minor: int, patch: int) bool

Checks for a minimum ifm camera software version

Parameters
  • major (int) – Major version of software

  • minor (int) – Minor Version of software

  • patch (int) – Patch Number of software

Returns

True if current software version is greater or equal to the value passed

Return type

bool

class device_family

Bases: None

Enum: The family of the device

Members:

UNKNOWN

O3D

O3X

O3R

property name
device_parameter(self: ifm3dpy.device.Device, key: str) str

Convenience accessor for extracting a device parameter

No edit session is created on the camera

Parameters

key (str) – Name of the parameter to extract

Returns

Value of the requested parameter

Return type

str

Raises

RuntimeError

device_type(self: ifm3dpy.device.Device, use_cached: bool = True) str

Obtains the device type of the connected camera.

This is a convenience function for extracting out the device type of the connected camera. The primary intention of this function is for internal usage (i.e., to trigger conditional logic based on the model hardware we are talking to) however, it will likely be useful in application-level logic as well, so, it is available in the public interface.

Parameters

use_cached (bool) – If set to true, a cached lookup of the device type will be used as the return value. If false, it will make a network call to the camera to get the “real” device type. The only reason for setting this to false would be if you expect over the lifetime of your camera instance that you will swap out (for example) an O3D for an O3X (or vice versa) – literally, swapping out the network cables while an object instance is still alive. If that is not something you are worried about, leaving this set to true should result in a signficant performance increase.

Returns

Type of device connected

Return type

str

firmware_version(self: ifm3dpy.device.Device) ifm3dpy.device.SemVer

Version of firmware installed on device

Returns

Firmware version

Return type

SemVer

force_trigger(self: ifm3dpy.device.Device) None

Sends a S/W trigger to the camera over XMLRPC.

The O3X does not S/W trigger over PCIC, so, this function has been developed specficially for it. For the O3D, this is a NOOP.

from_json(self: ifm3dpy.device.Device, json: dict) None

Configures the camera based on the parameter values of the passed in JSON. This function is _the_ way to tune the camera/application/imager/etc. parameters.

Parameters

json (dict) – A json object encoding a camera configuration to apply to the hardware.

Raises

RuntimeError – If this raises an exception, you are encouraged to check the log file as a best effort is made to be as descriptive as possible as to the specific error that has occured.

class import_flags

Bases: None

Enum: Import flags used when importing a Vision Assistant configuration

Members:

GLOBAL

NET

APPS

property name
property ip

The IP address associated with this Camera instance

class mfilt_mask_size

Bases: None

Enum: Convenient constants for median filter mask sizes

Members:

_3x3

_5x5

property name
class operating_mode

Bases: None

Enum: Camera operating modes

Members:

RUN : streaming pixel data

EDIT : configuring the device/applications

property name
reboot(self: ifm3dpy.device.Device, mode: ifm3dpy.device.Device.boot_mode = <boot_mode.PRODUCTIVE: 0>) None

Reboot the sensor

Parameters

mode (CameraBase.boot_mode) – The system mode to boot into upon restart of the sensor

Raises

RuntimeError

class spatial_filter

Bases: None

Enum: Convenience constants for spatial filter types

Members:

OFF

MEDIAN

MEAN

BILATERAL

property name
class temporal_filter

Bases: None

Enum: Convenience constants for temporal filter types

Members:

OFF

MEAN

ADAPTIVE_EXP

property name
to_json(self: ifm3dpy.device.Device) dict

A JSON object containing the state of the camera

Returns

Camera JSON, compatible with python’s json module

Return type

dict

Raises

RuntimeError

trace_logs(self: ifm3dpy.device.Device, count: int) List[str]

Delivers the trace log from the camera

A session is not required to call this function.

Parameters

count (int) – Number of entries to retrieve

Returns

List of strings for each entry in the tracelog

Return type

list[str]

class trigger_mode

Bases: None

Enum: Image acquisition trigger modes

Members:

FREE_RUN

SW

property name
who_am_i(self: ifm3dpy.device.Device) ifm3dpy.device.Device.device_family

Retrieve the device family of the connected device

Returns

The device family

Return type

CameraBase.device_family

property xmlrpc_port

The XMLRPC port associated with this Camera instance