ifm3dpy.device.Device
- class ifm3dpy.device.Device
Bases:
objectBase class for managing an instance of an all cameras
- __init__(self: Device, ip: str = '192.168.0.69', xmlrpc_port: int = 80, password: str = '', throw_if_unavailable: bool = True) None
Constructor
- Parameters
ip (
str, optional) – The ip address of the camera. Defaults to 192.168.0.69.xmlrpc_port (
int, optional) – The tcp port the sensor’s XMLRPC server is listening on. Defaults to port 80.password (
str, 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
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.
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
set_temp_ip_address(mac, temp_ip)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
Nested types
Enum: Camera boot up modes.
Enum: The family of the device
Enum: Import flags used when importing a Vision Assistant configuration
Enum: Convenient constants for median filter mask sizes
Enum: Camera operating modes
Enum: Convenience constants for spatial filter types
Enum: Convenience constants for temporal filter types
Enum: Image acquisition trigger modes
Attributes
The IP address associated with this Camera instance
The XMLRPC port associated with this Camera instance
- class device_family
Bases:
IntEnumEnum: The family of the device
- O3C = 4
- O3D = 1
- O3R = 3
- O3X = 2
- UNKNOWN = 0
- class import_flags
Bases:
IntFlagEnum: Import flags used when importing a Vision Assistant configuration
- APPS = 16
- GLOBAL = 1
- NET = 2
- class spatial_filter
Bases:
IntEnumEnum: Convenience constants for spatial filter types
- BILATERAL = 3
- MEAN = 2
- MEDIAN = 1
- OFF = 0
- class temporal_filter
Bases:
IntEnumEnum: Convenience constants for temporal filter types
- ADAPTIVE_EXP = 2
- MEAN = 1
- OFF = 0
- am_i(self: Device, family: device_family) bool
Checking whether a device is one of the specified device family
- Parameters
family (
ifm3dpy.device.Device.device_family) – The family to check for- Returns
True if the device is of the specified family
- Return type
- check_minimum_firmware_version(self: Device, major: int, minor: int, patch: int) bool
Checks for a minimum ifm camera software version
- static device_discovery() list[IFMNetworkDevice]
Discover the list of devices in the network.
- Returns
A list of the discovered devices, each providing the device’s IP address, MAC address, port URL, device name and vendor ID.
- Return type
list[ifm3dpy.device.IFMNetworkDevice]
- device_parameter(self: 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
- Raises
- device_type(self: 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
- firmware_version(self: Device) SemVer
Version of firmware installed on device
- Returns
Firmware version
- Return type
- force_trigger(self: 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: 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.
- reboot(self: ifm3dpy.device.Device, mode: ifm3dpy.device.Device.boot_mode = <boot_mode.PRODUCTIVE: 0>) None
Reboot the sensor
- Parameters
mode (
ifm3dpy.device.Device.boot_mode) – The system mode to boot into upon restart of the sensor- Raises
- to_json(self: Device) dict
A JSON object containing the state of the camera
- Returns
Camera JSON, compatible with python’s json module
- Return type
- Raises
- trace_logs(self: 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]
- who_am_i(self: Device) device_family
Retrieve the device family of the connected device
- Returns
The device family
- Return type
- property ip
The IP address associated with this Camera instance
- property xmlrpc_port
The XMLRPC port associated with this Camera instance