Trying out WPI 2021.3 Desktop Simulation: Fails after 10 seconds with Error: "Need a positive DeltaTime!"

Hello everyone,
I am interested in WPI library Desktop Simulation to support our team.
I am trying out the simulation using the example code for “SimpleDifferentialDriveSimulation” and the simulation terminates with the message “Need a positive DeltaTime!” (Detailed terminal log is below)

I’ve read the documentation and cannot determine why the simulation is terminating.
(Robot Simulation — FIRST Robotics Competition documentation)

Any ideas?

I am running Windows 10 (Build 1890) within a VM. [ I have also recreated within a VM on Windows 10 build 1908 ]

==(Setup) =======================================
Installed:
ni-frc-2020-game-tools_20.0.1_offline.iso
WPILib_Windows64-2021.3.1.iso
WPILib-VSCode-1.52.1.zip

Inside of VSCode:
wpilibsuite.vscode-wpilib = Version 2021.3.1

=(Recreation)=========================
Steps to recreate the error:

(W) - Create a new Project
Example > JAVA > SimpleDifferentialDriveSimulation
Folder: C:_Robotics\2021
Project Name: SimpleDiffDriveSimulation
Team: 1895
Enabled Desktop Simulation
Generate Project (in current window)

Expanded out source code and opened “Main.java”

Observation: In the background, the build was successful

(W) - Simulate Robot code on the desktop
Selected both options (halsim_gui.dll & halsim_ds_socket.dll )

Simulation GUI appears for about 10 seconds then drops

===(Terminal Log)==================

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:_Robotics\2021\SimpleDiffDriveSimulation> ${env:HALSIM_EXTENSIONS}='C:_Robotics\2021\SimpleDiffDriveSimulation\build\tmp\expandedArchives\halsim_gui-2021.3.1-windowsx86-

64.zip_323ba05d82fed35fbc1ea2c04141a0a5\windows\x86-64\shared\halsim_gui.dll;C:_Robotics\2021\SimpleDiffDriveSimulation\build\tmp\expandedArchives\halsim_ds_socket-2021.3.1-windowsx86-

64.zip_5f77b11b08590618ca2ba5550844833c\windows\x86-64\shared\halsim_ds_socket.dll;’; ${env:PATH}=‘C:_Robotics\2021\SimpleDiffDriveSimulation\build\tmp\jniExtractDir’; &

‘C:\Users\Public\wpilib\2021\vscode\data\extensions\vscjava.vscode-java-debug-0.30.0\scripts\launcher.bat’ ‘C:\Users\Public\wpilib\2021\jdk\bin\java.exe’ '-

agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:49849’ ‘-Djava.library.path=C:_Robotics\2021\SimpleDiffDriveSimulation\build\tmp\jniExtractDir’ '-Dfile.encoding=UTF

-8’ ‘@C:\Users\ADMINI~1.O-7\AppData\Local\Temp\cp_cad3qgmfydgmv5bmtfw9pijpa.argfile’ ‘frc.robot.Main’
chcp.com’ is not recognized as an internal or external command,
operable program or batch file.
HAL Extensions: Attempting to load: halsim_gui
Simulator GUI Initializing.
Simulator GUI Initialized!
HAL Extensions: Successfully loaded extension
HAL Extensions: Attempting to load: halsim_ds_socket
DriverStationSocket Initializing.
DriverStationSocket Initialized!
HAL Extensions: Successfully loaded extension
********** Robot program starting **********
Default simulationInit() method… Override me!
Default disabledInit() method… Override me!
Default disabledPeriodic() method… Override me!
Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301): Loop time of 0.02s overrun

Warning at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): SmartDashboard.updateValues(): 0.000000s
disabledInit(): 0.001129s
disablePeriodic(): 0.000000s
robotPeriodic(): 0.000000s
LiveWindow.updateValues(): 0.077928s
Shuffleboard.update(): 0.000044s

Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301): Loop time of 0.02s overrun

Warning at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): SmartDashboard.updateValues(): 0.000041s
disablePeriodic(): 0.000551s
robotPeriodic(): 0.000114s
LiveWindow.updateValues(): 0.039029s
Shuffleboard.update(): 0.000022s

Assertion failed: (g.IO.DeltaTime > 0.0f || g.FrameCount == 0) && “Need a positive DeltaTime!”, file D:\a\thirdparty-imgui\thirdparty-imgui\imgui\imgui.cpp, line 6867
PS C:_Robotics\2021\SimpleDiffDriv

==============================================

Can you please verify that an empty/simple project works on your setup, such as the empty template or the ArcadeDrive example?

The error seems to be from the SimGUI’s backing library. This shouldn’t be happening due to problematic code, I suspect that this is because of the VM. Running an empty project (or one that doesn’t mess with simulation) would verify this.


FYI, the only thing that needs Windows is the DS (if you’re using Java/C++) - everything else is cross-platform, including the SimGUI. Assuming that you’re regularly booting Linux/macOS, you can just run everything on your machine without the VM.

Although there is a slight “gotcha”: some of the vendor libraries don’t support all OSes, particularly MacOS. At least that was true ~6 months ago.

This seems likely. I’ve not run this code in a VM, but I have seen other code fail in a VM due to clock weirdness.

Thank you for the suggestions.
I’ll retest on a real 64bit Windows 10 laptop this evening.
I’ve been running FRC/WPI code in virtual machines for years without issues. I don’t think this is the problem but will be glad to eliminate this question. The simulation capability is new, so I want to try it out. (I spent a lot of time on the FRCSIM years ago.)

I use VMs to keep my primary Windows laptop clean. Many programs are messy and leave junk on your Windows. Spinning up a new VM is easy and removing old stuff simple.

I’ll provide feedback to tomorrow.
Dave Frederick,
Team 1895, Manassas VA

You were right.
Virtualization under VMware workstation 9 caused the issue.
However, virtualizing the FRC/WPI 2021 simulation under VMWare Workstation 15 works fine.

I installed the FRC/WPI 2021 simulation on a real laptop and it worked fine. The simulator kept running and did not crash.

I normally perform my software checkouts on a dedicated virtualization server in my basement running VMware workstation 9 which I access via RDP. Never had an issue in the past.
I run VMWare workstation 15 on my high performance dell windows laptop but due to disk space limitations, do most of my work on the dedicated server.

I installed the FRC/WPI 2021 simulation on a Win 10 VM under VMWare 15 and it works fine.
I’ll keep working with the simulations in support my team in the fall.

Thank you for the suggestions.
Dave Frederick
Team 1895 Manassas, VA