
Gyro ( Java, C++): Demonstrates the use of the AnalogGyro class to measure robot heading and stabilize driving. Mechanisms control may be present, but is not the emphasized concept of these examples.ĪxisCameraSample ( Java, C++): Demonstrates the use of OpenCV and an Axis Netcam to overlay a rectangle on a captured video feed and stream it to the dashboard.ĬANPDP ( Java, C++): Demonstrates obtaining sensor information from the PDP over CAN using the PowerDistributionPanel class.ĭut圜ycleEncoder ( Java, C++): Demonstrates the use of the Dut圜ycleEncoder class to read values from a PWM-type absolute encoder.ĭut圜ycleInput ( Java, C++): Demonstrates the use of the Dut圜ycleInput class to read the frequency and fractional duty cycle of a PWM input.Įncoder ( Java, C++): Demonstrates the use of the Encoder class to read values from a quadrature encoder. These examples demonstrate sensor reading and data processing using WPILib. UltrasonicPID ( Java, C++): Demonstrates the use of the PIDController class in conjunction with an ultrasonic sensor to drive to a set distance from an object. SwerveBot ( Java, C++): Demonstrates an advanced swerve drive implementation, including encoder-and-gyro odometry through the SwerveDriveOdometry class, and composition with PID position and velocity control through the SwerveDriveKinematics and PIDController classes. RamseteController ( Java, C++): Demonstrates the use of the RamseteController class to follow a trajectory during the autonomous period. PotentiometerPID ( Java, C++): Demonstrates the use of the PIDController class and a potentiometer to control the position of an elevator mechanism. MecanumBot ( Java, C++): Demonstrates an advanced mecanum drive implementation, including encoder-and-gyro odometry through the MecanumDriveOdometry class, and composition with PID velocity control through the MecanumDriveKinematics and PIDController classes. GyroMecanum ( Java, C++): Demonstrates field-oriented control of a mecanum robot through the MecanumDrive class in conjunction with a gyro. Sensors may be present, but are not the emphasized concept of these examples.ĭifferentialDriveBot ( Java, C++): Demonstrates an advanced differential drive implementation, including encoder-and-gyro odometry through the DifferentialDriveOdometry class, and composition with PID velocity control through the DifferentialDriveKinematics and PIDController classes.ĮlevatorProfiledPID ( Java, C++): Demonstrates the use of the ProfiledPIDController class to control the position of an elevator mechanism.ĮlevatorTrapezoidProfile ( Java, C++): Demonstrates the use of the TrapezoidProfile class in conjunction with a “smart motor controller” to control the position of an elevator mechanism. These examples demonstrate WPILib implementations of common robot controls. TankDriveXboxController ( Java, C++): Demonstrates the same functionality seen in the previous example, except using an XboxController instead of an ordinary joystick. TankDrive ( Java): Demonstrates a simple differential drive implementation using “tank”-style controls through the DifferentialDrive class. Solenoid ( Java, C++): Demonstrates the use of the Solenoid and DoubleSolenoid classes to control solenoid outputs with a set of joystick buttons.

Relay ( Java, C++): Demonstrates the use of the Relay class to control a relay output with a set of joystick buttons.
#Frc smartdashboard usb camera how to#
QuickVision ( Java, C++): Demonstrates how to stream video from a USB camera to the dashboard. MotorControlEncoder ( Java, C++): Identical to the above example, except with the addition of an encoder to read the motor position. MotorControl ( Java, C++): Demonstrates how to control the output of a motor with a joystick.

MecanumDrive ( Java, C++): Demonstrates a simple mecanum drive implementation using the MecanumDrive class. GettingStarted ( Java, C++): Demonstrates a simple autonomous routine that drives forwards for two seconds at half speed.

They are useful for beginning teams who are gaining initial familiarity with robot programming, but are highly limited in functionality.ĪrcadeDrive ( Java, C++): Demonstrates a simple differential drive implementation using “arcade”-style controls through the DifferentialDrive class.ĪrcadeDriveXboxController ( Java, C++): Demonstrates the same functionality seen in the previous example, except using an XboxController instead of an ordinary joystick.

These examples demonstrate basic/minimal robot functionality.
