Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Virtual cRIO (cRIO Emulator) (http://www.chiefdelphi.com/forums/showthread.php?t=113005)

Chiller 07-02-2013 22:21

Virtual cRIO (cRIO Emulator)
 
I have created a Virtual cRIO so you can test your robot code without having to wait for the mechanical and electrical teams to finish their jobs.

This is the first release so do not expect it to work flawlessly!

Download: http://www.mediafire.com/?wpwkpreo6hwjc16

Instructions:
- Download the jar file and place onto desktop
- Open netbeans (or other IDE)
- If using netbeans either create a new robot project or use an existing project
- Once your robot project is created right click on the project you just made and click properties
- Click on Libraries, and remove the classes.jar library and add the Virtual cRIO.jar
- Once the library is added make sure there are no errors with the class imports
- Now you have to create a new file in the src folder by right clicking the src folder and New -> Other -> Other -> Empty file, name it main.txt
- Now in that file put <PackageName>.<MainClass> but replace PackageName with the actual package name and the MainClass with the main class that extends SimpleRobot and then save the file
- Now all you have to do is click the build icon (the one that looks like a hammer)
- Now open Virtual cRIO.jar and click the Choose Jar button
- Find your built robot project which is usually in your documents folder under netbeansprojects/<Project Name>/dist
- And now you should be able to enable the cRIO!

If you are having any trouble or having any problems please be sure to leave a comment below so I may assist you!

Screenshot:

Arhowk 08-02-2013 11:32

Re: Virtual cRIO (cRIO Emulator)
 
Where is "libraries" under the Project properties? I only have

General
Java Sources
Java Sources Classpath
Output
Build & Run
Formatting

(none that i can find contain classes.jar anywhere)

DjMaddius 08-02-2013 12:21

Re: Virtual cRIO (cRIO Emulator)
 
Awesome project! However, I'm running on ubuntu, java can't find the main class to execute the software. Secondly, same issue as above. Can't wait to use it once these issues are addressed!

joelg236 08-02-2013 15:53

Re: Virtual cRIO (cRIO Emulator)
 
After build season, I'd like to help with one of these projects. It seems nobody accounts for the squawk libraries, which astonishes me. Although this library is impressive for what it is, there is a whole lot more that needs to be made. If you really need to test it on your computer, you are probably using more obscure libraries, which these kinds of things just don't do very well. Like I said, I'd love to help if its open source.

Chiller 08-02-2013 16:25

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Arhowk (Post 1229876)
Where is "libraries" under the Project properties? I only have

General
Java Sources
Java Sources Classpath
Output
Build & Run
Formatting

(none that i can find contain classes.jar anywhere)

Right click on your project and click on properties. Sorry for not clarifying that.

Chiller 08-02-2013 16:38

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by DjMaddius (Post 1229905)
Awesome project! However, I'm running on ubuntu, java can't find the main class to execute the software. Secondly, same issue as above. Can't wait to use it once these issues are addressed!

I think the error here is that i compiled it with JRE 1.7 and you probably have JRE 1.6. Is the error something like this: "java.lang.NoClassDefFoundError" If so that is most definitely the issue.

DjMaddius 08-02-2013 16:41

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Chiller (Post 1230059)
I think the error here is that i compiled it with JRE 1.7 and you probably have JRE 1.6. Is the error something like this: "java.lang.NoClassDefFoundError" If so that is most definitely the issue.

Yep, running jre 1.6

Chiller 08-02-2013 20:21

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by DjMaddius (Post 1230060)
Yep, running jre 1.6

So im guessing now its working??

DjMaddius 08-02-2013 20:26

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Chiller (Post 1230165)
So im guessing now its working??

Haven't installed jre 1.7 to try

Chiller 09-02-2013 18:26

Re: Virtual cRIO (cRIO Emulator)
 
There will be network support in a later release and i might make it so the driver station will be able to connect to the virtual cRio!

Arhowk 09-02-2013 20:43

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Chiller (Post 1230053)
Right click on your project and click on properties. Sorry for not clarifying that.

thats what i did?

Chiller 09-02-2013 21:25

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Arhowk (Post 1230725)
thats what i did?

And you cant find a section thats named Libraries?

Arhowk 09-02-2013 22:28

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Chiller (Post 1230747)
And you cant find a section thats named Libraries?

no. theres only
Quote:

Originally Posted by Arhowk (Post 1229876)
General
Java Sources
Java Sources Classpath
Output
Build & Run
Formatting

and as far as i can tell, none of them contain a "libraries"

Chiller 10-02-2013 11:39

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Arhowk (Post 1230781)
no. theres only

and as far as i can tell, none of them contain a "libraries"

Ok I have found the issue, you are using an older version of netbeans which looks like this:



And the version of netbeans we are using looks like this:



Now all you have to do differently is go to Java Sources Classpath and do what I say in my original post!

Arhowk 10-02-2013 12:09

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Chiller (Post 1230952)
Ok I have found the issue, you are using an older version of netbeans which looks like this:


And the version of netbeans we are using looks like this:


Now all you have to do differently is go to Java Sources Classpath and do what I say in my original post!

Nope, im running JDK 1.7 and my "Java Sources Classpath" is much different than the one you have shown, it only contains 2 files for the wpilibj and networktables libraries.

Chiller 10-02-2013 13:11

Re: Virtual cRIO (cRIO Emulator)
 
Quote:

Originally Posted by Arhowk (Post 1230962)
Nope, im running JDK 1.7 and my "Java Sources Classpath" is much different than the one you have shown, it only contains 2 files for the wpilibj and networktables libraries.

Its not the version of the JDK that makes that difference its the version of netbeans and you should be able to remove those two jars and add the Virtual_cRIO.jar

Arhowk 11-02-2013 21:57

Re: Virtual cRIO (cRIO Emulator)
 
Ok, ive done that, but when i hit the "Choose jar" file and go to my jar (which is in build/ not dist/) nothing happens.


All times are GMT -5. The time now is 11:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi