ifm3dpy.device.O3C
- class ifm3dpy.device.O3C
Bases:
O3RClass for managing an instance of an O3C Camera.
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
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
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[, pointers])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(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: Parameters for SetTemporaryApplicationParameter
PCIC command which temporarily overrides a single application parameter.
Attributes
The IP address associated with this Camera instance
The XMLRPC port associated with this Camera instance
- class Parameter
Bases:
IntEnumEnum: Parameters for SetTemporaryApplicationParameter
- ODS_MAXIMUM_HEIGHT = 2102
- ODS_MOTION_DATA = 2103
- ODS_OVERHANGING_LOAD = 2003
- ODS_ZONE_SET = 2101
- PDS_GET_ITEM = 2201
- PDS_GET_PALLET = 2200
- PDS_GET_RACK = 2202
- PDS_VOL_CHECK = 2203
- class SetTemporaryApplicationParameter
Bases:
PCICCommandPCIC command which temporarily overrides a single application parameter.
The override is not persisted and is reverted when the application is restarted.
- serialize_data(self: PCICCommand) list[int]
Serialize this command into the byte payload sent over PCIC.
- Returns
Serialized payload as byte values.
- Return type
list[int]
- 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
- factory_reset(self: 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: 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.
- get(self: O3R, path: Sequence[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
- get_diagnostic(self: O3R) dict
Returns the content of the diagnostic memory formatted in JSON
- Return type
- get_diagnostic_filter_schema(self: O3R) dict
Returns the JSON schema for the filter expression provided to the getFiltered() method
- Returns
The JSON schema
- Return type
- get_diagnostic_filtered(self: O3R, filter: dict) dict
Returns the content of the diagnostic memory formatted in JSON and filtered according to the JSON filter expression
- get_init(self: O3R) dict
Return the initial JSON configuration.
- Returns
The initial JSON configuration
- Return type
- get_schema(self: O3R, pointers: None | str | Sequence[str] = None) dict
Returns the current JSON schema configuration
- ports(self: O3R) list[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 (
ifm3dpy.device.Device.boot_mode) – The system mode to boot into upon restart of the sensor- Raises
- remove(self: 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 (
str) – A JSON Pointer to the object to be removed.
- reset(self: 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 (
str) – A JSON Pointer to the object to be set to default.
- resolve_config(self: O3R, json_pointer: str) dict | list | str | bool | int | float | None
Returns a part of the configuration formatted as JSON based on a JSON pointer.
- Parameters
json_pointer (
str) – A JSON pointer selecting the part of the configuration to return.- Returns
The part of the JSON configuration selected by the given JSON pointer. This is a
dictfor pointers selecting a JSON object and the corresponding python type for pointers selecting a leaf value.- Return type
- save_init(self: O3R, pointers: Sequence[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: O3R) 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
- set(self: 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.
- 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