|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
New Java (and C++) features for 2012
Link to FIRST Forums post: http://forums.usfirst.org/showthread...2995#post52995
As Team 341 continues our Beta test of the 2012 FRC Control System Java programming language and hardware, I thought it would be a good time to explain some of the new features we have been testing. This post will focus exclusively on the software side - and most of the Java changes also go for C++. Aside from support for the new hardware (4-slot cRIO II, Microsoft Kinect, and maybe a couple other things), the 2012 Java environment offers some new helpful utilities, a new SmartDashboard application, and an entirely new style of programming (CommandBasedRobot) that supplements the existing SimpleRobot and IterativeRobot styles. In many cases, the extensions to the Java/C++ programming options are things that some enterprising teams have been doing for a few years now. For example, if you look at the code posted on ChiefDelphi by teams 125 and 254 in the past couple seasons, you will find a lot of similarities. Here are some of the new features that we are currently testing:
It is important to note that although there is a ton of new stuff in 2012, all of the 2011 templates and classes work in exactly the same way (for example, our 2011 robot code worked without modification using the 2012 libraries). Per the beta test agreement, I am happy to answer any questions on these new features, but cannot provide code or documentation until after the beta period. |
|
#2
|
|||||
|
|||||
|
Re: New Java (and C++) features for 2012
Wow, those are a lot of really nice improvements. It should elevate a lot of teams.
What is used to do image processing on the driver station? How is that programmed? Do you have to use Labview or are there sample java (or C++) projects for it? |
|
#3
|
||||
|
||||
|
1. Can you post a copy of your test code that uses these new features? (comments
)2. Just to clarify "on the fly" How easily is the preferences changed? On the fly? Or is something that needs to be changed and the robot needs to reset? Do you have to refresh the class to use preferences? |
|
#4
|
|||||
|
|||||
|
Re: New Java (and C++) features for 2012
1. I cannot (yet), due to the beta test non-disclosure agreement. This is primarily to make sure that things don't get confusing as multiple versions of the 2012 code are published (remember, things are still a work in progress). I will share my code as soon as I am allowed.
2. By default, the Preferences are loaded from a file when the cRIO boots. However, you can set up your own code to read values from the SmartDashboard at any time. You would then tell Preferences to "save" the values if you are happy with them. |
|
#5
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
Quote:
![]() |
|
#6
|
||||
|
||||
|
Re: New Java (and C++) features for 2012
Ok thank you for the information. And isnt subsystems just like normal c++ classes and functions?
|
|
#7
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
Quote:
Also, stay away from image processing on the laptop... There will be great delays. Assume each RGB pixel has 24 bits and the image is 640x480. That is essentially: 640 * 480 = 307200 307200 * 24 = 7372800 bits = 921600 bytes That data has to travel from the camera to the cRio then to the laptop. Also, the big endian needs to be converted to little endian on the laptop end. Assume the cache of the cpu is 512KB. The cpu is already preoccupied by system processes and other processes. So assume only 24KB are available for the image processing. The image has to be retrieved from the RAM then stuffed into the cache. But look, the whole image can not be stuffed into the cache. There needs to be multiple times it has to go to RAM to retrieve data then send it to the cRio and then the cRio utilized that data. Keep in minds x86 cpus have 8 General purpose registers. It takes about 1-3 cycles to retrieve data from the cache. So only about 1 pixel can be handled at one time by the cpu. BUT powerpc architecture has 32 general purpose resisters. That can effectively quadruple the number of pixels that can be handled by cpu at any given time. Now, I am away my argument is flaws because I do not take account of the clock speed of the cRio into account. But I take my bet on the cRio any day over sending data over wifi and sending back. Last edited by davidthefat : 25-10-2011 at 01:46. |
|
#8
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
Quote:
|
|
#9
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
The images are sent as compressed JPEGs. They are not anywhere near as big as you've calculated.
|
|
#10
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
Quote:
Disregarded that fact. |
|
#11
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
Jared,
I assume based on your statements that this means that you are now allowed to use an application like RoboRealm to process the images on the PC and send back any results? If so, we will check with FIRST about making this available to team members. Thanks for the info! STeven. |
|
#12
|
||||
|
||||
|
Re: New Java (and C++) features for 2012
As far as I know, you were able to do that last year...
|
|
#13
|
|||
|
|||
|
Re: New Java (and C++) features for 2012
does java now support the top part of the dashboard? last year, we needed to manually create a dashboard class so that values on the dashboard would be updated as it does natively in LabView
|
|
#14
|
|||||
|
|||||
|
Re: New Java (and C++) features for 2012
Quote:
|
|
#15
|
|||||
|
|||||
|
Re: New Java (and C++) features for 2012
No, the "Labview" Dashboard would still require some manual effort to get working with Java. However, the C++ and Java versions of WPIlib are moving more and more towards a new version of the SmartDashboard that is natively supported and highly capable (multiple visualization "widgets" as well as "choosers" to select autonomous modes and set parameters used by your code).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|