Monday, May 6, 2019

Export Velodyne PCAP to LAS files in VeloView

VeloView is an open source application for working with Velodyne's popular LiDAR sensors (HDL-64E, HDL-32E, VLP-16 etc.). It is available from this website https://www.paraview.org/veloview/.

VeloView has an export to LAS file format command but you would not know it as it is not available from the graphical user interface. To generate LAS files, it is necessary to use the Python command line interface. The steps below show how it can be done.
  1. Run VeloView and load a Velodyne PCAP file.

  2. Choose Tools | Python Console.

    The Python Console appears.
  3. To export out the current frame, type in the following command at the Python prompt.

    >>> vv.saveLASCurrentFrame('c:/path/to/output.las', 0)

    Note 1: the last argument indicates the coordinate transformation mode. 0 = raw, 1 = absolute, 2 = relative.
    Note 2: Replace c:/path/to/ with your actual file system path
  4. To export a range of frames by frame numbers, type in the following command at the Python prompt.

    >>> vv.saveLASFrames('c:/path/to/output.las', 10, 20, 0)

    Note: in this example, 10 is the starting frame, 20 is the ending frame, and 0 is the raw transformation mode.
  5. To export a list of frames by time steps, type in the following command at the Python prompt.

    >>> vv.saveLAS('c:/path/to/output/las', timesteps, 0)

    Note: timesteps is an array of integers specifying the time steps e.g. [0,1,2,...10] and 0 is the raw transformation mode.

    To get the available time steps in the PCAP file, type in the following command at the Python prompt.

    >>> timesteps = vv.getCurrentTimesteps()
  6. Optional. Display the resultant LAS file in a viewer.

8 comments:

Unknown said...

I am unable to get this feature working properly. Upon loading the velodyne (hi-res) in the VeloView software (3.5.0, 64bit), I attempt to save the current frame via vv.saveLASCurrentFrame() function. The function, along with the other LAS functions, throws a AttributeError: 'NoneType' object has no attribute 'GetClientSideObject' from the getPosition().GetClientObject().GetOutput() call in applogic.py (line 783).

Any thoughts?

dominoc925 said...

That's weird. No idea, maybe it is something with the Python installation. Maybe you can open an issue on the Veloview github site.

Unknown said...

When I run the script it says this:

>>> vv.saveLASCurrentFrame('c:/path/to/output.las', 0)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'saveLASCurrentFrame'

Please Help. I really need to convert .pcap file to las

dominoc925 said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by a blog administrator.
Unknown said...
This comment has been removed by a blog administrator.
dominoc925 said...
This comment has been removed by the author.
dominoc925 said...

@Unknown, please replace the c:/path/to/output.las in the command with your actual file path.