ifm3dpy.device.O3R

class ifm3dpy.device.O3R

Bases: Device

Class for managing an instance of an O3R Camera

__init__(self: ifm3dpy.device.O3R, ip: str = '192.168.0.69', xmlrpc_port: int = 80) 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])

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_discovery()

Discover the list of devices in the network.

device_parameter(self, key)

Convenience accessor for extracting a device parameter

device_type(self[, use_cached])

Obtains the device type of the connected camera.

factory_reset(self, keep_network_settings)

Sets the camera configuration back to the state in which it shipped from the ifm factory.

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.

get(self[, path])

Returns the configuration formatted as JSON based on a path.

get_diagnostic(self)

Returns the content of the diagnostic memory formatted in JSON

get_diagnostic_filter_schema(self)

Returns the JSON schema for the filter expression provided to the getFiltered() method

get_diagnostic_filtered(self, filter)

Returns the content of the diagnostic memory formatted in JSON and filtered according to the JSON filter expression

get_init(self)

Return the initial JSON configuration.

get_schema(self)

Returns the current JSON schema configuration

port(self, port)

Returns information about a given physical port

ports(self)

Returns a list containing information about all connected physical ports

reboot(self, mode)

Reboot the sensor

reboot_to_recovery(self)

Reboot the device into Recovery Mode

remove(self, json_pointer)

Removes an object from the JSON.

reset(self, json_pointer)

Sets the default value of an object inside the JSON.

resolve_config(self, json_pointer)

Returns a part of the configuration formatted as JSON based on a

save_init(self[, pointers])

Save to current temporary JSON configuration as initial JSON configuration, so it will be applied with the next transition to the INIT state (system boot up)

sealed_box(self)

Provides access to the SealedBox.

set(self, json)

Overwrites parts of the temporary JSON configuration which is achieved by merging the provided JSON fragment with the current temporary JSON.

set_temp_ip_address(self, arg0)

Set temporary IP address

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

device_discovery() list[ifm3dpy.device.IFMNetworkDevice]

Discover the list of devices in the network.

Returns:

A list of dictionaries, each containing the device’s

IP address, MAC address and type.

Return type:

list[dict]

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

factory_reset(self: ifm3dpy.device.O3R, keep_network_settings: bool) None

Sets the camera configuration back to the state in which it shipped from the ifm factory.

Parameters:

keep_network_settings (bool) – A bool indicating wether to keep the current network settings

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.

get(self: ifm3dpy.device.O3R, path: list[str] = []) dict

Returns the configuration formatted as JSON based on a path. If the path is empty, returns the whole configuration.

Returns:

The JSON configuration for the list of object path fragments

Return type:

dict

get_diagnostic(self: ifm3dpy.device.O3R) dict

Returns the content of the diagnostic memory formatted in JSON

Return type:

dict

get_diagnostic_filter_schema(self: ifm3dpy.device.O3R) dict

Returns the JSON schema for the filter expression provided to the getFiltered() method

Returns:

The JSON schema

Return type:

dict

get_diagnostic_filtered(self: ifm3dpy.device.O3R, filter: dict) dict

Returns the content of the diagnostic memory formatted in JSON and filtered according to the JSON filter expression

Parameters:

filter (dict) – A filter expression in JSON format

Return type:

dict

get_init(self: ifm3dpy.device.O3R) dict

Return the initial JSON configuration.

Returns:

The initial JSON configuration

Return type:

dict

get_schema(self: ifm3dpy.device.O3R) dict

Returns the current JSON schema configuration

Returns:

The current json schema configuration

Return type:

dict

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
port(self: ifm3dpy.device.O3R, port: str) ifm3dpy.device.PortInfo

Returns information about a given physical port

Parameters:

port (str) – the port for which to get the information

Returns:

the port information

Return type:

PortInfo

ports(self: ifm3dpy.device.O3R) list[ifm3dpy.device.PortInfo]

Returns a list containing information about all connected physical ports

Returns:

the list of Ports

Return type:

List[PortInfo]

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

reboot_to_recovery(self: ifm3dpy.device.O3R) None

Reboot the device into Recovery Mode

Raises:

RuntimeError

remove(self: ifm3dpy.device.O3R, json_pointer: str) None

Removes an object from the JSON. The scope of this method is limited to the following regular expressions

  • ^/applications/instances/appd+$

  • ^/device/log/components/[a-zA-Z0-9-_]+$

Parameters:

json_pointer (string) – A JSON Pointer to the object to be removed.

reset(self: ifm3dpy.device.O3R, json_pointer: str) None

Sets the default value of an object inside the JSON. The object is addressed by a JSON Pointer. The object is reset to the values defined in the JSON schema. Note that this does not reset the init configuration, nor the parameters marked as “sticky”.

Parameters:

json_pointer (string) – A JSON Pointer to the object to be set to default.

resolve_config(self: ifm3dpy.device.O3R, json_pointer: str) object

Returns a part of the configuration formatted as JSON based on a JSON pointer.

Returns:

The partial JSON configuration for the given JSON pointer

Return type:

dict

save_init(self: ifm3dpy.device.O3R, pointers: list[str] = []) None

Save to current temporary JSON configuration as initial JSON configuration, so it will be applied with the next transition to the INIT state (system boot up)

Parameters:

pointers (List[str]) – A List of JSON pointers specifying which parts of the configuration should be saved as initial JSON. If no list is provided the whole config will be saved

sealed_box(self: ifm3dpy.device.O3R) ifm3dpy.device.O3RSealedBox

Provides access to the SealedBox. The SealedBox is used to for accessing the password protected features of the device

Returns:

The sealed box object for the O3R camera

Return type:

O3RSealedBox

set(self: ifm3dpy.device.O3R, json: dict) None

Overwrites parts of the temporary JSON configuration which is achieved by merging the provided JSON fragment with the current temporary JSON.

Parameters:

json (dict) – The new temporay JSON configuration of the device.

set_temp_ip_address(self: str, arg0: str) None

Set temporary IP address

Parameters:
  • mac (string) – MAC address of the device

  • temp_ip (string) – Temporary IP addres of the device

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