Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   KwarQs 2010 C++ Code Released (http://www.chiefdelphi.com/forums/showthread.php?t=84955)

virtuald 05-04-2010 00:00

KwarQs 2010 C++ Code Released
 
Team 2423 strongly believes in sharing techniques and resources with other teams, and we release our source code out for others to see/use as example code each year. Our team programmed our bot in C++ yet again this year.

This year our code was mostly done by our students (except I went in and cleaned it up a bit). In particular our kicker mechanism and our autonomous mode was almost entirely developed by students, and they did an excellent job. This was our best year yet, we had a very consistent robot.

Some things that are useful to point out that you might be interested in:
  • Wheel configuration is 100% compatible with the default kitbot configuration
  • Heavily modified the FRC Vision processing code from this year. Vision processing placed in its own low-priority thread (so it sends pictures to your dashboard in disabled/autonomous also)
  • Autonomous mode that *used* to rely on vision processing, but our Gyro failed. However, we modified it so it still works (the vision stuff is still in comments). At the Boston Regional we consistently scored 1 or 2 goals autonomously most matches.
  • Useful 'NosePointer' class to allow multiple things to control where the robot is pointing via PID control
  • X/Y coordinate position tracking using encoders (didn't really use it though, but it mostly works)
  • Heavily integrated with WebDMA for more effective tuning/debugging
  • BSD-style license, feel free to use our code!

Download it from my website at http://www.virtualroadside.com/FRC/#Kwarqs2010

mikets 05-04-2010 15:27

Re: KwarQs 2010 C++ Code Released
 
I am glad you guys have similar idea of sharing information. I would go further to also share methodologies of how we did things such as source control, information sharing and other knowledge. It is always intriguing to learn how things are done differently and learn from it.

This is the first year our team uses C++. We have an ambition that we will develop a common robot task library that enables code reuse year after year instead of debugging similar yet different code over and over again. Therefore, we have put extraordinary effort in refactoring the code as generic as possible. As a result of developing this library, we also put in place a debugging infrastructure based on real time tracing. We would like to share this with other teams and receive feedback on how to improve this library. Since this is our first attempt, the library is in its infancy. There are a lot of functions we would like to add but aren't there yet. Currently, the library has the following support:
  • Tri-zone support for analog inputs: generating events when sensor value crosses some thresholds.
  • Event notification for digitial inputs: generating events when a digital input changes state.
  • Event notification for joystick buttons: generate one-shot event when a joystick button changes state.
  • Generic state machine: implementing a non-blocking state machine that allows other code to run while the state machine is waiting.
  • Event sub-system: implementing non-blocking waitable events for use by the state machines.
  • Accelerometer module: allows it to be used as a distance sensor for PID control.
  • Generic drive module: allows a event driven non-blocking drive subsystem.
  • Timer module: implements a timer callback mechanism.
  • Two variable PID control system: allowing PID to control drive and turn at the same time.
  • Debug tracing subsystem: allows code tracing of individual classes and modules during the debugging process.

Our source control site can be found at:
http://proj.titanrobotics.net/hg/Frc/2010/code

Comments and feedbacks are welcome.


All times are GMT -5. The time now is 13:50.

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