scanner

class blickfeld_scanner.scanner.scanner(hostname_or_ip='localhost', port=None, name=None, key_and_cert_file=None, key_and_cert=None)

Scanner is a class to connect to a device, get a point cloud stream, get a status stream and set a scan pattern.

Parameters
  • hostname_or_ip (str) – Device to which the connection should be established.

  • port (int) – Port on which the device is reachable the default is 8000.

  • name (str) – Name of the device used for string representation.

  • key_and_cert_file (str) – Filename containing a private key and certificate for SSL connection.

  • key_and_cert (str) – String containing a private key and certificate for SSL connection.

protocol_version = 1
get_status()

Request status of device

Returns

Status object, see Protobuf definitions Status

get_status_stream()

Request status stream of device

This returns a status stream, which only delivers updates when the device has changed. Do not use this in a synchronous blocking call. Use the get_status method instead.

Returns

blickfeld_scanner.scanner.status_stream object

get_point_cloud_stream()

Request point cloud stream of device

Returns

blickfeld_scanner.scanner.point_cloud_stream object

static file_point_cloud_stream(dump_filename)

Request a point_cloud_stream, which streams off a .bfpc file. No device (and connection to a device) is needed for this operation.

Parameters

dump_filename – path to .bfpc file

Returns

blickfeld_scanner.scanner.point_cloud_stream object

set_scan_pattern(config, persist=False)

Function to set a new scan pattern, see: Protobuf definitions. First call blickfeld_scanner.scanner.scanner.fill_scan_pattern() with the scan pattern you want to set and then use that returned scan pattern as a config in this function.

Parameters
  • config – scan pattern to be set

  • persist – Persist scan pattern on device and reload it after a power-cycle, see: Protobuf definitions scan pattern

Returns

response scan pattern, see Protobuf definitions Connection, see Protobuf definitions Connection

fill_scan_pattern(config)

Function to fill a scan pattern, see: Protobuf definitions. The device fill the missing fields with default values and return it. After it is filled the scan pattern can be set with the blickfeld_scanner.scanner.scanner.set_scan_pattern() function.

Parameters

config – scan pattern to be filled by the BSS, see: Protobuf definitions scan pattern

Returns

Filled scan pattern, which can be set, see Protobuf definitions scan pattern

get_scan_pattern()

Returns the currently set scan pattern, see: Protobuf definitions.

Returns

Currently set scan pattern, see Protobuf definitions scan pattern

get_device_timestamp()

Returns the current device timestamp in seconds.

Returns

Current device timestamp in seconds

get_ntp_server()

Attention: To use this function you need the requests library https://requests.readthedocs.io/en/master/

Function to get a ntp server

Returns

Returns the ntp server IP address

set_ntp_server(server)

Attention: To use this function you need the requests library https://requests.readthedocs.io/en/master/

Function to set a ntp server

Parameters

server (str) – Server IP to set the ntp server to

create_connection()

Function to create a new connection

Returns

Newly created blickfeld_scanner.scanner.connection

static sync(devices, scan_pattern=None, target_frame_rate=None, max_time_difference=0.1)

Sync two or more devices to record frames at the same time.

Parameters
  • server (list of blickfeld_scanner.scanner.scanner) – list of scanners to sync

  • scan_pattern (scan pattern, see: Protobuf definitions,) – scan pattern that the devices should use, if None is given, it will select the current scan pattern

  • target_frame_rate (float) – Frame rate that the devices should run. Maximum frame rate is dependent on the scan pattern, if None is given the maximum possible frame rate will be used.

  • max_time_difference (float) – Maximum time difference allowed.

exception blickfeld_scanner.scanner.protocol_exception(value)

Protocol exception class for errors, see errors in Protobuf definitions

Parameters

value (Protocol Exception, see: Protobuf definitions) – Exception that occured

errno()

Returns error number

Returns

Error number

name()

Returns error name as in Protobuf definitions

Returns

Error name

description()

Returns error description as in Protobuf definitions

Returns

Error description

class blickfeld_scanner.scanner.connection(hostname_or_ip, port, key_and_cert=None, ssl_protocol=<_SSLMethod.PROTOCOL_TLS: 2>)

Class to create a connection to the Blickfeld LiDAR device

Parameters
  • hostname_or_ip (str) – hostname or IP to which the connection should be established

  • port (int) – port on which the connection should be established

  • key_and_cert (str) – String containing a private key and certificate for SSL connection

  • ssl_protocol (see ssl lib: ssl.PROTOCOL_…) – The protocol used for an SSL connection

clone(other_hostname_or_ip=None, other_port=None, other_key_and_cert=None)

Copies connection object.

Parameters
  • other_hostname_or_ip (str) – a different hostname or IP to use for the clone

  • port (other) – a different port to use for the clone

  • other_key_and_cert (str) – a different string containing a private key and certificate for the clone

send_request(req)

Send request to the device

Parameters

req (Request, see: Protobuf definitions) – Request to the device

Returns

Response of the device, see: Protobuf definitions

send(req)

Send request to the device

Parameters

req (Request, see: Protobuf definitions) – Request to the device

recv()

Receive response of the device

Returns

Response of the device, see: Protobuf definitions

close()

Close connection to the device

class blickfeld_scanner.scanner.status_stream(connection)

Class to request a status stream

Parameters

connection (blickfeld_scanner.scanner.connection) – connection to the device

close()

Close stream and connection

recv_status()

Receive status update

Returns

Status messages of the device, see: Protobuf definitions