Wpilib rocks!


There are some bugs with projects that have a space in their filepath. Try moving it outside of “Code Projects” and into a path without spaces.



My path was changed so it doesn’t have spaces in it, however it’s still not working.

PS C:\Users\kinze\Desktop\SimRobot> cd 'c:\Users\kinze\Desktop\SimRobot'; ${env:DYLD_LIBRARY_PATH}='C:\Users\kinze\Desktop\SimRobot\build\tmp\jniExtractDir'; ${env:HALSIM_EXTENSIONS}='C:\Users\kinze\Desktop\SimRobot\libs\halsim_ds_socketd.dll;'; ${env:LD_LIBRARY_PATH}='C:\Users\kinze\Desktop\SimRobot\build\tmp\jniExtractDir'; ${env:PATH}='C:\Users\kinze\Desktop\SimRobot\build\tmp\jniExtractDir'; & 'C:\Users\Public\frc2019\jdk\bin\java' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:60196'
'-Djava.library.path=C:\Users\kinze\Desktop\SimRobot\build\tmp\jniExtractDir' '-Dfile.encoding=UTF-8' '-cp' 'C:\Users\kinze\Desktop\SimRobot\bin\main;C:\Users\Public\frc2019\maven\edu\wpi\first\wpilibj\wpilibj-java\2019.2.1\wpilibj-java-2019.2.1.jar;C:\Users\Public\frc2019\maven\edu\wpi\first\ntcore\ntcore-java\2019.2.1\ntcore-java-2019.2.1.jar;C:\Users\Public\frc2019\maven\edu\wpi\first\wpiutil\wpiutil-java\2019.2.1\wpiutil-java-2019.2.1.jar;C:\Users\Public\frc2019\maven\edu\wpi\first\thirdparty\frc2019\opencv\opencv-java\3.4.4-4\opencv-java-3.4.4-4.jar;C:\Users\Public\frc2019\maven\edu\wpi\first\cscore\cscore-java\2019.2.1\cscore-java-2019.2.1.jar;C:\Users\Public\frc2019\maven\edu\wpi\first\cameraserver\cameraserver-java\2019.2.1\cameraserver-java-2019.2.1.jar;C:\Users\Public\frc2019\maven\edu\wpi\first\hal\hal-java\2019.2.1\hal-java-2019.2.1.jar;C:\Users\kinze\.gradle\caches\modules-2\files-2.1\junit\junit\4.12\2973d150c0dc1fefe998f834810d68f278ea58ec\junit-4.12.jar;C:\Users\kinze\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest-core\1.3\42a25dc3219429f0e5d060061f71acb49bf010a0\hamcrest-core-1.3.jar' 'frc.robot.Main'
********** Robot program starting **********
Warning at edu.wpi.first.wpilibj.IteDefault disabledInit() method... Overload me!rativeRobotBase.printLoopO
verrunMessage(ItDefault disabledPeriodic() method... Overload me!era
tivDefault robotPeriodic() method... Overload me!eRobotBase.java:273):
 Loop time of 0.02s overrun

NT: server: client CONNECTED: port 60223
Watchdog not fed within 0.020000s
Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:273): Loop time of 0.02s overrun


I can’t get the connection to the driver station to work. I am up to date with the NI software and the WPIlib. I downloaded the libraries (halsim_ds_socket.dll, libhalsym_ds_socketd.dylib, libhalsim_ds_socketd.so) and put them in a folder called “libs” in my project folder. I added the dependencies in build.gradle. When I started up the simulation it asks me if I want to use the extension called “halsim_lofi.dll”, but not the one you gave before “halsim_ds_socketd.dll”. Is there something else I need to do? Since I am using 2019.3.2 is there anything differently I need to do?



For people who’s simulation doesn’t work, adding this line to build.gradle under dependencies worked for us

simulation "edu.wpi.first.halsim:halsim_ds_socket:${wpi.wpilibVersion}:${wpi.platforms.desktop}@zip"

WPILIB Simulation Doesn't Work with Driver Station

OK, I need some basic help getting simulations to even launch. I am guessing I am missing something basic, but since I can’t find any guides at all other than this thread on running simulations it could really be anything.

So, when I click “simulate robot code on desktop” my code compiles, then the terminal sits for a few minutes then eventually I get an error box stating “Failed to launch debuggee in terminal. Reason : com.sun.jdi.connect. TransportTimeoutException”.

Thoughts please :slight_smile:





Got it, excellent.



I am currently trying to get Snobot simulation working with our code and the above mentioned Driver Station HAL.
I am getting REALLY close, but not quite there yet and believe the comment above is related to my current issue, but not sure how to use the solution suggested (not really a Gradle/Java programmer, although 40+ years of software experience with micro-controllers/C/assembler etc…)
Here is what I have…
Compiled Snobot sim & extensions, made Jaci’s changes to build.gradle. Copied the required HAL DLLs to the project libs directory.
Everything compiles fine and desktop simulations start as expected. I get simulation feedback from the motor controller we are using as expected.
Our code has a drivetrain sub-system that has a default command that reads the joystick analogs and buttons to allow controlling the drive train when our semi-auto helper commands are not running, and this works great too. We get the joystick data for analogs and buttons and can correctly ‘control’ the motors. Note, the drivetrain default command calls methods in OI to retrieve joystick data, hence uses the same, single instance of the joysticks.
Now, we also have joystick button command trigger events in OI (whileHeld etc…) but these don’t seem to fire in simulation.
I know the joystick buttons are actually being sensed/read since I see specific button actions in the drivetrain default command, but the OI events attached to the same buttons don’t fire. (also have alternate buttons, no action either. In fact we normally don’t have duplicate button usage but added this for testing)
My guess is that the joystick button events are not causing interrupts and/or we need to manually do something to force them to trigger the OI events, and the comment above seems to be the solution, but I have no idea how to implement it.
Any help would be greatly appreciated.