Reality Scan CLI -importLaserScan and -importLaserScanFolder broken paths.

Hello!

We are having some issues with importing laser scans via the CLI. It works normally via the GUI with the correct relative paths from the input folder.

When running the following commands, it does not generate the lsp files in the correct directory (or anywhere, I can’t find them) or set the paths correctly in the rsproj file.

RS Version: 2.0.1.118647

Folder:

-headless -stdConsole -load C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj -importLaserScanFolder C:\Users\Tim\Downloads\ImagesAndLaser\root\LiDAR C:\Users\Tim\Downloads\ImagesAndLaser\laser\LASERCONFIG.xml -save C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj -quit

Output:

RealityScan 2.0.1.118647 RS (c) Epic Games Slovakia s.r.o. Using 24 CPU cores and process 25940. Executing command ‘load’ with parameter ‘C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj’ Added 0 images. Loading Project completed in 0.023 seconds. Loading Project completed in 0.077 seconds. Executing command ‘importLaserScanFolder’ with parameters ‘C:\Users\Tim\Downloads\ImagesAndLaser\root\LiDAR C:\Users\Tim\Downloads\ImagesAndLaser\laser\LASERCONFIG.xml’ Importing 1 file(s) Imported ‘setOffice_doorsOpen_PTX_lidarFiles_0.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_1.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_2.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_3.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_5.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_6.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_7.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_8.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_9.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_10.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_11.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_12.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_13.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_14.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_15.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_16.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_17.lsp’ Importing LiDAR Point Cloud completed in 43.431 seconds. Importing LiDAR Point Cloud completed in 43.452 seconds. Executing command ‘save’ with parameter ‘C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj’ Saving Project completed in 0.032 seconds. Executing command ‘quit’

Direct path:

-headless -stdConsole -load C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj -importLaserScan C:\Users\Tim\Downloads\ImagesAndLaser\root\LiDAR\setOffice_doorsOpen_PTX_lidarFiles.ptx C:\Users\Tim\Downloads\ImagesAndLaser\laser\LASERCONFIG.xml -save C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj -quit

Output:

RealityScan 2.0.1.118647 RS (c) Epic Games Slovakia s.r.o. Using 24 CPU cores and process 3532. Executing command ‘load’ with parameter ‘C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj’ Added 0 images. Loading Project completed in 0.014 seconds. Loading Project completed in 0.080 seconds. Executing command ‘importLaserScan’ with parameters ‘C:\Users\Tim\Downloads\ImagesAndLaser\root\LiDAR\setOffice_doorsOpen_PTX_lidarFiles.ptx C:\Users\Tim\Downloads\ImagesAndLaser\laser\LASERCONFIG.xml’ Importing 1 file(s) Imported ‘setOffice_doorsOpen_PTX_lidarFiles_0.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_1.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_2.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_3.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_5.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_6.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_7.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_8.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_9.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_10.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_11.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_12.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_13.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_14.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_15.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_16.lsp’ Imported ‘setOffice_doorsOpen_PTX_lidarFiles_17.lsp’ Importing LiDAR Point Cloud completed in 43.303 seconds. Importing LiDAR Point Cloud completed in 43.329 seconds. Executing command ‘save’ with parameter ‘C:\Users\Tim\Downloads\ImagesAndLaser\root\RealityCapture\LaserOnly.rsproj’ Saving Project completed in 0.046 seconds. Executing command ‘quit’

It occurs with or without specifying a param.xml file.

Here is a copy of the rsproj file generated:

<RealityScan version="2.0.1.118647" sceneRevision="17" sceneId="{F832D5B8-C89F-4E55-88E6-C07E9D7211A3}">
    <certificates>
    </certificates>
    <coordinates>
        <projectCoordinates index="-1"/>
    </coordinates>
    <overrides>
        <rename type="rig" id="{1E204070-A17D-444E-9455-493C15B37B93}" name="Point clouds"/>
        <rename type="rigInstance" id="{0FEB46F9-499F-4035-B83A-57E480067CE1}" name="Scan {0FEB46F9-499F-4035-B83A-57E480067CE1}"/>
        <rename type="rigInstance" id="{CDEAEC07-AF3F-4EDF-AA2D-6B1E176B4FCB}" name="Scan {CDEAEC07-AF3F-4EDF-AA2D-6B1E176B4FCB}"/>
        <rename type="rigInstance" id="{95393EA6-F213-4666-B3DC-E3D4A35648AD}" name="Scan {95393EA6-F213-4666-B3DC-E3D4A35648AD}"/>
    </overrides>
    <source>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_0.lsp" width="2458" height="2458" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_1.lsp" width="2458" height="2458" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_2.lsp" width="2458" height="2458" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_3.lsp" width="2458" height="2458" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_5.lsp" width="2458" height="2458" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_6.lsp" width="2540" height="2540" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_7.lsp" width="2540" height="2540" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_8.lsp" width="2540" height="2540" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_9.lsp" width="2540" height="2540" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_10.lsp" width="2540" height="2540" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_11.lsp" width="2540" height="2540" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_12.lsp" width="2492" height="2492" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_13.lsp" width="2492" height="2492" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_14.lsp" width="2492" height="2492" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_15.lsp" width="2492" height="2492" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_16.lsp" width="2492" height="2492" imageColorsWeight="0.010000" flags="131072"/>
        <input fileName="..\..\..\..\..\..\..\setOffice_doorsOpen_PTX_lidarFiles_17.lsp" width="2492" height="2492" imageColorsWeight="0.010000" flags="131072"/>
    </source>
    <entities name="entities" fileName="LaserOnly\entities1.dat"/>
    <animation fileName="LaserOnly\animation1.dat"/>
    <controlpoints fileName="LaserOnly\controlpoints1.dat"/>
    <appConfig fileName="LaserOnly\appConfig1.dat" />
</RealityScan>

It looks like the CLI command uses C:\ drive as the path location for the lsp files when generating via the CLI instead of the relative input path.

I have confirmed that it works fine in older versions of Reality Capture.

Would you be able to help us?

Thank you!

Hello @Thorlon1
Thank you for reporting this.
I was testing it and I found a bug (but I was using the commands only in the console view, in that case the laser scans weren’t imported at all). Checking your files it looks like they were imported. Can you conform that?
As you are opening already saved project, what is the content of this project, as it is called LaserOnly and you are importing the laser scans after opening it?

Hello Ondrej!

Thank you for your reply. I think you may have misunderstood the debug information I provided. You are correct that the bug you experienced is similar to what I encountered as well. Via the CLI it attempts to add (and shows in the stdout that its creating the lsp files.) but it incorrectly configured the paths to the lsp files. See my RC file above with the “dot dot slash” etc

I will explain in more detail the exact replication steps for this issue. Let me know if I can provide any more files that are generated by RS.

None of this occurs via the GUI or interface, it’s all via the CLI:

  1. I create a blank project file with -save path/LaserOnly.rsproj

RS.exe -headless -stdConsole -disableOnlineCommunication -set appQuitOnError=true -writeProgress progress[job].txt -set appIncSubdirs=true -save [projectPath] -quit

This creates a blank project with nothing in it.

  1. I run a second CLI command that attempts to add the laser scans and generate the lsp files.

-headless -stdConsole -disableOnlineCommunication -set appQuitOnError=true -writeProgress progress[job].txt -load [projectPath] -importLaserScanFolder [lidarFolderPath] -save [projectPath] -quit

This attempts to run the import of the ptx file.

It “succeeds” - see in the above debug logs with the lsp files being generated. But the PATHS are wrong.

  1. When I attempt to open the project file (either with another CLI command or via the GUI interface) the next time it asks me to find the missing lsp files (which dont exist).

I believe there is an issue with the CLI itself not correctly deciding the path to generate the lsp files. This is my guess :slight_smile:

Is there any other information i can provide?

Thank you!

Hi, I haven’t misunderstood your information. I was just testing it directly. There shouldn’t be a difference between CLI in the app or using BAT files.
Now I recreated your whole process and I am getting the same error as before. For me it ends with Access denied error. As I wrote, the bug for that is created. I will try to reproduce also your issue on the fixed version.

Hello, RS dev here. With Ondrej’s help I was able to reproduce it, and it will be fixed in RS 2.1.
Workaround for the time being: as you have correctly noted, the issue is that RS is trying to save the LSP files with path like “filename.lsp” (i.e. no drive, no folders, nothing). This is understood by Windows as a relative path; i.e. the file will be stored in RealityScan’s directory (something like C:\Program Files\Epic Games\RealityScan_2.0). If the current user doesn’t have permission to store files in that folder, then you get “Access denied” (what happened to Ondrej). So the workaround is like this:

  1. Obtain permissions to write into RealityScan’s directory, or move it somewhere you have permission to write. Or change the CWD of the RealityScan being run.
  2. Run RC, import your laserscans, but don’t save the project (the project file will have wrong file paths)
  3. Create new project and add the LSPs from RealityScan’s working directory.