Open katzuv opened 5 years ago
Poor/outdated documentation, Sorry about that. Your dependency block should probably look something like this:
dependencies {
compile wpi.deps.wpilib()
compile wpi.deps.vendor.java()
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
testCompile 'junit:junit:4.12'
// SnobotSim
snobotSimCompile snobotSimJava()
}
I would always check the examples for the recommended layout. I use those to test the simulator before a release, and release updates to both at the same time, so that is pretty much guaranteed to be up to date. I can get lax on the wiki page.
This is probably the best one to look at
I am having similar issues building. I can't even build the examples, so obviously something wrong with my setup and not the files themselves. I have cloned the examples, opened, for example "JavaWithVendorLibraries" then execute wpilib:Simulate robot code on desktop. The build starts but eventually fails with the following error...
FAILURE: Build failed with an exception.
Where: Build file 'C:\Users\a0212178\Desktop\WW\FRC2019\RobotCode\SnobotSimExamples\JavaWithVendorLibraries\build.gradle' line: 4
What went wrong: Plugin [id: 'com.snobot.simulator.plugin.SnobotSimulatorPlugin', version: '2019-0.2.0', apply: false] was not found in any of the following sources:
Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
Plugin Repositories (could not resolve plugin artifact 'com.snobot.simulator.plugin.SnobotSimulatorPlugin:com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin:2019-0.2.0') Searched in the following repositories: MavenLocal(file:/C:/Users/a0212178/.m2/repository) Gradle Central Plugin Repository frcHome(file:/C:/Users/Public/frc2019/maven/)
Any thoughts/ideas where to start?
BR, Steve
OK, done a completely clean install of VSCode to try to address some other issues and tried this again. Cloned Snobot from git, opened the Snobot folder in VS Code, selected build robot code but get the following error...
FAILURE: Build failed with an exception.
Where: Build file 'C:\Users\a0212178\Desktop\WW\FRC2019\RobotCode\SnobotSim\build.gradle' line: 20
What went wrong: Plugin [id: 'net.ltgt.errorprone', version: '0.6', apply: false] was not found in any of the following sources:
Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
Plugin Repositories (could not resolve plugin artifact 'net.ltgt.errorprone:net.ltgt.errorprone.gradle.plugin:0.6') Searched in the following repositories: Gradle Central Plugin Repository
Any thoughts please?
BR, Steve
@WWRC-FRC You should be using a newer plugin. I might not have updated the examples, I've been on work travel forever. Here are some recommended settings
plugins {
id "java"
id "idea"
id "eclipse"
id "jacoco"
id "edu.wpi.first.GradleRIO" version "2019.4.1"
id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2019-2.0.0" apply false
}
If you are using REV SparkMax's, you will need to add this in
/////////////////////////////////////////////////////
// Snobot Sim
apply plugin: com.snobot.simulator.plugin.SnobotSimulatorPlugin
snobotSim {
snobotSimRevVersion = "1.1.8_V0"
snobotSimVersion = "2019-1.2.0"
}
// End Snobot Sim
/////////////////////////////////////////////////////
And in your dependencies block (which hasn't changed in 2019)
// SnobotSim
snobotSimCompile snobotSimJava()
This may or may not be closed source at the moment. I don't think I have the permissions to open it up, but here is what my team has https://gitlab.com/XCats/Software/software-2019/blob/dev/DeepSpace2019/build.gradle
First, Thanks for the response. Very much appreciated :) Work can often get in the way !!! Looking at your examples, e.g. JavaCommandBased the plugins section contains the following... plugins { id "java" id "edu.wpi.first.GradleRIO" version "2019.4.1" id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2019-0.2.0" apply false }
We are not using SparkMax, but I added it just as a test. The dependencies are already there too. After adding the SparkMax and building JavaCommandBased I still get the same error :( Whilst I have been programming for 40+ years I am not too familiar with Java or Gradle etc... so most of this framework setup is new to me and I have likely (obviously) missed something along the way. As a final test I cloned your team code and STILL get the same error when I try to build robot code, so obviously I am missing some configuration or setup step :( What went wrong: Plugin [id: 'com.snobot.simulator.plugin.SnobotSimulatorPlugin', version: '2019-2.0.0', apply: false] was not found in any of the following sources:
Sanity checks:
That seems like a weird error, is that what is coming directly from the console? If not could you post that and put it in a code/quote block?
I just checked the plugin, the gradle website is showing that 2019.2.0.0 is there and is the latest https://plugins.gradle.org/plugin/com.snobot.simulator.plugin.SnobotSimulatorPlugin
If your code is open source and on github/gitlab I can take a look at the build file and structure to see if anything jumps out
Online, yes, but company firewall might be causing issues, although I can access "https://plugins.gradle.org/plugin/com.snobot.simulator.plugin.SnobotSimulatorPlugin" from a browser so don't think it is blocked. The error message is copied and pasted directly from the terminal window. Regarding code, I can't even get either your examples nor your team code to build, so I don't think it is a code issue per-se. I figured if I can't get your code/examples working then I have bigger issues :) Regarding Gradle version... not 100% sure, but just gone through a completely clean install on this computer so expect I have the latest. How do I check? (As I said, virtually zero experience with the frameworks) I will try to duplicate the issue at home tonight but I think the issue is computer specific anyhow. I just can't seem to work out what I have missed on this computer :( Are there any logs that might be helpful and/or provide more details on what is/is not going on? Finally, again I really appreciate you taking the time to respond :)
Here is the terminal message in its entirety...
Executing task: gradlew build -Dorg.gradle.java.home="C:\Users\Public\frc2019\jdk" <
FAILURE: Build failed with an exception.
* Where: Build file 'C:\Users\a0212178\Desktop\WW\FRC2019\RobotCode\software-2019\DeepSpace2019\build.gradle' line: 7
* What went wrong: Plugin [id: 'com.snobot.simulator.plugin.SnobotSimulatorPlugin', version: '2019-2.0.0', apply: false] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (could not resolve plugin artifact 'com.snobot.simulator.plugin.SnobotSimulatorPlugin:com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin:2019-2.0.0') Searched in the following repositories: MavenLocal(file:/C:/Users/a0212178/.m2/repository) Gradle Central Plugin Repository frcHome(file:/C:/Users/Public/frc2019/maven/)
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s The terminal process terminated with exit code: 1
Typically when I point to an invalid release, or am not online it dumps out the website addresses it tries to crawl rather than "Gradle Central Plugin Repository". Might be gradle version, might be because that is usually dependencies rather than plugins...
I would definitely try on a less locked down computer. I remember when Jaci was trying to set up GradleRIO and managing her own maven repo for CTRE/NavX stuff people were having trouble reaching a server in Australia. I can tell you that the (somewhate outdated) examples build with a CI tool (minus the ever broken C++ simulations), as does my teams code.
There are probably better ways to check the gradle version, but the quick and dirty way I typically do is look at <project_root>/gradle\wrapper\gradle-wrapper.properties
So, here at home I can build everything and the simulations seem to run fine on my home computer:) The issue is (as expected) something specific about my work computer, which unfortunately is the one I would really prefer to work on. Do you know if there is a way to offline install everything necessary since I assume that once installed I shouldn't need a connection to anything afterwards. My concern is that the school connection may also block something necessary. I might have to try bringing my work laptop home and temporarily bypassing the DNS rules to see if I can get things to build that way. I just now need to work out how to connect with driver station :) In VSCode I see a set of threads running including one called "FRCDriverStation" which is what I assume is trying to talk with the NI Driver Station, but NI Driver Station can't communicate with the simulated robot. Time to carry on Googling :) As always, your help and time are very much appreciated.
Managed to get the simulator running with Driver Station at last :) Still having an issue with what appears to be commands not running when joystick buttons are pressed but will need to check if this is a simulation issue or if something is actually wrong with our code. I have been re-structuring a lot of things to hopefully make the code better structured and testable so not had chance to actually push to a robot yet, so I might have broken something.
The simulator actually simulates the drive train. I experimented with using the WPI tool that would use the real driver station, but it wasn't ready by the start of the season.
You can tell the simulator what joysticks to use (including the ability to use the keyboard as a mock joystick)
Thanks. Will look into that more. Any pointers on configuring/using the simulation joystick?
BR, Steve
Describe the bug Describe the issue you are seeing with the simulator
Quick Glance Configuration Please provide the following information
To Reproduce Please information on when the issue occurs, and/or what you did to cause the issue to surface. i.e.
gradlew build
)? yesgradlew runSnobotSim
)? yesExpected behavior The code will build
Detailed Setup
Stacktrace:
Why is the simulator not building? Thanks a lot!