Skip to content

Commit

Permalink
Public-Auto-release: v2.16.1
Browse files Browse the repository at this point in the history
# Added
* Python: Structured numpy interface flag is now available for file streams

# Changed
* Bugfix: Do not enforce the legacy serial number for hardware modules
* API: Rename filter `points_with_no_returns` to `delete_points_without_returns`
  • Loading branch information
blickfeld-lidar committed Jan 26, 2021
1 parent 8b17d7e commit c3c0543
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
9 changes: 9 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ influence the resulting point cloud.

### Removed

## [2.16.1] - 2021.01.26

### Added
* Python: Structured numpy interface flag is now available for file streams

### Changed
* Bugfix: Do not enforce the legacy serial number for hardware modules
* API: Rename filter `points_with_no_returns` to `delete_points_without_returns`

## [2.16.0] - 2020.12.16

### Added
Expand Down
Binary file modified doc/protobuf-frame-visualisation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/protobuf_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ This can be used to e.g. filter points with low intensity or to enable secondary
| ambient_light_level | [blickfeld.protocol.OptionalValueRange](#blickfeld.protocol.OptionalValueRange) | optional | Filter all points, which ambient light level values are not within this value range. |
| range | [blickfeld.protocol.OptionalValueRange](#blickfeld.protocol.OptionalValueRange) | optional | Filter all points, which range values are not within this value range. |
| noise | [ScanPattern.Filter.Noise](#blickfeld.protocol.config.ScanPattern.Filter.Noise) | optional | <blockquote>Introduced in BSL v2.11 and firmware v1.11</blockquote> Refer to [Filter.Noise](#blickfeld.protocol.config.ScanPattern.Filter.Noise) |
| points_with_no_returns | [bool](#bool) | optional | <blockquote> Introduced in BSL v2.16 and firmware v1.17</blockquote>
| delete_points_without_returns | [bool](#bool) | optional | <blockquote> Introduced in BSL v2.16 and firmware v1.17</blockquote>

All points without any returns are filtered if this setting is true. With active algorithms, such as background subtraction, this can reduce the bandwidth significantly.

Expand Down
6 changes: 4 additions & 2 deletions examples/python/numpy_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ def fetch_numpy_frame(target):
# Create filter to filter points and returns by point attributes during the post-processing on the device.
point_filter = scan_pattern_pb2.ScanPattern().Filter()
point_filter.max_number_of_returns_per_point = 2 # Set max number of returns to 2. The default value is 1.
point_filter.points_with_no_returns = True # Filter points with no returns. This reduces the dataset only to valid returns.
point_filter.delete_points_without_returns = True # Filter points with no returns. This reduces the dataset only to valid returns.

stream = device.get_point_cloud_stream(point_filter=point_filter, as_numpy=True) # Create a point cloud stream object
# Create a point cloud stream object
# The `as_numpy` flag enables the numpy support.
stream = device.get_point_cloud_stream(point_filter=point_filter, as_numpy=True)

for i in range(10):
frame, data = stream.recv_frame_as_numpy()
Expand Down
2 changes: 1 addition & 1 deletion protocol/blickfeld/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ message SoftwareVersion {

message HardwareModule {
optional string serial_number = 1 [(optional)=true, (regex) = "[A-Z2-7]{9}", (legacy_field_id)=2]; // Serial number of the hardware module
optional string legacy_serial_number = 2 [ deprecated=true ]; // Deprecated legacy serial number format
optional string legacy_serial_number = 2 [ deprecated=true, (optional)=true ]; // Deprecated legacy serial number format
optional string version = 3 [(optional)=true, (regex)="v[0-9]+\\.[0-9]+\\.[0-9]+"]; // Hardware version of the hardware module if available.
}

Expand Down
2 changes: 1 addition & 1 deletion protocol/blickfeld/config/scan_pattern.proto
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ message ScanPattern {
* In scenarios, where from one frame to another, all points have returns (e.g. due to environmental changes),
* the peak bandwidths might increase significantly. This could result, in these scenarios, in frame losses.
*/
optional bool points_with_no_returns = 6 [ default = false ];
optional bool delete_points_without_returns = 6 [ default = false ];
}

optional Horizontal horizontal = 1; // Refer to [ScanPattern.Horizontal](#blickfeld.protocol.config.ScanPattern.Horizontal)
Expand Down
11 changes: 9 additions & 2 deletions python/blickfeld_scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,21 @@ def record_point_cloud_stream(self, file_name, point_filter=None, reference_fram
return stream.raw(self.create_connection(), req, file_name)

@staticmethod
def file_point_cloud_stream(dump_filename):
def file_point_cloud_stream(dump_filename, as_numpy=False):
""" Request a point_cloud_stream, which streams off a .bfpc file.
No device (and connection to a device) is needed for this operation.
:param dump_filename: path to .bfpc file
:param as_numpy:
> Introduced in BSL v2.16
This enables numpy support of the point cloud stream. Use recv_frame_as_numpy() to fetch frames as numpy structured arrays.
Specify the required attributes via the reference_frame attribute.
Note: The performance of this option is significantly better with files that were recorded in the packed format. Packed recordings are available in firmware versions >= v1.17.
:return: :py:class:`blickfeld_scanner.scanner.stream.point_cloud` object
"""
return stream.point_cloud(from_file=dump_filename)
return stream.point_cloud(from_file=dump_filename, as_numpy=as_numpy)

def set_scan_pattern(self, config=None, name=None, persist = False):
""" Function to set a new scan pattern, see: :any:`protobuf_protocol`.
Expand Down
4 changes: 2 additions & 2 deletions tests/src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ INSTANTIATE_TEST_CASE_P(
simulate_record_and_read,
file_simulate_record_and_read,
::testing::Values(
"../tests/assets/dump.bfpc"
// "../tests/assets/packed_dump.bfpc"
"../tests/assets/dump.bfpc",
"../tests/assets/packed.bfpc"
));

0 comments on commit c3c0543

Please sign in to comment.