Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running ouster-cli benchmark-sensor <any_sensor_here> fails with python runtime error #605

Open
wimos-ai opened this issue Jul 24, 2024 · 1 comment · May be fixed by #606
Open

Running ouster-cli benchmark-sensor <any_sensor_here> fails with python runtime error #605

wimos-ai opened this issue Jul 24, 2024 · 1 comment · May be fixed by #606
Assignees
Labels
bug Something isn't working

Comments

@wimos-ai
Copy link

Describe the bug
A runtime error in python.

To Reproduce

  1. compile the project
  2. get a sensor
  3. Verify connection to sensor via a browser
  4. Determine sensor IP or hostname
  5. run ouster-cli util benchmark-sensor <hostname_or_ip
  6. Get an error message saying object has no atribute

Screenshots
image

Platform (please complete the following information):

  • Ouster Sensor? OS-2
  • Ouster Firmware Version? 2.5
  • Programming Language? Bash / Python
    • 3.9
  • Operating System? Windows and Linux.
  • Machine Architecture? x86-64
  • git commit hash: Latest and whatever version is in Python Package Index right now
@wimos-ai wimos-ai added the bug Something isn't working label Jul 24, 2024
wimos-ai added a commit to wimos-ai/ouster_example that referenced this issue Jul 24, 2024
@wimos-ai wimos-ai linked a pull request Jul 24, 2024 that will close this issue
@twslankard twslankard self-assigned this Jul 24, 2024
@twslankard
Copy link
Collaborator

Thanks for the report @wimos-ai !

A fix for this issue is in review and will be part of our next patch release.

Here's a patch you may be able to use in the interim.

diff --git a/python/src/ouster/cli/core/util.py b/python/src/ouster/cli/core/util.py
index edd74a80..0e1ee3db 100644
--- a/python/src/ouster/cli/core/util.py
+++ b/python/src/ouster/cli/core/util.py
@@ -32,7 +32,8 @@ from ouster.sdk import client
 from ouster.sdk.util import resolve_metadata
 
 from ouster.sdk.sensor import SensorMultiPacketReader
-from ouster.sdk.client import ScansMulti, PacketMultiSource, PacketMultiWrapper
+from ouster.sdk.client import ScansMulti, PacketMultiSource, PacketMultiWrapper, PacketFormat
+from ouster.sdk.client.data import ColHeader
 
 from ouster.sdk.sensor.util import configure_sensor_multi
 
@@ -437,7 +438,6 @@ def benchmark_sensor(hostname: str, lidar_port: Optional[int],
         click.echo(f"sensor [{idx}] = ")
         click.echo(f"  {'Model':<20}: {meta.prod_line} {meta.fw_rev} {meta.mode}")
         click.echo(f"  {'SN':<20}: {meta.sn}")
-        click.echo(f"  {'hostname':<20}: {meta.hostname}")
         for prop in [
                 "udp_dest", "udp_port_lidar", "udp_port_imu", "lidar_mode",
                 "azimuth_window", "udp_profile_lidar"
@@ -463,6 +463,9 @@ def benchmark_sensor(hostname: str, lidar_port: Optional[int],
     columns_per_packet = [
         m.format.columns_per_packet for m in packet_source.metadata
     ]
+    pf = [
+        PacketFormat(m) for m in packet_source.metadata
+    ]
 
     xyzlut = [client.XYZLut(info) for info in packet_source.metadata]
 
@@ -553,7 +556,8 @@ def benchmark_sensor(hostname: str, lidar_port: Optional[int],
             if isinstance(obj, client.LidarPacket):
                 # no scan batching branch
                 packet = obj if not copy_data else deepcopy(obj)
-                packet_num = int(packet.measurement_id[0] / columns_per_packet[idx])
+                packet_num = int(pf[idx].packet_header(ColHeader.MEASUREMENT_ID, packet.buf)[0]
+                    / columns_per_packet[idx])
 
                 total_packets[idx] += 1
 

Cheers,

Tom Slankard
Staff Engineer
Ouster Inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants