View Single Post
  #54   Spotlight this post!  
Unread 03-08-2009, 12:18 PM
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,033
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Teams happy with Wind River Workbench?

We are using a swerve drive this year, with all 4 wheels independently controlled. So we had to write code to control all of those (essentially creating servos using an encoder and a motor). One of the big problems with swerve drive for us is that we haven't agreed on the best way to control it using joysticks and such. As a result we have about 4 different ways that you can use to control it.

We also are using a layered approach to control, where all of the joystick/user interaction takes place in a 'movement control' class selected by a thumbwheel switch on our DS, that talk to a 'DriveController' and give it speed/angle/rotation parameters. The drive controller sends the input to various drive classes which can act as filters for the values (or record them), and then finally down to the actual class which controls the motors and translates the speed/angle/rotation parameters to motor values and servo angles. Its similar to RobotDrive in WPILib, but quite different since we separated out the stuff that talks to the user and the stuff that talks to the motors (which is a far better design and more extensible in my opinion). While it sounds complicated, it makes writing autonomous mode code extremely easy, since it is just a form of a 'movement control' class.

There is also a 'maintenance mode' controlled by a switch on the DS, that allows us to run various diagnostics and calibrate our servos, with user feedback displayed on the LCD on the driver station.

There are also probably about 10 files that just have utility functions (like missing math functions/constants, various filters and serialization stuff, a wrapper around the Joystick class to give it a better deadband, and a class useful for doing delayed actions).

I've attached the 'collaboration diagram' generated by Doxygen for our code. Its really quite logical, but there is a lot of stuff there.

I will actually be releasing our teams code in the very near future (as we are done for the season now that the Boston Regional is over), as soon as I finish work on my WPILib Test Harness GUI (its quite useful for some types of debugging, and lets me run code on my home computer -- but not quite ready for prime time).
Attached Thumbnails
Click image for larger version

Name:	classKwarqsRobotMain__coll__graph.png
Views:	67
Size:	66.5 KB
ID:	7642  
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote