Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Location of WPI Library cpp files attached to Windriver (http://www.chiefdelphi.com/forums/showthread.php?t=73951)

marccenter 08-02-2009 21:00

Location of WPI Library cpp files attached to Windriver
 
Hey folks,
I did a windows search for some of the WPI library files and did not find them on my local hard drive. Where are the WPI library files hidden relative to WIndriver? I see the *.h files but not the *.cpp files.

wt200999 08-02-2009 23:42

Re: Location of WPI Library cpp files attached to Windriver
 
They do not come with it, they are pre-compiled. You can download the WPILib files off of the WPI site if you would like though.

Ken Streeter 09-02-2009 07:57

Re: Location of WPI Library cpp files attached to Windriver
 
Quote:

Originally Posted by marccenter (Post 816889)
Hey folks,
I did a windows search for some of the WPI library files and did not find them on my local hard drive. Where are the WPI library files hidden relative to WIndriver? I see the *.h files but not the *.cpp files.

The source code is not included with the default installation package. However, they can be downloaded separately from the same place that the updated installation packages can be found:

http://first.wpi.edu/FRC/frcupdates.html

The direct link to the Update 3.0 source code is http://first.wpi.edu/Images/CMS/Firs...SourceCode.zip

marccenter 09-02-2009 12:20

Re: Location of WPI Library cpp files attached to Windriver
 
Hey guy's thanks for info.

Part 2 now: I wanted to create my own version of TankDrive so I could have a rate-limited (RL) input for acceleration control (TankDriveRL) by comparing last loop value to present loop value. I began modifying TankDrive by copying/pasting to TankDriveRL within Robotdrive.h but couldn't really finish because I did have access to Robotdrive.cpp source code. What do you recommend to proceed? (I am new to C++ and Windriver development environments)

1) Figure out a way to modfy Robotdrive.cpp? (seems not possible)

2) Create new files(*.h, *.cpp) for TankDriveRL and make up new TankDriveRL class/method?. (most likely candidate).

Alan Anderson 09-02-2009 14:21

Re: Location of WPI Library cpp files attached to Windriver
 
Quote:

Originally Posted by marccenter (Post 817272)
I wanted to create my own version of TankDrive... I began modifying TankDrive by copying/pasting to TankDriveRL...

2) Create new files(*.h, *.cpp) for TankDriveRL and make up new TankDriveRL class/method?. (most likely candidate).

Don't copy and paste. Inherit. Make a new class based on the old one, and replace the relevant methods to incorporate your rate limiting.

I'm not the right person to give detailed directions on exactly how to do that. Someone else with more C++ expertise than I do will have to help you further.

j_johnson 11-02-2009 12:47

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.


All times are GMT -5. The time now is 02:41.

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