GithubHelp home page GithubHelp logo

open-rio / toastapi Goto Github PK

View Code? Open in Web Editor NEW
73.0 73.0 12.0 2.89 MB

An Open Source robot API for FRC - The Best thing since Sliced Bread

License: MIT License

Java 97.69% Ruby 0.41% JavaScript 1.89% Batchfile 0.01%

toastapi's People

Contributors

bb010g avatar floogulinc avatar jacibrunning avatar loadingpleasewait avatar m3rcuriel avatar philanatidae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toastapi's Issues

Simulation Crash opening Talon Window

If the Talons are given power before the window is opened, and the user attempts to open the Window after the Simulation GUI crashes.

Full Crash Report:

 ________    ______                 __   
((       )  /_  __/___  ____ ______/ /_  
||  o o  |   / / / __ \/ __ `/ ___/ __/  
||   3   |  / / / /_/ / /_/ (__  ) /_    
\\_______/ /_/  \____/\__,_/____/\__/    

[09/02/16-01:47:11] [Toast] [Bootstrap] [INFO] Toast Version: 2.4.4
[09/02/16-01:47:11] [Toast] [Bootstrap] [INFO] Toast Commit Hash: 074932c
[09/02/16-01:47:11] [Toast] [Core-Initialization] [INFO] Toast Started with Run Arguments: [-sim]
[09/02/16-01:47:11] [Toast] [Pre-Initialization] [INFO] Slicing Loaf...
[09/02/16-01:47:14] [Toast] [Initialization] [INFO] Nuking Toast...
platform: /Mac OS X/x86_64/
[09/02/16-01:47:15] [Toast] [Pre-Start] [INFO] Buttering Bread...
[09/02/16-01:47:15] [Toast|Loader] [Pre-Start] [INFO] Module Loaded: Mr. Roboto - Team 5933 - Main Robot [email protected]
[09/02/16-01:47:15] [Toast|Loader] [Pre-Start] [INFO] Module Loaded: Like A Record - Team 5933 - Motor [email protected]
[09/02/16-01:47:15] [Toast|Loader] [Pre-Start] [INFO] Module Loaded: Electric Feel - Team 5933 - Rumble [email protected]
[09/02/16-01:47:15] [Toast] [Start] [INFO] Fabricating Sandwich...
[09/02/16-01:47:15] [Toast] [Start] [INFO] Verdict: Hot, Hot, HOT!!
[09/02/16-01:47:15] [Toast] [Main] [INFO] Total Initiation Time: 4.378 seconds
Robot Drive... Output not updated often enough.
**** CRASH LOG ****
Your robot has crashed. Following is a crash log and more details.
This log has been saved to: /Users/kepler/Developer/Judgement Call/Mr. Roboto/run/gradle/simulation/toast/crash/crash-2016-02-09_01-48-38.txt
This log will also be duplicated to USB devices, with the filename: crash-2016-02-09_01-48-38.txt
 ________     __  ____       ____  __
((       )   / / / / /_     / __ \/ /_
||  x x  |  / / / / __ \   / / / / __ \
||   ^   | / /_/ / / / /  / /_/ / / / /
\\_______/ \____/_/ /_/   \____/_/ /_/

java.lang.NullPointerException
    at jaci.openrio.toast.core.loader.simulation.srx.GuiSRX.update(GuiSRX.java:46)
    at jaci.openrio.toast.core.loader.simulation.srx.GuiSRX$$Lambda$27/1388693377.run(Unknown Source)
    at jaci.openrio.toast.core.loader.simulation.srx.SRX_Reg$SRX_Wrapper.update(SRX_Reg.java:36)
    at jaci.openrio.toast.core.loader.simulation.srx.SRX_Reg$SRX_Wrapper.setVBus(SRX_Reg.java:57)
    at edu.wpi.first.wpilibj.hal.CanTalonJNI.Set(CanTalonJNI.java:143)
    at edu.wpi.first.wpilibj.CANTalon.set(CANTalon.java:430)
    at edu.wpi.first.wpilibj.CANTalon.set(CANTalon.java:491)
    at edu.wpi.first.wpilibj.RobotDrive.setLeftRightMotorOutputs(RobotDrive.java:632)
    at edu.wpi.first.wpilibj.RobotDrive.arcadeDrive(RobotDrive.java:480)
    at edu.wpi.first.wpilibj.RobotDrive.arcadeDrive(RobotDrive.java:369)
    at edu.wpi.first.wpilibj.RobotDrive.arcadeDrive(RobotDrive.java:383)
    at frc.team5933.motors.Drive.arcadeDrive(Drive.java:48)
    at frc.team5933.motors.MotorControl.teleopPeriodic(MotorControl.java:58)
    at jaci.openrio.toast.lib.module.IterativeModule.tickState(IterativeModule.java:30)
    at jaci.openrio.toast.core.StateTracker.tick(StateTracker.java:130)
    at jaci.openrio.toast.core.StateTracker.init(StateTracker.java:102)
    at jaci.openrio.toast.core.Toast.startCompetition_2(Toast.java:123)
    at jaci.openrio.toast.core.Toast.startCompetition(Toast.java:88)
    at jaci.openrio.toast.core.ToastBootstrap.fakeRobotBase(ToastBootstrap.java:247)
    at jaci.openrio.toast.core.ToastBootstrap.main(ToastBootstrap.java:210)

Crash Information: 
    Toast: 
        Toast Version: 2.4.4
        Loaded Modules:
            Mr. Roboto - Team 5933 - Main Robot [email protected]
            Like A Record - Team 5933 - Motor [email protected]
            Electric Feel - Team 5933 - Rumble [email protected]

    Environment: 
            Toast: 2.4.4
              Git: 074932c (074932cf75491f81829aa387c16ff92268797f83)
             Type: Simulation
              FMS: false
               OS: Mac OS X 10.11.1 (x86_64)
             Java: 1.8.0_45 (Oracle Corporation)
        Java Path: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
          JScript: Supported (Nashorn)

    Modules: 
        Mr. Roboto - Team 5933 - Main Robot Module
            Name: Mr. Roboto - Team 5933 - Main Robot Module
            Version: 0.1.1
            File: /Users/kepler/Developer/Judgement Call/Mr. Roboto/run/gradle/simulation/toast/modules/Mr. Roboto - Main Robot Module.jar
            Bypass Class: null
            Core Module Class: null
            Owned Packages: 
                frc.team5933
                com
                edu.wpi.first.wpilibj
                jaci.openrio
        Like A Record - Team 5933 - Motor Control
            Name: Like A Record - Team 5933 - Motor Control
            Version: 0.1.0
            File: /Users/kepler/Developer/Judgement Call/Mr. Roboto/run/gradle/simulation/toast/modules/Mr. Roboto - Main Robot Module.jar
            Bypass Class: null
            Core Module Class: null
            Owned Packages: 
                frc.team5933
                com
                edu.wpi.first.wpilibj
                jaci.openrio
        Electric Feel - Team 5933 - Rumble Feedback
            Name: Electric Feel - Team 5933 - Rumble Feedback
            Version: 0.1.0
            File: /Users/kepler/Developer/Judgement Call/Mr. Roboto/run/gradle/simulation/toast/modules/Mr. Roboto - Main Robot Module.jar
            Bypass Class: null
            Core Module Class: null
            Owned Packages: 
                frc.team5933
                com
                edu.wpi.first.wpilibj
                jaci.openrio


*******************

Repo with Crashing Code

Getting more done in GitHub with ZenHub

Hola! @JacisNonsense has created a ZenHub account for the Open-RIO organization. ZenHub is the leading team collaboration and project management solution built for GitHub.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • “+1” button for GitHub issues and comments;
  • Drag-and-drop file sharing;
  • Time-saving shortcuts like a quick repo switcher.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @JacisNonsense.

ZenHub Board

Version 2017.1.1 of jaci.openrio.gradle.GradleRIO Doesn't Have "toastDeploy" Task

On Mac El Capitan, when I run "gradlew tasks", there is no "toastDeploy" task listed. Not sure if this is a mistake or the method to deploy toast to roborio has changed.

build.gradle file looks like:

plugins {
id "java"
id "eclipse"
id "idea"
id "jaci.openrio.gradle.GradleRIO" version "2017.1.1"
}

repositories {
mavenCentral()
}

frc {
team = "4330"
robotClass = "frc.team4330.screambunction.RobotModule"
}

dependencies {
compile fileTree(dir: "libs", include: "*.jar")
compile group: 'jaci.openrio.toast', name: 'Toast', version: '+'
testCompile 'junit:junit:4.12'
}

def robotManifest = {
attributes 'Main-Class': 'edu.wpi.first.wpilibj.RobotBase'
attributes 'Robot-Class': frc.robotClass
}

jar {
from (zipTree('libs/navx_frc.jar')) {
include '**/*.class'
}
manifest robotManifest
}

task wrapper(type: Wrapper) {
gradleVersion = '3.2.1'
}

Cannot find symbol CrashInfoToast

Build fails during compilation because the symbol CrashInfoToast could not be found. This happens in CrashHandler.java line 45. I couldn't find a file with CrashInfoToast as part of its name anywhere in the file tree, nor could I find the text CrashInfoToast in any file except the one that fails to compile.

I was trying to build by first running ./gradlew wpi then ./gradlew build, in case that might be relevant to the issue.

Unclear instructions

Hi,

My team (4904) has been trying to use Toast for a little while, but couldn't figure it out.
I'm the programming captain and I finally decided to try it myself.
The instructions to actually set up and use Toast are a bit hard to find and unclear.
I almost gave up on the readme before I found the "Quickstart" section almost at the bottom.
When I got to the quickstart repo, I was confused as to it not actually giving me any instructions. Poking around in it revealed the actual instructions in the "Toast" folder.
From there I had trouble running the gradlew file, as I am on mac and it had Windows linebreaks (a fact revealed by the error message, which said something about "bash/r".) It also needed chmod +x, a step worth mentioning in the instructions.
Now I am trying to get simulation working (as I don't have access to a RoboRIO over the summer) and don't entirely understand what to do. Should I copy the "Toast" project and put my existing code inside "src/main/java"? Do I make a fresh copy for every new project? Do I include something in my projects and extend ToastModule instead of RobotBase? Where does "-sim your.main.Class" go in Eclipse's Run Configurations?
I think going through the entire setup workflow or, better yet, making a video would make it a lot easier to get started. Also, making it clear what Toast is and how it interacts with your code. Toast looks great, but right now it is impossible for anyone without a lot of experience to use it.
All that said, Toast looks awesome and I can't wait to have my team use it. We really appreciate what you're doing for the FRC community!

How to build and use own version of ToastAPI for submodule?

as per title.
made changes to the api and I want to test them out
basically just need to know the correct way to change the maven dependency to a local one
I tried a direct compile files( "dir/../../Toast-<version>.jar") but that didn't work

Add exceptions for FMS Ports

Some of the warning generated by the Security Manager are false: i.e. port 1180 is used for the camera server, but is still shown as a non-forwarding port. Update this for the 2016 FMS port bindings.

ADXL362 doesn't work in simulation

**** CRASH LOG ****
Your robot has crashed. Following is a crash log and more details.
This log has been saved to: /home/ellery/repos/robot2016/robot2016/run/gradle/simulation/toast/crash/crash-2016-02-29_04-58-37.txt
This log will also be duplicated to USB devices, with the filename: crash-2016-02-29_04-58-37.txt
 ________     __  ____       ____  __
((       )   / / / / /_     / __ \/ /_
||  x x  |  / / / / __ \   / / / / __ \
||   ^   | / /_/ / / / /  / /_/ / / / /
\\_______/ \____/_/ /_/   \____/_/ /_/

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at jaci.openrio.toast.core.loader.MethodExecutor.call(MethodExecutor.java:106)
    at jaci.openrio.toast.core.loader.MethodExecutor.call(MethodExecutor.java:42)
    at jaci.openrio.toast.core.loader.RobotLoader.dispatch(RobotLoader.java:462)
    at jaci.openrio.toast.core.loader.RobotLoader.start(RobotLoader.java:445)
    at jaci.openrio.toast.core.Toast.startCompetition_2(Toast.java:108)
    at jaci.openrio.toast.core.Toast.startCompetition(Toast.java:88)
    at jaci.openrio.toast.core.ToastBootstrap.fakeRobotBase(ToastBootstrap.java:275)
    at jaci.openrio.toast.core.ToastBootstrap.main(ToastBootstrap.java:238)
Caused by: java.lang.UnsatisfiedLinkError: edu.wpi.first.wpilibj.hal.SPIJNI.spiInitialize(B)V
    at edu.wpi.first.wpilibj.hal.SPIJNI.spiInitialize(Native Method)
    at edu.wpi.first.wpilibj.SPI.<init>(SPI.java:57)
    at edu.wpi.first.wpilibj.ADXL362.<init>(ADXL362.java:85)
    at frc.team3223.robot2016.SensorManager.<init>(SensorManager.java:25)
    at frc.team3223.robot2016.RobotConfiguration.<init>(RobotConfiguration.java:61)
    at frc.team3223.robot2016.RobotModule.robotInit(RobotModule.java:69)
    at jaci.openrio.toast.lib.module.IterativeModule.start(IterativeModule.java:75)
    ... 12 more

Crash Information: 
    Toast: 
        Toast Version: 2.4.8
        Loaded Modules:
            [email protected]

    Environment: 
            Toast: 2.4.8
              Git: 0562471 (056247184a2120245c09767bcfc2cf38a62e81aa)
             Type: Simulation
              FMS: false
               OS: Linux 4.3.5-300.fc23.x86_64 (amd64)
             Java: 1.8.0_72 (Oracle Corporation)
        Java Path: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.72-4.b15.fc23.x86_64/jre
          JScript: Supported (Nashorn)

    Modules: 
        robot2016
            Name: robot2016
            Version: 0.0.1
            File: /home/ellery/repos/robot2016/robot2016/run/gradle/simulation/toast/modules/robot2016.jar
            Bypass Class: null
            Core Module Class: null
            Owned Packages: 
                frc.team3223

Can't enter commands in toastconsole

I can't seem to enter commands in gradle toastconsole. I am running it on Windows and have tried in PowerShell, Command Prompt, and Git Bash.

Unit Testing Support for the Simulation?

We'd like to set up a full CI system for our code, and I'm not entirely sure whether the simulation supports unit testing, if not oh well, and I'll write one. If it does, any docs :D

Registrar - Pneumatics

Solenoid Objects can not be stored by the Registrar currently. There should be extra methods added to remedy this issue

Unsupported Major.minor version

Hi. Tried compiling this and ended up with an unsupported major.minor version error. What should I do?

06:34:58.273 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
06:34:58.274 [ERROR] [org.gradle.BuildExceptionReporter]
06:34:58.275 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
06:34:58.276 [ERROR] [org.gradle.BuildExceptionReporter] Build file '/home/matt/Projects/ToastAPI/build.gradle' line: 23
06:34:58.277 [ERROR] [org.gradle.BuildExceptionReporter]
06:34:58.277 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
06:34:58.278 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project 'ToastAPI'.
06:34:58.279 [ERROR] [org.gradle.BuildExceptionReporter] > java.lang.UnsupportedClassVersionError: jaci/openrio/gradle/GradleRIO : Unsupported major.minor version 52.0
06:34:58.280 [ERROR] [org.gradle.BuildExceptionReporter]
06:34:58.282 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
06:34:58.283 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
06:34:58.286 [LIFECYCLE] [org.gradle.BuildResultLogger]
06:34:58.288 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
06:34:58.290 [LIFECYCLE] [org.gradle.BuildResultLogger]
06:34:58.291 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 4.054 secs

Using the Command Bus

Section 8 (v2, rev 1) of the white paper talks about the "Command Bus":

Toast comes with a simple CommandBus implementation. The Command Bus is an interface
that takes in data from the Command Line (or a remote console) and passes it to Toast or the
appropriate module to be processed. This means modules can register their own commands
that invoke and action when used.

http://www.chiefdelphi.com/media/papers/3174?langid=1

I'd like to cause inputs on the simulator to change through external manipulation so that my code can respond to those changes. It sounds like this is what the Command Bus can do, but it's not clear how to access it.

Two questions:

  1. Is my understanding of the purpose of the Command Bus correct?
  2. How can I gain access the Command Bus interface? For example, should I try to ssh into the simulator? (have tried, but don't know port/username/password)

I've successfully installed ToastAPI on Ubuntu 16.04 using Eclipse, can run the simulator, and have written a few simple modules, all following the tutorials. But I'm new to programming the RoboRio, so it's possible I'm missing something obvious.

Toast Simulation GUI

Would it be possible to have an independent simulator to aid teams who are using the default tools given to them by FIRST? Maybe a sort of wrapper which takes calls to the WPIlib classes and redirects those function calls to the GUI

VictorSP Set Not Accurate

Whenever I use a VictorSP, at least in sim, the motor controller gets set to what it needs to be minus 0.05, so if I were to simply access both of them in the registrar, on the sim RoboRIO their signal immediately drops to -0.05. You can sets them to -1 just fine, but the maximum signal strength a VictorSP can be set to is 0.94.

Issues when loading Wpilib robot jar

So I loaded the jar for my code by putting it in toast/modules. The robot crashed, and it looks like the stack trace isn't going to my code.

________    ______                 __   
((       )  /_  __/___  ____ ______/ /_  
||  o o  |   / / / __ \/ __ `/ ___/ __/  
||   3   |  / / / /_/ / /_/ (__  ) /_    
\\_______/ /_/  \____/\__,_/____/\__/    

[27/03/16-05:06:02] [Toast] [Bootstrap] [INFO] Toast Version: 2.4.10
[27/03/16-05:06:02] [Toast] [Bootstrap] [INFO] Toast Commit Hash: 7b5f0b4
[27/03/16-05:06:02] [Toast|Loader] [Core-Pre-Initialization] [DEBUG] Discovering Module Jar: FRCUserProgram.jar
[27/03/16-05:06:02] [Toast|Loader] [Core-Pre-Initialization] [DEBUG] Wrapping Module Detected: FRCUserProgram.jar
[27/03/16-05:06:02] [Toast] [Core-Initialization] [INFO] Toast Started with Run Arguments: [-sim, --debug]
[27/03/16-05:06:02] [Toast] [Pre-Initialization] [INFO] Slicing Loaf...
[27/03/16-05:06:04] [Toast] [Initialization] [INFO] Nuking Toast...
platform: /Windows/x86/
[27/03/16-05:06:04] [Toast] [Pre-Start] [INFO] Buttering Bread...
[27/03/16-05:06:04] [Toast|Loader] [Pre-Start] [DEBUG] Discovering Module Jar: FRCUserProgram.jar
[27/03/16-05:06:04] [Toast|Loader] [Pre-Start] [DEBUG] Wrapping Module Detected: FRCUserProgram.jar
[27/03/16-05:06:04] [Toast|Loader] [Pre-Start] [DEBUG] Preliminary Airbender Added: FRCUserProgram.jar
[27/03/16-05:06:04] [Toast|Loader] [Pre-Start] [DEBUG] WPILib Class Found: org.usfirst.frc.team236.robot.Robot for airbender: FRCUserProgram.jar... wrapping...
[27/03/16-05:06:04] [Toast|Loader] [Pre-Start] [DEBUG] Manually Loading Class: --debug
**** CRASH LOG ****
Your robot has crashed. Following is a crash log and more details.
This log has been saved to: C:\Users\Team236\workspace\Toast\toast\crash\crash-2016-03-27_05-06-04.txt
This log will also be duplicated to USB devices, with the filename: crash-2016-03-27_05-06-04.txt
 ________     __  ____       ____  __
((       )   / / / / /_     / __ \/ /_
||  x x  |  / / / / __ \   / / / / __ \
||   ^   | / /_/ / / / /  / /_/ / / / /
\\_______/ \____/_/ /_/   \____/_/ /_/

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(Unknown Source)
    at jaci.openrio.toast.core.loader.module.ModuleCandidate.addClassEntry(ModuleCandidate.java:124)
    at jaci.openrio.toast.core.loader.RobotLoader.parseEntries(RobotLoader.java:380)
    at jaci.openrio.toast.core.loader.RobotLoader.init(RobotLoader.java:80)
    at jaci.openrio.toast.core.Toast.startCompetition(Toast.java:79)
    at jaci.openrio.toast.core.ToastBootstrap.fakeRobotBase(ToastBootstrap.java:283)
    at jaci.openrio.toast.core.ToastBootstrap.main(ToastBootstrap.java:246)

Crash Information: 
    Toast: 
        Toast Version: 2.4.10
        Loaded Modules:
            {undefined}@{undefined}

    Environment: 
            Toast: 2.4.10
              Git: 7b5f0b4 (7b5f0b4bb3e734451f2cc058dcaa7936854892c8)
             Type: Simulation
              FMS: false
               OS: Windows 7 6.1 (x86)
             Java: 1.8.0_40 (Oracle Corporation)
        Java Path: C:\Program Files (x86)\Java\jre1.8.0_40
          JScript: Supported (Nashorn)

    Modules: 
        {undefined}
            Name: {undefined}
            Version: {undefined}
            File: C:\Users\Team236\workspace\Toast\toast\modules\FRCUserProgram.jar
            Bypass Class: null
            Core Module Class: null
            Owned Packages: 
                motionProfile
                org.usfirst.frc.team236.robot
                standard.LogitechF310
                updater
                edu.wpi.first.wpilibj
                com
        jaci.openrio.toast.core.loader.module.ModuleContainer could not be logged. (null)


*******************

The code in question is here.

Depreciate Groovy in favor of JavaScript

Configuration Files and some Module Scripts are currently written in Groovy, however this seems to have some downsides that are getting more and more cumbersome as Toast begins to snowball into a bigger and bigger project.

Upsides

Lets start on a positive. The upsides of allowing this Groovy implementation through the Groovy SDK are quite nice.

  • Easy to code for
  • Direct access to the JVM
  • Lots of 'helpers' (.withReader and things of the like)
  • Next to no performance deficit

Downsides

  • Large SDK size (The Groovy SDK is close to 6MB, taking up the large majority of Toast's build size)
  • The Java version running on the RoboRIO's deployed in January (8u6) doesn't have support for the Groovy SDK, meaning each team must update their RoboRIO's java to run Toast.

JavaScript

Project Nashorn was introduced in Ju8, allowing for faster, more reliable interpretation of JavaScript running directly in the JVM. JavaScript here will have direct access to the JVM and is executed fairly quickly. This almost mirrors Groovy's speed, and is natively included in the JDK without the need for an external API like Groovy does. JavaScript's objects and prototypes can enable for extremely powerful Configuration Files and ModuleScripts.

The Changeover

The changeover will not be easy. While the implementation itself shouldn't prove to be difficult (fairly similar to the current Groovy syntax with minor changes), there are other challenges. Each config will have to be sandboxed with it's own ScriptEngine to avoid conflicts with Config names. Existing modules will have to be switched to JavaScript configuration files as opposed to the Groovy ones, which is not necessarily difficult, but a pain at best. Additionally, Groovy Modules will no longer be supported. While JavaScript DOES have direct access to the JVM, the implementation isn't as clean as many would like. For example, all Type declarations are done with Java.Type, instead of a direct reference. This shouldn't be a problem, but I can see many people finding it cumbersome. These modules will also have to be sandboxed to avoid variable conflicts, as I suspect many developers won't have their Modules contained in an object.

Mitigation

Legacy Support for Groovy may have to be implemented. This can be done through a Legacy module, or perhaps through checking if the Groovy SDK is loaded into the classpath. Either way, it won't be easy to do cleanly.

how to deploy jars

java ecosystem outsider here.

We have a local jar file - the one for the navx not (to my knowledge) in any maven repository. How would you configure your build.gradle to ensure the deploy process includes that jar file?

JScript not supported

My robot build fails with the message that JScript is not supported full crash log here. So is there any way you know of to get it supported?

IDEA fails to run Toast module

Following the instructions in the Wiki, after generating an IDEA project file, a Gradle module simulation build fails with the following error:
Exception in thread "main" java.lang.ClassNotFoundException: jaci.openrio.toast.core.ToastBootstrap
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)

Deploy Failed

Windows 10
Toast Version: 2.4.14
Intellij IDEA 2016.2.1

When I go to deploy my code, everything is fine until the deploy sequence. Error as follows: server indicated an error: scp toast/modules/Khan-Mk.2.jar: No such file or directory

I did notice that within the run/toast/modules directory, there were no .jar files to be found.

No Robot Communication

Hello,
I am having an issue connecting the driver station to TOAST. I have tried both the team number and the TOAST connection methods. I am new to FRC so please bear with me/ Any help would be greatly appreciated.

HALSendError crashes in simulation

Toast doesn't handle calls to edu.wpi.first.wpilibj.communication.FRCNetworkCommunicationsLibrary.HALSendError() in simulation, causing crashes anytime wpilib would call it. Right now for my robot this means that in verification (where there is no joystick) the error causes a crash.

For example:

Your robot has crashed. Following is a crash log and more details.
This log has been saved to: C:\Users\floogulinc\Documents\Code\Repositories\2016-knight-fury\run\toast\crash\crash-2016-02-22_11-12-20.txt
This log will also be duplicated to USB devices, with the filename: crash-2016-02-22_11-12-20.txt
 ________     __  ____       ____  __
((       )   / / / / /_     / __ \/ /_
||  x x  |  / / / / __ \   / / / / __ \
||   ^   | / /_/ / / / /  / /_/ / / / /
\\_______/ \____/_/ /_/   \____/_/ /_/

java.lang.NoSuchMethodError: edu.wpi.first.wpilibj.communication.FRCNetworkCommunicationsLibrary.HALSendError(ZIZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I
    at edu.wpi.first.wpilibj.DriverStation.reportErrorImpl(DriverStation.java:647)
    at edu.wpi.first.wpilibj.DriverStation.reportWarning(DriverStation.java:625)
    at edu.wpi.first.wpilibj.DriverStation.reportJoystickUnpluggedWarning(DriverStation.java:221)
    at edu.wpi.first.wpilibj.DriverStation.getStickAxis(DriverStation.java:244)
    at edu.wpi.first.wpilibj.Joystick.getRawAxis(Joystick.java:240)
    at com.frc2879.xboxcontroller.XboxController$Thumbstick.rawY(XboxController.java:260)
    at com.frc2879.xboxcontroller.XboxController$Thumbstick.getY(XboxController.java:339)
    at com.frc2879.knight_fury.commands.DriveTank.execute(DriveTank.java:25)
    at edu.wpi.first.wpilibj.command.Command.run(Command.java:240)
    at edu.wpi.first.wpilibj.command.Scheduler.run(Scheduler.java:222)
    at com.frc2879.knight_fury.RobotModule.tickState(RobotModule.java:77)
    at jaci.openrio.toast.core.StateTracker.tick(StateTracker.java:130)
    at jaci.openrio.toast.core.StateTracker.init(StateTracker.java:74)
    at jaci.openrio.toast.core.Toast.startCompetition_2(Toast.java:123)
    at jaci.openrio.toast.core.Toast.startCompetition(Toast.java:88)
    at jaci.openrio.toast.core.ToastBootstrap.fakeRobotBase(ToastBootstrap.java:275)
    at jaci.openrio.toast.core.ToastBootstrap.main(ToastBootstrap.java:238)

Encoder Simulation Support

It would be nice to support encoders in Toast's simulation. The EncoderJNI class would need to be added in patches.

The roboRIO non-responsive, ran out of RAM.

Upon updating to 4.11 our robot started to not respond to either teleop or to autonomous commands. the toast logs said nothing. But I found a JVM log that seemed to indicate that the program consumed more ram than was allocated. So I have two questions. One can I allocate more ram? And two is there a way to restrain the ram usage?

[WIP] Release Targets 2.X.X

This 'issue' refers to feature requests and milestone targets for the 2.X.X version of Toast. These will be checked off as they are completed, and anyone can submit followup comments to this post to request features.

2.0.0

  • Get everything working properly
  • Attempt to optimize things such as the JavaScript Engine, Logger and Threading
  • Make sure everything is thread-safe and can be logged, even if the logger isn't ready
  • Keep the profiler running during initialisation
  • Make sure it works on all environments
    • Linux
    • Windows
    • Darwin
    • RoboRIO ARM
  • Attempt to switch less-vital parts of the loading phase over to an event-based architecture (only make things wait if they need it, otherwise mark initialization as 'done')

2.0.5

  • Full Testing Support for lesser-used mechanisms such as pneumatics and DIO
  • Integrate the DriveSim module with the Toast Core

2.1.0

  • Start work on C++ native extensions
  • Attempt to fork some functions over to annotation-based AST compiler flags to make base-classing easier
  • Get most-often invoked utilities to work under C++ to make things faster
  • Add support for time-consuming calculations to be offloaded to C++
  • Add State Machine support for Autonomous actions
  • Make C++ Native Extensions hook into NI's Real-Time threading, to make JVM Threads run Real-Time

2.2.0

  • Add neural network support to C++
  • Have PID / Swerve / Mecanum offsets train off of the C++ neural nets

Crash Log spam

In the 2016 Update of the RoboRIO image, instead of running the frcKillRobot.sh -r -t command to restart robot code, the Java process is just killed and a watchdog checks to see if the program is running, and if not, to start it.

This has the side effect of if the robot crashes, the code will immediately start up again. This is good in some cases, but for cases where the robot crashes upon init (whether it be programmer error or what have you), the crash is on a loop and will write new crash logs to file until the robot program is replaced, or the power to the robot is unplugged.

This can make it hard to identify crash logs. We need a way to detect if the robot crashes consecutively with an identical stacktrace. This can be done by writing the crash conditions to file, and removing the file at bootup. Checking if a) this file exists and b) this file contains an identical exception signature will allow us to determine whether a new crash log should be written.

Simulation crashes with all sensors


(( ) /_ /_ ____ / /
|| o o | / / / __ / __ `/ **
/ __/
|| 3 | / / / /
/ / /
/ (** ) /

_
/ // ____/,/___/__/

[11/03/16-09:46:44] [Toast] [Bootstrap] [INFO] Toast Version: 2.4.9
[11/03/16-09:46:44] [Toast] [Bootstrap] [INFO] Toast Commit Hash: 0c7de66
[11/03/16-09:46:44] [Toast] [Core-Initialization] [INFO] Toast Started with Run Arguments: [-sim]
[11/03/16-09:46:44] [Toast] [Pre-Initialization] [INFO] Slicing Loaf...
[11/03/16-09:46:46] [Toast] [Initialization] [INFO] Nuking Toast...
platform: /Windows/amd64/
[11/03/16-09:46:46] [Toast] [Thread-7] [INFO] Toast Driver Station Networking Bonjour Tunnel successfully configured!
[11/03/16-09:46:46] [Toast] [Pre-Start] [INFO] Buttering Bread...
[11/03/16-09:46:46] [Toast|Loader] [Pre-Start] [INFO] Module Loaded: [email protected]
[11/03/16-09:46:46] [Toast] [Start] [INFO] Fabricating Sandwich...
[11/03/16-09:46:46] [Toast] [Start] [INFO] Verdict: Yummy
[11/03/16-09:46:46] [Toast] [Main] [INFO] Total Initiation Time: 1.911 seconds
[11/03/16-09:46:46] [Toast] [Thread-9] [ERROR] Could not instantiate Wrapped Module reflection on robotInit: java.lang.reflect.InvocationTargetException
[11/03/16-09:46:46] [Toast] [Thread-9] [ERROR] java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at jaci.openrio.toast.lib.module.ModuleWrapper.reflectMethod(ModuleWrapper.java:150)
at jaci.openrio.toast.lib.module.ModuleWrapper.lambda$start$8(ModuleWrapper.java:92)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsatisfiedLinkError: edu.wpi.first.wpilibj.hal.EncoderJNI.initializeEncoder(BIZBIZZLjava/nio/IntBuffer;)J
at edu.wpi.first.wpilibj.hal.EncoderJNI.initializeEncoder(Native Method)
at edu.wpi.first.wpilibj.Encoder.initEncoder(Encoder.java:87)
at edu.wpi.first.wpilibj.Encoder.(Encoder.java:129)
at edu.wpi.first.wpilibj.Encoder.(Encoder.java:141)
at org.usfirst.frc4328.Robot2016.RobotMap.init(RobotMap.java:82)
at org.usfirst.frc4328.Robot2016.Robot.robotInit(Robot.java:65)
... 7 more

**** CRASH LOG ****
Your robot has crashed. Following is a crash log and more details.
This log has been saved to: C:\Users\FuriousFalcons\Desktop\ToastAPI-master\release\run\gradle\simulation\toast\crash\crash-2016-03-11_09-47-26.txt
This log will also be duplicated to USB devices, with the filename: crash-2016-03-11_09-47-26.txt


(( ) / / / / /_ / __ / /_
|| x x | / / / / __ \ / / / / __
|| ^ | / // / / / / / // / / / /
___/ **// // __**// //

java.lang.NullPointerException
at org.usfirst.frc4328.Robot2016.Robot.teleopPeriodic(Robot.java:135)
at jaci.openrio.toast.lib.module.ModuleWrapper.lambda$stateSetup$9(ModuleWrapper.java:119)
at jaci.openrio.toast.core.StateTracker.tick(StateTracker.java:130)
at jaci.openrio.toast.core.StateTracker.init(StateTracker.java:102)
at jaci.openrio.toast.core.Toast.startCompetition_2(Toast.java:123)
at jaci.openrio.toast.core.Toast.startCompetition(Toast.java:88)
at jaci.openrio.toast.core.ToastBootstrap.fakeRobotBase(ToastBootstrap.java:275)
at jaci.openrio.toast.core.ToastBootstrap.main(ToastBootstrap.java:238)

Crash Information:
Toast:
Toast Version: 2.4.9
Loaded Modules:
[email protected]

Environment: 
        Toast: 2.4.9
          Git: 0c7de66 (0c7de66be66f1b5e42343f83bc9188a359969abc)
         Type: Simulation
          FMS: false
           OS: Windows 10 10.0 (amd64)
         Java: 1.8.0_66 (Oracle Corporation)
    Java Path: C:\Program Files\Java\jdk1.8.0_66\jre
      JScript: Supported (Nashorn)

Modules: 
    FRCUserProgram.jar!wrapper
        Name: FRCUserProgram.jar!wrapper
        Version: 0.0.0
        File: C:\Users\FuriousFalcons\Desktop\ToastAPI-master\release\run\gradle\simulation\toast\modules\FRCUserProgram.jar
        Bypass Class: null
        Core Module Class: null
        Owned Packages: 
            org.usfirst.frc4328.Robot2016
            edu.wpi.first.wpilibj
            com.ni.vision
        Custom Data: 
            Sample: false
            Iterative: true
            Wrapped Class: org.usfirst.frc4328.Robot2016.Robot

Does this when I take encoders out (ultrasonic sensors). I only need to test the encoders and ultrasonic so if these cause crashes I have a severe problem...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.