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.

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.

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/First/WPILibRC0.1718SourceCode.zip

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).

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.

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.


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.