FIRST Robotics Competition LabVIEW Examples

cancel
Showing results for 
Search instead for 
Did you mean: 

FRC LabVIEW Trajectory Library

Overview

This library is a port of the Java/C++ WPILIB routines that don't already exist in LabVIEW. The library is used for the First FRC robotics competition.

 

Originally, this library was only a port of the Trajectory creation and execution routines. However, over time, many other of the routines were ported into the library.

 

A number of trajectory creation and transformation utility programs are installed along with the library. These programs may be of use to FRC teams that use languages other than LabVIEW. We recommend installing the library and playing around with the functions. You might find something that you find useful!

 

Description

The library includes a large collection of subVIs that can be used in robot programs. Menu items for all the subVI's are included as part of the standard LabVIEW WPI Robotics Library menu.

SampleLabViewMenu.png

Each VI includes help that can be accessed using the standard LabVIEW help toggle (Ctrl H).

 

Here is a short list of the types of functions included in the library:

  • Pathfinder Utilities
    • Convert to trajectory
  •  Filters
    • Linear Filter
    • Median Filter
  • Slew Rate Limiter
  • Timer
  • Controllers
    • PID
    • Advanced PID
    • Profiled PID
    • Ramsete
    • Holonomic Drive
    • Simple Motor Feedforward
    • Arm Feedforward
    • Elevator Feedforward
  •  Geometry
    • Pose
    • Rotation
    • Transform
    • Translation
    • Twist
  •  Kinematics
    • Differential drive (tank/arcade)
    • Mecanum drive
    • Swerve drive
  • Odometry
    • Differential drive (tank/arcade)
    • Mecanum drive
    • Swerve drive
  • Spline (Used by trajectory creation routines)
    • Cubic
    • Quintic
  •  Trajectory
    • Configure, with constraints
    • Generate
    • Sample (forward and reverse)
  • Utilities
    • Read FPGA time (with rollover protection)
    • Library use and version information
    • Read trajectory CSV file
    • Write and document trajectory CSV file
  • Units Conversion
 

Steps to Implement or Execute Code

Robot trajectories can be created a number of different ways. The following chart shows some (maybe most) of the different ways of creating a trajectory for robot execution.

TrajFlowChart.png

The installed library contains a number of utility programs and task-specific functions that can help you get started.

 

Additionally, this library has a secondary .zip file with sample and test programs, several sample robots, and a sample robot dashboard for the FRC LabVIEW Trajectory. This .zip file is named "FRC_LV_TrajLib_Util_and_Samp-master" and can be found on this GitHub page: https://github.com/jsimpso81/FRC_LV_TrajLib_Util_and_Samp

 

It is highly recommended to use this example pack as a starting point to familiarize yourself with the library.

 

Installation

There are a number of prerequisites needed before installing this library.

  1. Install the FRC version of LabVIEW.
  2. Install the FRC game tools.

Download the latest install package attached to this post named "FRC_TrajLib-master.zip".

 

Select the .nipkg installation file, then double click it, or right click and select install. Administrative privileges will be needed to perform this installation. Follow the instructions. Usually selection of all the default answers is sufficient. Installation should take 5 minutes or less.

SampleInstall.png

To install the accompanying "FRC_LV_TrajLib_Util_and_Samp-master" sample project .zip, download the .zip from the following GitHub page (also posted below in "Additional Information"):

https://github.com/jsimpso81/FRC_LV_TrajLib_Util_and_Samp

 

Additional Information and Recognition

The GitHub repositories for both the library and its accompanying sample projects can be found here:

FRC_LV_TrajLib: https://github.com/jsimpso81/FRC_LV_TrajLib

FRC_LV_TrajLib_Util_and_Samp: https://github.com/jsimpso81/FRC_LV_TrajLib_Util_and_Samp

 

For more detailed information and version logs, we recommend referencing both theses GitHub links and the ReadMe's included with the downloads.

 

A special thanks to Jim Simpson, mentor FRC team 4150, FRobotics for creating, documenting, and curating this library along with all of the examples and sample projects.

Carter I
Staff Product Support Engineer
National Instruments
Comments
pylb
Member
Member
on

Wow, thanks a lot for doing this. It amazes me to see how many tools and functions that are available to Java teams were not given to LabVIEW teams. I knew there were differences but I didn't know they were that significant. I am surprised FIRST and NI let LabVIEW teams with such a disadvantage.

Thanks again for doing this, it looks great.

Hopefully, in the future, NI, FIRST and WPI will work together to make sure all teams have access to the same functions no matter which programming language they select.

JimASim
Member
Member
on

Thanks to NI for posting this.  The library has progressed since the ZIP file was posted.

 

This is a fairly complete port of the Math portion of the library used by the other FRC languages. 

 

The latest version can be found here.

 

Library

https://github.com/jsimpso81/FRC_LV_TrajLib

 

Samples

https://github.com/jsimpso81/FRC_LV_TrajLib_Util_and_Samp

 

Training

https://github.com/jsimpso81/FRC_Secret_Book_Of_FRC_LabVIEW_2

 

 

Contributors