Go to Post When you start thinking of FIRST as a robotic building contest you have left the pavement and you are in deep weeds. - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-11-2009, 12:47 PM
j_johnson j_johnson is offline
Registered User
FRC #0226 (Hammerheads)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Shelby Township, MI
Posts: 10
j_johnson is an unknown quantity at this point
Re: Location of WPI Library cpp files attached to Windriver

Another good option for operations like this is to use a pipeline pattern. Our team created a class that inherits from SpeedController and takes another SpeedController as it's output. Inside this class's Set method, it procceses the input and passes the result to the output. This pattern allows you to create classes to perform operations such as rate limiting, traction control, velocity control, etc. to each act individually. You can then chain them together through the constructors as below.

Code:
float accelLimit = .03;
SpeedController leftDriveMotor = new Jaguar(1);
SpeedController leftAccelLimiter = new AccelerationLimiter (leftDriveMotor, accelLimit);
SpeedController leftTractionControl = new TractionControl(leftAccelLimiter);
SpeedController rightDriveMotor = new Jaguar(2);
SpeedController rightAccelLimiter = new AccelerationLimiter (rightDriveMotor, accelLimit);
SpeedController rightTractionControl = new TractionControl(rightAccelLimiter);
m_robotDrive = new RobotDrive(leftTractionControl, rightTractionControl);
This makes it very easy to test each piece individually and then chain them together.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible confusion between competition location and shipping location rl1806 General Forum 2 02-07-2009 12:27 AM
Need Help Locating .h and .cpp files jkjohnson Programming 0 01-30-2009 09:00 AM
downloading the WPI library off the SVN nickmagus Programming 13 01-05-2009 02:29 PM
cRIO-FRC Training Video: WPI Library Overview BLAQmx National Instruments LabVIEW and Data Acquisition 5 11-09-2008 07:58 PM
Where is WPI Library Information PDF? koenig3456 Programming 2 01-15-2006 04:19 PM


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

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