Go to Post Wait, I thought 2009 started on January 3rd... - ComradeNikolai [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 09-05-2013, 10:04
sirchadwick sirchadwick is offline
Registered User
AKA: Chad Schmidt
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Nov 2012
Rookie Year: 2005
Location: Chicago
Posts: 5
sirchadwick is on a distinguished road
Team 111 Wildstang 2013 Robot Code (Java)

Similar to Team 254, we also decided to switch to Java from C++ this year. Java is easier to teach, many students already had some instruction in school, and the students can grasp the concepts faster. Also the students and mentors could work on both Windows or Mac computers.

After the initial heartburn from Squawk's and Java ME's limitations, we feel the change was a success and will continue using Java in future years. I would recommend it for any team thinking about making the switch. However, they should understand how limited this version of Java really is. We lost about 2 weeks just trying to get basic functionality to compile and run because the compile/run time error messages are very cryptic. It took examining the WPI libraries design patterns and their use of this "Java" to understand how to recreate "simple" things like an unsynchronized List or a way to do a type-safe "enum".

Without further ado..........

https://github.com/wildstang111/2013_robot_software

The repository contains two Netbeans projects; crioTarget and WsSimulation. The crioTarget is what is run on the robot. The WsSimulation links against the crioTarget and replaces many of WPI classes with its own stub or simulation implementation.

The robot framework was designed using the Subject/Observer object oriented design pattern and inputs and outputs can notify any registered object when they change. To keep things simple and synchronous, all updates occurred during the 20 ms periodic loop.

The simulation allows the software team to test all of its logic before loading it on the hardware. The simulation was originally based on the project frcjcss ( https://code.google.com/p/frcjcss/ ) released under GNU GPL v3. frcjcss stubbed out a lot of the classes from the WPI library like Victors, Solenoids, Relays, and Joysticks and got us quickly started in getting our cRio code running on the desktop. Our adapted version simulates a variety of hardware including the drive encoders, flywheel encoders, gyro, and limit switches to test proper control schemes. frcjcss had an onscreen joystick and we added support for a USB joystick for inputs. The USB joysticks are supported using the javahidapi project (https://code.google.com/p/javahidapi/) released under the BSD license. We used two different PS3/Xbox type controllers and aside from the Directional Pad (see known issues), all buttons and axises read as expected.

After the build season, it was determined that the SmartDashboard would work by linking in the desktop version of the Smartdashboard/Network table jars into the Simulation. SmartDashboard justs needs to be started with the command line parameter for the ip as localhost. This greatly impacts the entire UI and alot of the single UI windows can be removed.

Feel free to ask any questions or point out any issues. There is already a growing list of known issues.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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