FRC 2010 Java Sample Code

Following up the WPILibJ and SquawkVM Java documentations posted, it is time to explore how this framework can be used in actual robot systems, very much like that will be built by teams come the FRC build period.

Before I go on, in order examine the source code,
you MUST download and read the BSD-derived License agreement that is included with it. It enclosed with the zip files containing the source. Also know that because the posted source DOES NOT include the actual WPILibJ or Squawk VM source or binaries, you will not be able to run this just yet unless you are a part of the official FRC beta test.

The first thing teams
will do as they receive Java libraries and the additional control system materials this fall is a Benchtop test to ensure that all control system functionalities work out of the box. This Benchtop test also goes to show the basic calls that students will be making to control hardware from the cRIO.
Here is that benchtop test’s source

As you may recall, Sun and WPI demoed robots utilizing Java on the cRIO at the end of the 2009 season, and these robots demonstrated some basic functionalities(such as driving) as well as more advanced ones(such as camera tracking).
Here is the source for that demo: Tracking Source



FRC 2010 Java Libraries


At the end of the 2009 FIRST Robotics Competition (FRC), FIRST announced a partnership with Sun Microsystems that would bring Java into the competition, providing the necessary infrastructure to control the National Instruments CompactRIO platform(cRIO)--and entire robots--with Java applications. For the 2010 season would have the option to program the cRIO in Java, C++, or LabView, giving a great deal of flexibility to teams.

The cRIO will run a port of Sun Labs’ Squawk Java VM, a powerful, lightweight virtual machine supporting J2ME running “on the metal”--without a host operating system. Above this VM will exist a layer of libraries written by WPI supporting the essentials of robot-associated i/o from the cRIO; such basics as PWM generation, digital and analog I/O through the sidecars are managed through native bindings and FPGA code. Finally, WPI also provides a layer of abstraction covering a huge number of Robot components, ranging from drivetrains to human interfaces to speed controllers and sensors of all sorts.

The FRC Java libraries and framework is slated to be distributed to Beta test teams(a select few, by application) later this month, with a public release closer to november. Further, the entire framework will be open-source for the first time, allowing students to explore the systems underlying their robot code.

Sadly, most teams will not get a chance to properly learn and practice with the FRC Java libraries until very near to the build period, which will certainly cause some distress particularly among teams new to the competition. Frankly I believe this distracts from the spirit of the competition and will harm students more than anything else.

In the hopes of aiding FRC teams everywhere, I post here the
entire Java documentation--javadoc--for the FRC Java system for 2010, as it stands on 9/5/2009. This includes the Squawk VM documentation as well as the WPILibJ docs. I have also acquired source and binary distributions of these entities and will share any insights I have into those as time goes on. Sample code will appear shortly along with templates for FRC projects.

Documentation
WPI Java Robot Library Documentation
Squawk Java Virtual Machine Documentation

Note that none of these docs or code is final, and while I update my working copies as frequently as possible, I can make no guarantees for any of the content here, beside the fact that it is most certainly genuine. I take NO Responsibility for the functioning status of any content here, but I hope it will allow FRC teams to familiarize with these systems with ample time before competition.


Finally I hope that me sharing these things will promote more sharing among the FRC community, in the spirit of Gracious Professionalism.
As a professional software developer I take these things to heart in work and competition, and I hope you do too.

--spartango



Track Animals Remotely

In thinking of tracking people in a small area, we came up with a similar, but perhaps entirely different--
Consider the problem of tracking animals in their native habitats--generally we want to obtain a record of their whereabouts over a given period of time so that we can understand feeding patterns, migrations, and so on. This allows that we really don’t need to track them live, but we’ll need to find them periodically to retrieve whatever is doing the data collections(animals need to be given the tracker, they don’t have cellphones). In any case, when it comes time to retrieve a “tag” from an elephant, for example, we need to find its position and drive, tranquilize the animal, and remove the tag.
Currently, these tags have simple transmitters, which the tracking party “listens for” with a directional receiver, and follows to the source. This can be done with a land rover, or ultralight aircraft to improve speed.
Now, if we were to automate this entire process, enabling a zoologist to ask for the whereabouts of an animal and have that information brought to them with a minimal amount of work, it would be of much use to researchers:
How can we autonomously find and collect data from a moving party, using low power
‘tags’ and search units to retrieve data from each tag once it is found.


A possible solution: build a UAV platform that can perform the same role as the aforementioned ultralight--searching for an navigating to the target animal--such that a researcher would deploy the drone, it would find the target and extract information from the tag using low-power, short-range radio, and fly back to the researcher with a data record. This could be done entirely without actually removing the tag from the animal or tranqulizing it, allowing for increased tracking durations and less manpower/resources involved in collecting data.
Thoughts?


Track People In a Building?

Our first problem to solve:
How can we track people in a building, following their movements and mapping them to a 3D sketch of that building, such that we know where people are and are going?
download
Let’s put forth a couple of interesting and practical constraints:
We have a small number of embedded systems(and a central machine) from which to establish this system.
We cannot do any invasive procedure to the building’s walls or floors, ie, no installing large, obvious systems--things should be hidden.
It is safe to assume that the people in this building have certain objects on their person, including but not limited to, a cellphone, wallet, keys...
We know what the building looks like and where stuff is in it.

Thoughts?


Welcome

Welcome to Think Tank!

The Think Tank is a quiet place which hopefully will serve as an exchange for ideas, where contributors and viewers work to hash out creative solutions to all sorts of problems...This place is more than a forum, in that it amalgamates discussions from the real world, and then stages them in a semi-coherent manner.
In any case, the first Think Tank is being held tonight, and the first real ideas will show up here soon. Expect to see organized thinks from tank sessions, as well as random scavenged ideas.