View Single Post
  #11   Spotlight this post!  
Unread 25-07-2013, 13:18
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: paper: FRC #33 The Killer Bees 2013 Software - BuzzXVIII (Buzz18)

Quote:
Originally Posted by JamesTerm View Post
That is brilliant! I am looking forward to reviewing this C example code!
Example C code is in the zip (culverdrive_sw_release.zip). It isn't great, and isn't tested like the LV implementation, but should illustrate how the logic works.

interp.c and interp.h are C implementations of the LV interpolation functions. I tested these on a desktop GCC build/test harness and they work. We use these in the Culverdrive to define smooth enabling of different terms, and use them elsewhere for nonlinear functions. They're very useful functions. I can explain their use in more detail if anyone is interested.

culverdrive.h is the header, self explanetory.

The logic itself is written and commented in culverdrive.c in the culver_drive() function. The const data is defined in culverdrivedata.c.

There are some things that are a little weird about the C code. I intended to run it on Vex targets, but it won't compile in RobotC because RobotC does not support the C language very well.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote